SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
Bootstrapping Project Code
                          László Bácsi
                           @icanscale
                       github.com/lackac




2009. szeptember 28.
In the old days
          $ rails myapp
                create
                create    app/controllers
                create    app/helpers
                create    app/models
                create    app/views/layouts
                create    config/environments
                create    config/initializers
                create    config/locales
                create    db
                create    doc
                create    lib



                                           and later...
          $   script/plugin install stuff
          $   script/generate stuff MyStuff
          $   cp -r ../other_stuff my_other_stuff
          $   # and much much more other stuff




2009. szeptember 28.
Takes a lot of time and
                   effort but it’s “modular”



2009. szeptember 28.
Then came app skeletons
                       Bort

                       and many others




2009. szeptember 28.
Lightning fast but no
                            modularity



2009. szeptember 28.
Then came Rails templates
          # template.rb
          run "rm public/index.html"
          generate(:scaffold, "person name:string")
          route "map.root :controller => 'people'"
          rake("db:migrate")

          git :init
          git :add => "."
          git :commit => "-a -m 'Initial commit'"



          $ rails myapp -m template.rb




2009. szeptember 28.
Lightning fast, easier
                       customization but still
                            no modularity


2009. szeptember 28.
Then came App LEGO

                       Using Rails templates

                       Modular

                         each feature has its own template

                         you can decide which modules you want



2009. szeptember 28.
Then came App LEGO
          $ rails -m http://github.com/lackac/app_lego/raw/master/app_lego.rb my_app
          ...
                 create log/test.log
               applying template: http://github.com/lackac/app_lego/raw/master/app_lego.rb
                        Use braid for vendor management?
          y
                        Do you want to play LEGO?
          y
                        Install everything without question?
          n
                        Do basic setup? (only exclude this if you already have a Rails app skeleton with Rails 2.3+ frozen,
          or as a gem)
          y
               applying template: http://github.com/lackac/app_lego/raw/master/basic.rb
              executing rmdir tmp/{pids,sessions,sockets,cache} from /private/tmp/my_app
              executing rm README log/*.log public/index.html public/images/rails.png from /private/tmp/my_app
              executing find . ( -type d -empty ) -and ( -not -regex ./.git.* ) -exec touch {}/.gitignore ; from /
          private/tmp/my_app
                running git init
                   file .gitignore
              executing cp config/database.yml config/database.yml.sample from /private/tmp/my_app
                running git add .
                running git commit -a -m 'Setting up a new rails app. Copy config/database.yml.sample to config/
          database.yml and customize.'
              executing braid add git://github.com/rails/rails.git vendor/rails from /private/tmp/my_app
            initialized application structure
                applied http://github.com/lackac/app_lego/raw/master/basic.rb
                        Use RSpec instead of test/unit?
          y
               applying template: http://github.com/lackac/app_lego/raw/master/rspec.rb
          ...




2009. szeptember 28.
Modules are plain templates
          gem 'haml', :version => '>= 2.1'
          gem 'chriseppstein-compass', :lib => 'compass', :version => '>= 0.3.4'

          run "haml --rails ."
          run "echo -e 'ynnn' | compass --rails -f blueprint"

          git :add => "."
          git :commit => "-a -m 'Added haml for views and compass for css'"




                       braid                                             auth
                       basic                                             couchdb
                       rspec                                             locale
                       haml                                              misc
                       jquery                                            and others...


2009. szeptember 28.
And others...




2009. szeptember 28.
Still fast, modular and
                             customizable



2009. szeptember 28.
Downsides


                       really long command line to remember

                       a lot of questions

                       options in ENV vars




2009. szeptember 28.
Future
                       create wrapper script

                       use dependencies instead of ordering

                       use regular and meaningful command line
                       options

                       simple sinatra application as a user
                       interface

                       merge interesting modules

2009. szeptember 28.
Thank you!
                            László Bácsi, @icanscale
                       http://github.com/lackac/app_lego




2009. szeptember 28.

Mais conteúdo relacionado

Mais procurados

Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with Capistrano
Almir Mendes
 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScript
Eddie Kao
 

Mais procurados (20)

Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
PROCESS WARP「プロセスがデバイス間で移動する」仕組みを作る
PROCESS WARP「プロセスがデバイス間で移動する」仕組みを作るPROCESS WARP「プロセスがデバイス間で移動する」仕組みを作る
PROCESS WARP「プロセスがデバイス間で移動する」仕組みを作る
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with Capistrano
 
Calabash automated test
Calabash automated testCalabash automated test
Calabash automated test
 
Sinatra Rack And Middleware
Sinatra Rack And MiddlewareSinatra Rack And Middleware
Sinatra Rack And Middleware
 
Moving to modules
Moving to modulesMoving to modules
Moving to modules
 
The Power of F#
The Power of F#The Power of F#
The Power of F#
 
Laravel mix
Laravel mixLaravel mix
Laravel mix
 
Extracting ruby gem
Extracting ruby gemExtracting ruby gem
Extracting ruby gem
 
Coffeescript: An Opinionated Introduction
Coffeescript: An Opinionated IntroductionCoffeescript: An Opinionated Introduction
Coffeescript: An Opinionated Introduction
 
ZSH and RVM
ZSH and RVMZSH and RVM
ZSH and RVM
 
Ruby Kaigi 2008 LT
Ruby Kaigi 2008 LTRuby Kaigi 2008 LT
Ruby Kaigi 2008 LT
 
Happy Programming with CoffeeScript
Happy Programming with CoffeeScriptHappy Programming with CoffeeScript
Happy Programming with CoffeeScript
 
Tools beyond ruby on rails
Tools beyond ruby on railsTools beyond ruby on rails
Tools beyond ruby on rails
 
Rails 3 : Cool New Things
Rails 3 : Cool New ThingsRails 3 : Cool New Things
Rails 3 : Cool New Things
 
Custom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql ReplicationCustom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql Replication
 
Cucaruba!
Cucaruba!Cucaruba!
Cucaruba!
 
So R Debugging
So R DebuggingSo R Debugging
So R Debugging
 
Apache Sling - The whys and the hows
Apache Sling - The whys and the howsApache Sling - The whys and the hows
Apache Sling - The whys and the hows
 
TsWorkflow
TsWorkflowTsWorkflow
TsWorkflow
 

Destaque

Da Ideia ao Produto | Como criar o seu negócio
Da Ideia ao Produto | Como criar o seu negócioDa Ideia ao Produto | Como criar o seu negócio
Da Ideia ao Produto | Como criar o seu negócio
Alexandre Spengler
 
GovLoop Online Innovator's Summit 9/2012
GovLoop Online Innovator's Summit 9/2012GovLoop Online Innovator's Summit 9/2012
GovLoop Online Innovator's Summit 9/2012
Hillary Hartley
 

Destaque (8)

Haml, Sass & Compass
Haml, Sass & CompassHaml, Sass & Compass
Haml, Sass & Compass
 
Ruby Crash Course
Ruby Crash CourseRuby Crash Course
Ruby Crash Course
 
Monk
MonkMonk
Monk
 
Da Ideia ao Produto | Como criar o seu negócio
Da Ideia ao Produto | Como criar o seu negócioDa Ideia ao Produto | Como criar o seu negócio
Da Ideia ao Produto | Como criar o seu negócio
 
GovLoop Online Innovator's Summit 9/2012
GovLoop Online Innovator's Summit 9/2012GovLoop Online Innovator's Summit 9/2012
GovLoop Online Innovator's Summit 9/2012
 
Firefox kiterjesztés fejlesztés
Firefox kiterjesztés fejlesztésFirefox kiterjesztés fejlesztés
Firefox kiterjesztés fejlesztés
 
Criação de negócios inovadores
Criação de negócios inovadoresCriação de negócios inovadores
Criação de negócios inovadores
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Semelhante a App Lego

Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
Spike Brehm
 
RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”
RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”
RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”
elliando dias
 

Semelhante a App Lego (20)

Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScript
 
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman OrtegaIntroduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortega
 
Rails-3-app-auto-generator-20100817
Rails-3-app-auto-generator-20100817Rails-3-app-auto-generator-20100817
Rails-3-app-auto-generator-20100817
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012Ruby C extensions at the Ruby drink-up of Sophia, April 2012
Ruby C extensions at the Ruby drink-up of Sophia, April 2012
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJSBuilding a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
Play framework
Play frameworkPlay framework
Play framework
 
RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”
RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”
RestfulX “The RESTful Way to develop Adobe Flex and AIR applications”
 
Create a new project in ROR
Create a new project in RORCreate a new project in ROR
Create a new project in ROR
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Ruby on Rails 3 Day BC
Ruby on Rails 3 Day BCRuby on Rails 3 Day BC
Ruby on Rails 3 Day BC
 
Curso rails
Curso railsCurso rails
Curso rails
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails Basics
 
rails.html
rails.htmlrails.html
rails.html
 
rails.html
rails.htmlrails.html
rails.html
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the Cloud
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

App Lego

  • 1. Bootstrapping Project Code László Bácsi @icanscale github.com/lackac 2009. szeptember 28.
  • 2. In the old days $ rails myapp create create app/controllers create app/helpers create app/models create app/views/layouts create config/environments create config/initializers create config/locales create db create doc create lib and later... $ script/plugin install stuff $ script/generate stuff MyStuff $ cp -r ../other_stuff my_other_stuff $ # and much much more other stuff 2009. szeptember 28.
  • 3. Takes a lot of time and effort but it’s “modular” 2009. szeptember 28.
  • 4. Then came app skeletons Bort and many others 2009. szeptember 28.
  • 5. Lightning fast but no modularity 2009. szeptember 28.
  • 6. Then came Rails templates # template.rb run "rm public/index.html" generate(:scaffold, "person name:string") route "map.root :controller => 'people'" rake("db:migrate") git :init git :add => "." git :commit => "-a -m 'Initial commit'" $ rails myapp -m template.rb 2009. szeptember 28.
  • 7. Lightning fast, easier customization but still no modularity 2009. szeptember 28.
  • 8. Then came App LEGO Using Rails templates Modular each feature has its own template you can decide which modules you want 2009. szeptember 28.
  • 9. Then came App LEGO $ rails -m http://github.com/lackac/app_lego/raw/master/app_lego.rb my_app ... create log/test.log applying template: http://github.com/lackac/app_lego/raw/master/app_lego.rb Use braid for vendor management? y Do you want to play LEGO? y Install everything without question? n Do basic setup? (only exclude this if you already have a Rails app skeleton with Rails 2.3+ frozen, or as a gem) y applying template: http://github.com/lackac/app_lego/raw/master/basic.rb executing rmdir tmp/{pids,sessions,sockets,cache} from /private/tmp/my_app executing rm README log/*.log public/index.html public/images/rails.png from /private/tmp/my_app executing find . ( -type d -empty ) -and ( -not -regex ./.git.* ) -exec touch {}/.gitignore ; from / private/tmp/my_app running git init file .gitignore executing cp config/database.yml config/database.yml.sample from /private/tmp/my_app running git add . running git commit -a -m 'Setting up a new rails app. Copy config/database.yml.sample to config/ database.yml and customize.' executing braid add git://github.com/rails/rails.git vendor/rails from /private/tmp/my_app initialized application structure applied http://github.com/lackac/app_lego/raw/master/basic.rb Use RSpec instead of test/unit? y applying template: http://github.com/lackac/app_lego/raw/master/rspec.rb ... 2009. szeptember 28.
  • 10. Modules are plain templates gem 'haml', :version => '>= 2.1' gem 'chriseppstein-compass', :lib => 'compass', :version => '>= 0.3.4' run "haml --rails ." run "echo -e 'ynnn' | compass --rails -f blueprint" git :add => "." git :commit => "-a -m 'Added haml for views and compass for css'" braid auth basic couchdb rspec locale haml misc jquery and others... 2009. szeptember 28.
  • 12. Still fast, modular and customizable 2009. szeptember 28.
  • 13. Downsides really long command line to remember a lot of questions options in ENV vars 2009. szeptember 28.
  • 14. Future create wrapper script use dependencies instead of ordering use regular and meaningful command line options simple sinatra application as a user interface merge interesting modules 2009. szeptember 28.
  • 15. Thank you! László Bácsi, @icanscale http://github.com/lackac/app_lego 2009. szeptember 28.