Skip to content
View deploy.rb
require 'bundler/capistrano'
require 'alchemy/capistrano'
require 'capistrano/ext/multistage'
set :bundle_without, %w(development test)
set :bundle_flags, "--deployment --binstubs"
set :use_sudo, false
set :scm, :git
View get_elements_from_other_site.rb
Alchemy::Element.joins(:page => :language).where(alchemy_languages: {language_code: @language.language_code, site_id: Alchemy::Site.default}, name: 'superhero').available
View alchemy_environment_syncing.rb
# Example usage:
# cap staging sync_with:production
# File: config/deploy/staging.rb
namespace :sync_with do
desc "Sync with production system."
task :production do
run "cd #{current_path} && RAILS_ENV=#{rails_env} #{rake} sync_with:production"
end
end
View capistrano_deploy_from_tag.rb
def ask_for_tag
default_tag = `git tag`.split("\n").last
if default_tag == nil
puts "Please make sure you have pushed at least one tag. (git push origin --tags)"
exit!
else
tag = Capistrano::CLI.ui.ask "Tag to deploy (make sure to push the tag first): [#{default_tag}] "
tag = default_tag if tag.empty?
tag
end
View capistrano_logfile_watching.rb
namespace :logs do
desc "show last 100 lines of your remote logfile."
task :tail do
run "tail -n100 #{shared_path}/log/#{rails_env}.log"
end
desc "watch your logfile and see additional data being appended."
task :watch do
stream("tail -f #{shared_path}/log/#{rails_env}.log")
end
View capistrano_delete_remote_cache_task.rb
namespace :deploy do
desc "Removes the remote cache in order to deploy from a new remote repository"
task :delete_remote_cache, :except => { :no_release => true } do
run "cd #{shared_path}; rm -Rf cached-copy"
end
end
View player.rb
class Player
FULL_HEALTH = 20
def play_turn(warrior)
@warrior = warrior
if need_to_rest?
if able_to_rest?
warrior.rest!
View ruby_confs_2013.md

LoneStar RubyConf 2013

18.07.2013 - 20.07.2013

USA, Austin

RailsCamp Germany 2013

26.07.2013 - 28.07.2013

Something went wrong with that request. Please try again.