Sha256: 452916a1e1bf5f421e38dbc8f4627055f538825b104273ab6e2d1da1bacd8dcf

Contents?: true

Size: 1.98 KB

Versions: 26

Compression:

Stored size: 1.98 KB

Contents

# rm -rf rubbertest; rails new rubbertest -d postgresql -m rubber/test/test-rails-template.rb
# RUBBER_ENV=production bundle exec cap rubber:create_staging

run "mkdir -p vendor/gems"
run "ln -sf `pwd`/../rubber vendor/gems/rubber"

default_template = "complete_passenger_postgresql"
templates = ask("Which rubber templates [#{default_template}] ?")
templates = default_template if templates.blank?

run "ruby -I vendor/gems/rubber/lib vendor/gems/rubber/bin/rubber vulcanize #{templates}"

gsub_file 'Gemfile', /gem ["']rubber["'].*/, "gem 'rubber', :path => 'vendor/gems/rubber'"
gem 'therubyracer', :group => :assets

run "bundle install"
generate(:scaffold, "post", "title:string", "body:text")

gsub_file 'config/environment.rb', /^RAILS_GEM_VERSION/, '# RAILS_GEM_VERSION'

copy_with_symlink = <<-EOS
require 'capistrano/recipes/deploy/strategy/copy'
set :deploy_via, :copy
set :copy_compression, :zip
# monkey patch so that zip includes symlinked contents for vendored rubber for testing
module ::Capistrano
  module Deploy
    module Strategy
      class Copy < Base
          # The compression method to use, defaults to :gzip.
          def compression
            Compression.new("zip",     %w(zip -qr), %w(unzip -q))
          end
      end
    end
  end
end
EOS

gsub_file 'config/deploy.rb', /set :deploy_via, :copy/, copy_with_symlink
gsub_file 'config/rubber/rubber.yml', /packages: \[/, "packages: [zip, "

# gsub_file 'config/rubber/rubber.yml', /rubber, /, ''
gsub_file 'config/rubber/rubber.yml', /, \[rubber, [^\]]*\]/, ''
gsub_file 'config/rubber/rubber.yml', /,db:primary=true/, ',db:primary=true,web_tools'
gsub_file 'config/rubber/rubber.yml', /image_type: m1.small/, 'image_type: c1.medium'

default_secret = "~/rubber-secret.yml"
secret = ask("Which rubber secret file [#{default_secret}] ?")
secret = default_secret if secret.blank?
run "cp -f #{secret} config/rubber/rubber-secret.yml"
chmod 'config/rubber/rubber-secret.yml', 0644
gsub_file 'config/rubber/rubber-secret.yml', /dns_provider: .*/, ''

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rubber-2.5.4 test/test-rails-template.rb
rubber-2.5.3 test/test-rails-template.rb
rubber-2.5.2 test/test-rails-template.rb
rubber-2.5.1 test/test-rails-template.rb
rubber-2.5.0 test/test-rails-template.rb
rubber-2.4.2 test/test-rails-template.rb
rubber-2.4.1 test/test-rails-template.rb
rubber-2.4.0 test/test-rails-template.rb
rubber-2.3.1 test/test-rails-template.rb
rubber-2.3.0 test/test-rails-template.rb
rubber-2.2.4 test/test-rails-template.rb
rubber-2.2.3 test/test-rails-template.rb
rubber-2.2.2 test/test-rails-template.rb
rubber-2.2.1 test/test-rails-template.rb
rubber-2.2.0 test/test-rails-template.rb
rubber-2.1.2 test/test-rails-template.rb
rubber-2.1.1 test/test-rails-template.rb
rubber-2.1.0 test/test-rails-template.rb
rubber-2.0.8 test/test-rails-template.rb
rubber-2.0.7 test/test-rails-template.rb