Sha256: 655eaea084bfa727049627b9a13dbff125b822117d8d1500494a4cc6293cbbb2

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

require 'thor/group'

module Baldwin
  class Installer < Thor::Group
    include Thor::Actions

    def ignore_dummy_rails_apps
      append_file '.gitignore', <<-EOS
#{byline}
spec/support/rails-*
EOS
    end

    def create_appraisals_file
      create_file 'Appraisals', <<-EOS
#{byline}
# add your rails configurations to test against here, like:
#
#   appraise 'rails-3.1.0' do
#     gem 'rails', '3.1.0'
#   end
#   appraise 'rails-3.2.0' do
#     gem 'rails', '3.2.0'
#   end
#
# see https://github.com/thoughtbot/appraisal for more info
EOS
    end

    def add_appraisal_rake_task
      comment_lines 'Rakefile', /RSpec::Core::RakeTask/

      append_file 'Rakefile', <<-EOS
#{byline}
RSpec::Core::RakeTask.new :spec => [ :'baldwin:env', :'baldwin:rails' ]

desc "Run specs for all supported rails versions"
task :all do
  exec 'rake appraisal spec'
end

desc "Default: Clean, install dependencies, and run specs"
task :default => [ :'baldwin:clean', :'appraisal:install', :all ]
EOS
    end

    def baz
      say "Did baz", :blue
    end

    protected

    def byline
      "# added by baldwin #{Baldwin::VERSION}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
baldwin-0.0.2 lib/baldwin/installer.rb