SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
Monk, a ragasztó
                          Bácsi László, lackac.hu
                         na meg ruby.meetup.hu ;)




2009. szeptember 17.
Monk, a ragasztó


                       “Monk is a glue framework for web
                       development in Ruby. It’s truly modular by
                       relying on the best tool for each job. It’s
                       also pretty fast thanks to Rack and Sinatra.”




2009. szeptember 17.
Tehát a Monk igazából
                              Sinatra?
                       Sinatra

                       Contest

                       Rack::Test

                       Webrat

                       Ohm (Redis)

                       logger, settings hash, development reloading
2009. szeptember 17.
Kezdeti lépések


                       $ sudo gem install monk

                       $ monk init myapp

                        git://github.com/monkrb/skeleton.rb




2009. szeptember 17.
Felépítés
                       ./app                  ./config

                       ./app/helpers          ./lib

                       ./app/models           ./vendor

                       ./app/routes           etc.

                       ./app/views




2009. szeptember 17.
Routes
            1 class Main
            2   get "/" do
            3     haml :home
            4   end
            5
            6   ...
            7 end




2009. szeptember 17.
Views

                       Haml, Sass




          = partial :games, :players => @players




2009. szeptember 17.
Models

                       Ohm (Redis)


           1 class Player < Ohm::Model
           2   attribute :name
           3   set :nicknames
           4   list Games
           5   counter :wins
           6
           7   index :name
           8
           9   def validate
          10     assert_present :name
          11   end
          12 end




2009. szeptember 17.
Ohm
            1   >>     require "ohm"
            2   =>     true
            3   >>     Ohm.connect
            4   =>     []
            5   >>     Ohm.redis.set "Foo", "Bar"
            6   =>     "OK"
            7   >>     Ohm.redis.get "Foo"
            8   =>     "Bar"



           1    player = Players.create :name => "Michael Jordan"
           2    player.id
           3    # => 1
           4
           5    # Find a player by id
           6    player == Player[1]
           7    # => true
           8
           9    # Trying to find a non existent player
          10    Player[2]
          11    # => nil




2009. szeptember 17.
Helpers
            1 class Main
            2   helpers do
            3     def my_helper
            4       ...
            5     end
            6
            7     ...
            8   end
            9 end




2009. szeptember 17.
Dependencies
          haml 2.2.3 git://github.com/nex3/haml.git
          ohm 0.0.19 git://github.com/soveran/ohm.git


          $ dep vendor --all
          vendor
          |-- sinatra-0.9.4
          `-- haml-2.2.2
          ...




2009. szeptember 17.
Skeletons
          $ monk list
                default git://github.com/monkrb/skeleton.git
          $ monk add compass git://github.com/lackac/skeleton.git
          $ monk list
                default git://github.com/monkrb/skeleton.git
                compass git://github.com/lackac/skeleton.git




2009. szeptember 17.
Directory




2009. szeptember 17.
Demó, kérdések...

                       http://monkrb.com/

                       http://ohm.keyvalue.org/

                       http://github.com/lackac/skeleton/

                       http://lackac.hu/



2009. szeptember 17.

Contenu connexe

En vedette

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Monk

  • 1. Monk, a ragasztó Bácsi László, lackac.hu na meg ruby.meetup.hu ;) 2009. szeptember 17.
  • 2. Monk, a ragasztó “Monk is a glue framework for web development in Ruby. It’s truly modular by relying on the best tool for each job. It’s also pretty fast thanks to Rack and Sinatra.” 2009. szeptember 17.
  • 3. Tehát a Monk igazából Sinatra? Sinatra Contest Rack::Test Webrat Ohm (Redis) logger, settings hash, development reloading 2009. szeptember 17.
  • 4. Kezdeti lépések $ sudo gem install monk $ monk init myapp git://github.com/monkrb/skeleton.rb 2009. szeptember 17.
  • 5. Felépítés ./app ./config ./app/helpers ./lib ./app/models ./vendor ./app/routes etc. ./app/views 2009. szeptember 17.
  • 6. Routes 1 class Main 2 get "/" do 3 haml :home 4 end 5 6 ... 7 end 2009. szeptember 17.
  • 7. Views Haml, Sass = partial :games, :players => @players 2009. szeptember 17.
  • 8. Models Ohm (Redis) 1 class Player < Ohm::Model 2 attribute :name 3 set :nicknames 4 list Games 5 counter :wins 6 7 index :name 8 9 def validate 10 assert_present :name 11 end 12 end 2009. szeptember 17.
  • 9. Ohm 1 >> require "ohm" 2 => true 3 >> Ohm.connect 4 => [] 5 >> Ohm.redis.set "Foo", "Bar" 6 => "OK" 7 >> Ohm.redis.get "Foo" 8 => "Bar" 1 player = Players.create :name => "Michael Jordan" 2 player.id 3 # => 1 4 5 # Find a player by id 6 player == Player[1] 7 # => true 8 9 # Trying to find a non existent player 10 Player[2] 11 # => nil 2009. szeptember 17.
  • 10. Helpers 1 class Main 2 helpers do 3 def my_helper 4 ... 5 end 6 7 ... 8 end 9 end 2009. szeptember 17.
  • 11. Dependencies haml 2.2.3 git://github.com/nex3/haml.git ohm 0.0.19 git://github.com/soveran/ohm.git $ dep vendor --all vendor |-- sinatra-0.9.4 `-- haml-2.2.2 ... 2009. szeptember 17.
  • 12. Skeletons $ monk list default git://github.com/monkrb/skeleton.git $ monk add compass git://github.com/lackac/skeleton.git $ monk list default git://github.com/monkrb/skeleton.git compass git://github.com/lackac/skeleton.git 2009. szeptember 17.
  • 14. Demó, kérdések... http://monkrb.com/ http://ohm.keyvalue.org/ http://github.com/lackac/skeleton/ http://lackac.hu/ 2009. szeptember 17.