Sha256: cecbdd82cc515adeca74fb38fb586a473b4e996a362e13218649f1d13fcd04cd

Contents?: true

Size: 1.57 KB

Versions: 13

Compression:

Stored size: 1.57 KB

Contents

#!/usr/bin/env ruby

RAILS_VERSION = '3.2.18'

GEMFILE = <<-EOF
source 'https://rubygems.org'

gem 'rails', '#{RAILS_VERSION}'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'daddy'
gem 'mysql2'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

group :development, :test do
  gem 'thin'
end

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
EOF

action = ARGV[0]

if action == 'new'
  app_name = ARGV[1]
  
  [
    "rails _#{RAILS_VERSION}_ new #{app_name} -d mysql --skip-bundle",
    "echo \"#{GEMFILE}\" > #{app_name}/Gemfile",
    "cd #{app_name} && sudo bundle install",
    "cd #{app_name} && bundle exec rake dad:install",
    "cd #{app_name} && bundle exec rake dad:generate:routes #{app_name}",
    "cd #{app_name} && bundle exec rake dad:db:config",
    "cd #{app_name} && bundle exec rake dad:db:create",
    "cd #{app_name} && bundle exec rake db:migrate",
    "cd #{app_name} && echo '<h1>Welcome to #{app_name}</h1>' > #{File.join('public', 'index.html')}",
  ].each do |command|
    puts command
    exit 1 unless system(command)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
daddy-0.2.19 bin/dad
daddy-0.2.18 bin/dad
daddy-0.2.17 bin/dad
daddy-0.2.16 bin/dad
daddy-0.2.15 bin/dad
daddy-0.2.14 bin/dad
daddy-0.2.13 bin/dad
daddy-0.2.12 bin/dad
daddy-0.2.11 bin/dad
daddy-0.2.10 bin/dad
daddy-0.2.9 bin/dad
daddy-0.2.8 bin/dad
daddy-0.2.7 bin/dad