SlideShare a Scribd company logo
1 of 43
ru sh ,[object Object]
http://flickr.com/photos/exquisitur/2551255999/
What is ru sh ? ,[object Object],[object Object]
Install and Run $ sudo gem install rush $ rush rush> home=> localhost:/Users/schlueter/
No  Working Directory $ home => localhost:/Users/schlueter $ root=> localhost://// $  rushmate  =  home[ "mydev/github/rushmate/" ] => localhost:/Users/schlueter/mydev/github/rushmate/
But ls Still Works $ home[ "mydev/github/rushmate/" ].ls /Users/schlueter/mydev/github/rushmate/ coverage/ lib/ test/ History.txt MIT-LICENSE Manifest.txt
Make a Variable $  rushmate  =  home[ "mydev/github/rushmate/" ]
File Manipulation http://flickr.com/photos/takashi/18862634/
Rename # assign a file to a variable $ file  =  rushmate[ 'app/models/rushmate.rb' ] $ file.rename  'russian_mate.rb'
Duplicate a File $ file  =  rushmate[ 'README' ] $ file.duplicate  'README.markdown'
Copy Different Directory $ file  =  rushmate[ 'README' ] $ file.copy_to other_project[ 'README' ]
Move $ file  =  rushmate[ 'README' ] $ file.move_to home[ 'Desktop/' ]
Write a File $ file  =  rushmate[ 'README' ] $ file.write  "You Read Me"
Read a File $ rushmate[ "README" ].contents You Read Me
File Globbing
Basic Globbing $  rushmate[ "**/*.rb" ] .../mydev/github/rushmate/lib/rushmate.rb.../mydev/github/rushmate/lib/rushmate/command.rb.../mydev/github/rushmate/lib/rushmate/exit.rb ... =>  9  x  Rush :: File
Glob into an Editor $  rushmate[ "**/*.rb" ].vi $  rushmate[ "**/*.rb" ].mate
Operate on Results $ rails_proj[ '**/*.rhtml' ].each { | f |   f.rename f.name.gsub( /  rhtml/ ,  '.html.erb' ) }
Results Are an Array $ rushmate[ "**/*.rb" ].reject {| f | f.name.match( /test.rb/ )} Go Nuts! $ rails_project[ "**/*.rhtml" ]  +  rails_project[ "**/*.html.erb" ]
embed http://flickr.com/photos/liamngls/413522957/ Rush :: EmbeddableShell . new .execute_in_shell  do   #anything in here delegates to rush end
Sake Quick Index of RDoc task  'rdoc:local'  =>  'rush'   do   shell  =   Rush :: EmbeddableShell . new   shell.execute_in_shell  do   end end ruby  =  root[ &quot;/Library/Ruby/Gems/1.8/&quot; ]   indexes  =  ruby[ &quot;doc/*/rdoc/index.html&quot; ]   hrefs  =  indexes.collect { | f |    path  =  f.full_path   text  =  path.match( /doc  (.*)  rdoc/ )[ 1 ]   &quot;<a href= amp;quot; #{path} amp;quot; >#{text}</a>&quot;     }   home[ &quot;rdoc.html&quot; ].write hrefs.join( &quot;<br />&quot; )   home.bash( &quot;open rdoc.html&quot; )
sake rdoc:local
 
Refactoring http://flickr.com/photos/tonyjcase/2262229518/
Search $ work[ &quot;**/*.rb&quot; ].search( /  Rushmate  / ) .../test/user_input_test.rb  => assert_equal(&quot;foo&quot;,  Rushmate ::.../lib/rushmate/command.rb  => module  Rushmate .../lib/rushmate/exit.rb  => module  Rushmate ...7 matching files with 25 matching lines $ work[ &quot;**/*.rb&quot; ].search( /  Rushmate  / ).mate
and Replace ,[object Object],[object Object],.../lib/rushmate.rb.../lib/rushmate/command.rb.../lib/rushmate/exit.rb =>  9  x  Rush :: File
Regex is your friend $ project_files.replace_contents!  ( /User.authenticate  *(.*),  *(.*)  / ,  'User.authenticate(  2,   1)' ) User .authenticate(user, password) User .authenticate(password, user)
Processes ,[object Object],[object Object],[object Object],[object Object],[object Object],$ ff  =  processes.filter( :cmdline  =>  /firefox/ ).first
Real World Rush :: EmbeddableShell . new .execute_in_shell  do end ff_processes  =  processes. filter ( :cmdline  =>  /firefox/ )   if  ff  =  ff_processes.select{| p | p.mem  >   400000 }.first   ff_cmdline  =  ff.cmdline   ff.kill   home.bash ff_cmdline,  :background  =>  true   end
Permissions $ file.access  =   { :user_can  =>  :read_and_write ,    :group_and_other_can  =>  :read  } $ file.access[ :user_can_read ] => true
Use BASH if you must $ rushmate.bash  &quot;rm -rf .&quot; # D'oh!
Shell Locally Act Globally
Remote $  remote  =   Rush :: Box . new ( 'user@server.com' ) $  remote[ &quot;/u/app/current/REVISION&quot; ].contents => 160
Starts a Mongrel on Remote Server Use in production with caution
Customize # setup variables to common directories rushmate  =  home[ &quot;mydev/github/rushmate/&quot; ] # setup variables to common servers qa  =   Rush :: Box . new ( 'user@qa.local' ) ~/.rush/evn.rb
Cheap Backup def   cheap_backup (directory)   unless  directory.dir?   puts  &quot;cheap backup only works on dirs&quot;   return   end   backup_path  =  directory.path  +   &quot;/&quot;   +  directory.name  +   &quot;.bak&quot;   if   self [backup_path].exists?   puts  &quot;backup already exists&quot;   else   directory.duplicate(directory.name  +   &quot;.bak&quot; )   end end
Extend # allows you to run  # directory.coverage def   coverage   self .rake( &quot;coverage&quot; ) end ~/.rush/commands.rb
Another Command def   ruby_files   self [ &quot;**/*.rb&quot; ] end $ rushmate.ruby_files .../mydev/github/rushmate/lib/rushmate.rb.../mydev/github/rushmate/lib/rushmate/command.rb.../mydev/github/rushmate/lib/rushmate/exit.rb ... => 9 x Rush::File
 
TextMate Rushmate :: Command . new  {   # find ruby files with the current word in textmate   found_files  =  project_directory[ &quot;**/#{current_word.downcase}.rb&quot; ]   if  found_files.size  ==   1   found_files.mate   else   menu_files  =  found_files.collect    { | f | f.full_path.gsub(project_directory.full_path,  &quot;&quot; ) }   project_directory[user_input.quick_menu_from_array(menu_files)].mate   end }
The Take Away
Questions ?
Thank You ,[object Object],http://www.simpl try.com

More Related Content

What's hot

DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foobrian_dailey
 
루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날Sukjoon Kim
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentationbrian_dailey
 
Advanced JavaScript build pipelines using Gulp.js
Advanced JavaScript build pipelines using Gulp.jsAdvanced JavaScript build pipelines using Gulp.js
Advanced JavaScript build pipelines using Gulp.jsStefan Baumgartner
 
Lightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClientLightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClientAdam Wiggins
 
Lessons Learnt in 2009
Lessons Learnt in 2009Lessons Learnt in 2009
Lessons Learnt in 2009pratiknaik
 
Plumbin Pipelines - A Gulp.js workshop
Plumbin Pipelines - A Gulp.js workshopPlumbin Pipelines - A Gulp.js workshop
Plumbin Pipelines - A Gulp.js workshopStefan Baumgartner
 
CouchDB: A NoSQL database
CouchDB: A NoSQL databaseCouchDB: A NoSQL database
CouchDB: A NoSQL databaseRubyc Slides
 
Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioRick Copeland
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Bash in theory and in practice - part two
Bash in theory and in practice - part twoBash in theory and in practice - part two
Bash in theory and in practice - part twoValerio Balbi
 
Bash in theory and in practice - part one
Bash in theory and in practice - part oneBash in theory and in practice - part one
Bash in theory and in practice - part oneValerio Balbi
 

What's hot (20)

DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foo
 
Perl dancer
Perl dancerPerl dancer
Perl dancer
 
루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날루비가 얼랭에 빠진 날
루비가 얼랭에 빠진 날
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Node.js
Node.jsNode.js
Node.js
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
node.js - Fast event based web application development
node.js - Fast event based web application developmentnode.js - Fast event based web application development
node.js - Fast event based web application development
 
Advanced JavaScript build pipelines using Gulp.js
Advanced JavaScript build pipelines using Gulp.jsAdvanced JavaScript build pipelines using Gulp.js
Advanced JavaScript build pipelines using Gulp.js
 
Lightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClientLightweight Webservices with Sinatra and RestClient
Lightweight Webservices with Sinatra and RestClient
 
CouchApp - Build scalable web applications and relax
CouchApp - Build scalable web applications and relaxCouchApp - Build scalable web applications and relax
CouchApp - Build scalable web applications and relax
 
Lessons Learnt in 2009
Lessons Learnt in 2009Lessons Learnt in 2009
Lessons Learnt in 2009
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
Plumbin Pipelines - A Gulp.js workshop
Plumbin Pipelines - A Gulp.js workshopPlumbin Pipelines - A Gulp.js workshop
Plumbin Pipelines - A Gulp.js workshop
 
CouchDB: A NoSQL database
CouchDB: A NoSQL databaseCouchDB: A NoSQL database
CouchDB: A NoSQL database
 
Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.io
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Web::Scraper
Web::ScraperWeb::Scraper
Web::Scraper
 
Bash in theory and in practice - part two
Bash in theory and in practice - part twoBash in theory and in practice - part two
Bash in theory and in practice - part two
 
Bash in theory and in practice - part one
Bash in theory and in practice - part oneBash in theory and in practice - part one
Bash in theory and in practice - part one
 

Similar to Rush, a shell that will yield to you

Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amfrailsconf
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by CapistranoTasawr Interactive
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkBen Scofield
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoAlmir Mendes
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Jacopo Romei
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
Writing webapps with Perl Dancer
Writing webapps with Perl DancerWriting webapps with Perl Dancer
Writing webapps with Perl DancerAlexis Sukrieh
 
URL Mapping, with and without mod_rewrite
URL Mapping, with and without mod_rewriteURL Mapping, with and without mod_rewrite
URL Mapping, with and without mod_rewriteRich Bowen
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsAbhay Sapru
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 
Nginx Workshop Aftermath
Nginx Workshop AftermathNginx Workshop Aftermath
Nginx Workshop AftermathDenis Zhdanov
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!cloudbring
 

Similar to Rush, a shell that will yield to you (20)

Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amf
 
Flex With Rubyamf
Flex With RubyamfFlex With Rubyamf
Flex With Rubyamf
 
PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by Capistrano
 
Sinatra
SinatraSinatra
Sinatra
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web Framework
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with Capistrano
 
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
 
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Writing webapps with Perl Dancer
Writing webapps with Perl DancerWriting webapps with Perl Dancer
Writing webapps with Perl Dancer
 
URL Mapping, with and without mod_rewrite
URL Mapping, with and without mod_rewriteURL Mapping, with and without mod_rewrite
URL Mapping, with and without mod_rewrite
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Nginx Workshop Aftermath
Nginx Workshop AftermathNginx Workshop Aftermath
Nginx Workshop Aftermath
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
Capistrano Overview
Capistrano OverviewCapistrano Overview
Capistrano Overview
 
Capistrano2
Capistrano2Capistrano2
Capistrano2
 

Recently uploaded

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 

Recently uploaded (20)

Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 

Rush, a shell that will yield to you

  • 1.
  • 3.
  • 4. Install and Run $ sudo gem install rush $ rush rush> home=> localhost:/Users/schlueter/
  • 5. No Working Directory $ home => localhost:/Users/schlueter $ root=> localhost://// $ rushmate = home[ &quot;mydev/github/rushmate/&quot; ] => localhost:/Users/schlueter/mydev/github/rushmate/
  • 6. But ls Still Works $ home[ &quot;mydev/github/rushmate/&quot; ].ls /Users/schlueter/mydev/github/rushmate/ coverage/ lib/ test/ History.txt MIT-LICENSE Manifest.txt
  • 7. Make a Variable $ rushmate = home[ &quot;mydev/github/rushmate/&quot; ]
  • 9. Rename # assign a file to a variable $ file = rushmate[ 'app/models/rushmate.rb' ] $ file.rename 'russian_mate.rb'
  • 10. Duplicate a File $ file = rushmate[ 'README' ] $ file.duplicate 'README.markdown'
  • 11. Copy Different Directory $ file = rushmate[ 'README' ] $ file.copy_to other_project[ 'README' ]
  • 12. Move $ file = rushmate[ 'README' ] $ file.move_to home[ 'Desktop/' ]
  • 13. Write a File $ file = rushmate[ 'README' ] $ file.write &quot;You Read Me&quot;
  • 14. Read a File $ rushmate[ &quot;README&quot; ].contents You Read Me
  • 16. Basic Globbing $ rushmate[ &quot;**/*.rb&quot; ] .../mydev/github/rushmate/lib/rushmate.rb.../mydev/github/rushmate/lib/rushmate/command.rb.../mydev/github/rushmate/lib/rushmate/exit.rb ... => 9 x Rush :: File
  • 17. Glob into an Editor $ rushmate[ &quot;**/*.rb&quot; ].vi $ rushmate[ &quot;**/*.rb&quot; ].mate
  • 18. Operate on Results $ rails_proj[ '**/*.rhtml' ].each { | f | f.rename f.name.gsub( / rhtml/ , '.html.erb' ) }
  • 19. Results Are an Array $ rushmate[ &quot;**/*.rb&quot; ].reject {| f | f.name.match( /test.rb/ )} Go Nuts! $ rails_project[ &quot;**/*.rhtml&quot; ] + rails_project[ &quot;**/*.html.erb&quot; ]
  • 20. embed http://flickr.com/photos/liamngls/413522957/ Rush :: EmbeddableShell . new .execute_in_shell do #anything in here delegates to rush end
  • 21. Sake Quick Index of RDoc task 'rdoc:local' => 'rush' do shell = Rush :: EmbeddableShell . new shell.execute_in_shell do end end ruby = root[ &quot;/Library/Ruby/Gems/1.8/&quot; ] indexes = ruby[ &quot;doc/*/rdoc/index.html&quot; ] hrefs = indexes.collect { | f | path = f.full_path text = path.match( /doc (.*) rdoc/ )[ 1 ] &quot;<a href= amp;quot; #{path} amp;quot; >#{text}</a>&quot; } home[ &quot;rdoc.html&quot; ].write hrefs.join( &quot;<br />&quot; ) home.bash( &quot;open rdoc.html&quot; )
  • 23.  
  • 25. Search $ work[ &quot;**/*.rb&quot; ].search( / Rushmate / ) .../test/user_input_test.rb => assert_equal(&quot;foo&quot;, Rushmate ::.../lib/rushmate/command.rb => module Rushmate .../lib/rushmate/exit.rb => module Rushmate ...7 matching files with 25 matching lines $ work[ &quot;**/*.rb&quot; ].search( / Rushmate / ).mate
  • 26.
  • 27. Regex is your friend $ project_files.replace_contents! ( /User.authenticate *(.*), *(.*) / , 'User.authenticate( 2, 1)' ) User .authenticate(user, password) User .authenticate(password, user)
  • 28.
  • 29. Real World Rush :: EmbeddableShell . new .execute_in_shell do end ff_processes = processes. filter ( :cmdline => /firefox/ ) if ff = ff_processes.select{| p | p.mem > 400000 }.first ff_cmdline = ff.cmdline ff.kill home.bash ff_cmdline, :background => true end
  • 30. Permissions $ file.access = { :user_can => :read_and_write , :group_and_other_can => :read } $ file.access[ :user_can_read ] => true
  • 31. Use BASH if you must $ rushmate.bash &quot;rm -rf .&quot; # D'oh!
  • 32. Shell Locally Act Globally
  • 33. Remote $ remote = Rush :: Box . new ( 'user@server.com' ) $ remote[ &quot;/u/app/current/REVISION&quot; ].contents => 160
  • 34. Starts a Mongrel on Remote Server Use in production with caution
  • 35. Customize # setup variables to common directories rushmate = home[ &quot;mydev/github/rushmate/&quot; ] # setup variables to common servers qa = Rush :: Box . new ( 'user@qa.local' ) ~/.rush/evn.rb
  • 36. Cheap Backup def cheap_backup (directory) unless directory.dir? puts &quot;cheap backup only works on dirs&quot; return end backup_path = directory.path + &quot;/&quot; + directory.name + &quot;.bak&quot; if self [backup_path].exists? puts &quot;backup already exists&quot; else directory.duplicate(directory.name + &quot;.bak&quot; ) end end
  • 37. Extend # allows you to run # directory.coverage def coverage self .rake( &quot;coverage&quot; ) end ~/.rush/commands.rb
  • 38. Another Command def ruby_files self [ &quot;**/*.rb&quot; ] end $ rushmate.ruby_files .../mydev/github/rushmate/lib/rushmate.rb.../mydev/github/rushmate/lib/rushmate/command.rb.../mydev/github/rushmate/lib/rushmate/exit.rb ... => 9 x Rush::File
  • 39.  
  • 40. TextMate Rushmate :: Command . new { # find ruby files with the current word in textmate found_files = project_directory[ &quot;**/#{current_word.downcase}.rb&quot; ] if found_files.size == 1 found_files.mate else menu_files = found_files.collect { | f | f.full_path.gsub(project_directory.full_path, &quot;&quot; ) } project_directory[user_input.quick_menu_from_array(menu_files)].mate end }
  • 43.