Damage Control

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites

    Damage Control - Presentation Transcript

    1. Damage Control Brock Whitten (sintaxi)
    2. if rails.is_ghetto? merb = ???? end
    3. choice => two kinds 1) pick your tools ORM, JavaScript, Testing, Template Engine, Server 2) size it to fit Cache, Helpers, Mailer, Database?
    4. plugins/slices/gems
    5. plugins/slices/gems ...are all gems
    6. plugins/slices/gems ...are all gems. WTF?
    7. freeze > gem install RedCloth -i gems
    8. freeze > gem install RedCloth -i gems /gems /bin /cache /doc /gems /RedCloth-4.0.4 /specifications
    9. configuration /config database.yml dependencies.rb init.rb rack.rb router.rb
    10. dependencies.rb dependency “RedCloth”, “4.0.4” dependency “BlueCloth”, “1.0.0” dependency “coderay”, “0.7.4”
    11. init.rb require 'config/dependencies.rb' use_orm :datamapper use_test :rspec use_template_engine :erb Merb::Config.use do |c| c[:use_mutex] = false c[:session_store] = 'datamapper' c[:session_secret_key] = '1205346b9baa87cf8e31ac0971' c[:session_id_key] = '_session_id' end Merb::BootLoader.before_app_loads do # ... end Merb::BootLoader.after_app_loads do # ...
    12. an opinionated merb helpers datamapper rspec merb-auth sqlite3 jquery.js
    13. merb stack > sudo gem install merb
    14. merb stack > sudo gem install merb gems = [   [\"merb-core\", \"~> #{GEM_VERSION}\"],   [\"merb-more\", \"~> #{GEM_VERSION}\"],   [\"dm-core\", \"~> 0.9.6\"],   [\"do_sqlite3\", \"~> 0.9.6\"],   [\"dm-timestamps\", \"~> 0.9.6\"],   [\"dm-types\", \"~> 0.9.6\"],   [\"dm-aggregates\", \"~> 0.9.6\"],   [\"dm-migrations\", \"~> 0.9.6\"],   [\"dm-validations\", \"~> 0.9.6\"],   [\"dm-sweatshop\", \"~> 0.9.6\"] ]
    15. merb stack > merb-gen app my_blog > merb-gen resource article > rake db:automigrate > merb
    16. config/router.rb Merb::Router.prepare do resources :articles default_routes match('/').to(:controller => 'articles', :action =>'index') end
    17. models/user.rb class User include DataMapper::Resource Merb::Authentication.user_class = self property :id, Serial property :login, String end
    18. controllers/articles.rb class Article < Application provides :xml, :yaml, :js before :ensure_authenticated def show @article = Article.get(params[:id]) raise NotFound unless @article display @article end end
    19. DataMapper # queries Article.all Article.first :order => [:created_at.desc] Article.get(params[:id]) #validations validates_present :title validates_is_number :rating #associations has n, :comments belongs_to :blog has 1, :author
    20. deploy > merb -e production -c 4 -p 9000
    21. OSIM!
    22. tools textmate bundle git://github.com/drnic/merb-tmbundle.git wiki http://wiki.merbivore.com/ irc http://irc.freenode.net/ #merb http://irc.freenode.net/ #datamapper
    23. gem install thor http://merbunity.com/tutorials/18
    24. questions?

    + sintaxisintaxi, 2 years ago

    custom

    1078 views, 2 favs, 0 embeds more stats

    MerbCamp 2008 - getting started guide

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1078
      • 1078 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 42
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories