Ruby, Rails, and the Agile Ecosystem
- Presented by:
- Steven Haddox
- Company:
- Black Oak Technologies, Inc.
- Blog:
- http://blog.stevenhaddox.com
- Twitter:
- http://twitter.com/stevenhaddox
| space, → | next slide |
| ← | previous slide |
| d | debug mode |
| ## <ret> | go to slide # |
| c | table of contents (vi) |
| f | toggle footer |
| r | reload slides |
| z | toggle help (this) |
presentations = YAML::load_file('config/presentations.yml')
presentations.each do |presentation|
system("git clone #{presentation[:url]} presentations/#{presentation[:folder]}")
end
for i in 1..8 do
puts i
end
5.times { puts "Ruby reads like English!" }
1.upto(5) { |i| puts i }
15.downto(10) {|i| puts i }
i = 0
while i < 5 do
puts i
i += 1
end
i = 0
until i == 5
puts i
i += 1
end
unless i >= 10
puts "Student failed"
else
puts "Student passed"
end
presentations = {"agile" => 4, "ruby" => 1, "rails" => 2, "jruby" => 3}
sorted_presentations = presentations.keys.sort
presentations.sort do |a, b|
a.counts <=> b.counts
end
class String
def is_int?
self =~ /^[-+]?[0-9]*$/
end
end
We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:
That is, while there is value in the items on
the right, we value the items on the left more.
Given I fill in "Email" with "rubyist@email.com"
And I fill in "Password" with "ruby4thew!n"
When I press "Sign In"
Then I should see "Welcome, Rubyist"
$ gem install rvm
$ rvm-install # installs RVM command
$ rvm install 1.8.7
$ rvm install 1.9.2
$ rvm install ree
$ rvm install jruby
$ rvm install macruby
$ rvm use 1.9.2
$ rvm gemset create bah
$ rvm gemset use bah
$ gem install 'bundler'
$ bundle package$ gem install bundler
$ touch Gemfile
# Create your Gemfile
$ bundle install
$ bundle exec (rails|cap|showoff|etc)
#bundler and multi-stage recipe hooks
#require 'bundler/capistrano' # still broken in 1.0.7?
set :stages, %w(dev staging prod)
require 'capistrano/ext/multistage'
set :default_stage, "dev"
# global defaults
set :application, "domain.com"
# Git config
set :scm, :git
set :repository, "git@github.com:stevenhaddox/domain.com.git"
set :branch, "master"
# SSH config
ssh_options[:forward_agent] = true
set :use_sudo, false
set :user, "steven"
# test task
task :uname do
run "uname -a"
end
namespace :symlinks do
desc "Create shared symlinks"
task :db, :roles => :app do
run "ln -nfs #{shared_path}/system/database.yml #{release_path}/config/database.yml"
end
task :log, :roles => :app do
run "ln -nfs #{shared_path}/log #{release_path}/log"
end
end
desc "Install bundled gems into shared/bundle"
task :bundle do
run "ln -nfs #{shared_path}/bundle #{release_path}/vendor/bundle"
run "cd #{release_path}; bundle install --deployment"
end
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
# callbacks
after 'deploy:update_code', 'symlinks:db' # update db symlink
after 'deploy:update_code', 'symlinks:log' # update log symlink
after 'deploy:update_code', 'bundle' # install bundler gems for Passenger
after 'deploy', 'deploy:cleanup' # keep only last 5 deployed versions
after 'deploy:migrations', 'deploy:cleanup' # keep only last 5 deployed versions
* Denotes a technical presentation from 2006, take with a grain of salt for all comparisons