Top Banner
merb contagion @ Ruby Tuesday, Taiwan
21

Merb

May 18, 2015

Download

Technology

Contagion

presented in Ruby Tuesday 12/23
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Merb

merbcontagion @ Ruby Tuesday, Taiwan

Page 2: Merb

Ruby Web Framework

• The one and the only Rails• Actually, there are others...

• rmaze

• mack

• sinatra

• camping

Page 3: Merb

merb

• Scalability

• Flexibility

• Awesome Features

and.......

Page 4: Merb

Speed

Anything that slows merb down is a bug !

Page 5: Merb

Size

• No Code is Better then No Code

• LOC

• Rails 24K~50K

• merb 10K~17K

Page 6: Merb

Simplicity

• No Magic

• Magic is for your JOB security...

• Hacker’s framework ?

• makes you a hacker

• I Grok it !!

Page 7: Merb

Call Stack

• Shorter Call Stack

• Rails 41~58 (more with plugins)

• merb 27~32

Page 8: Merb

Adaptablility

• ORM - datamapper, active record, sequeal

• Javascript - jquery, prototype

• testing - runit, rspec

• template engine - erb, haml

Page 9: Merb

Modularity

• Rails 6 gems

• merb 18 gems

• merb-core

• merb-more

• datamapper 9 gems

Page 10: Merb
Page 11: Merb

Merb API

• private Don’t touch them

• public

• plugin (overridable)

Page 12: Merb

Plugin

• plugin is simply a gem

• dependency management !

• Hooks

• APIs

• no more alias_method_chain

Page 13: Merb

Flexiable file layout

• fullstack merb-gen app

• core only merb-gen core

• simple merb-gen flat

• singel file merb-gen very_flat

Page 14: Merb

Awesome Features

• Exception handling

• Run later

• sexy route

• Content Negotiation

• Slices

• Parts

Page 15: Merb

Exception

• raise NotFound

• status = 404

• controller: exceptions

• action: not_found

• Not Log in

• status = 401

• controller: exceptions

• action: unauthenticated

Page 16: Merb

Run Later

Page 17: Merb

Sexy route

Page 18: Merb

Content Negotiation

Page 19: Merb

Slices

• mini application

• like Django’s app

• like Rails’s Engine

• reusability haven!

• ex. merb-auth, merb-blog, merb-cms

Page 20: Merb

Parts

• a component

• component in rails1.0

• before filter + partial

Page 21: Merb

Q&A