icebreaker 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.rvmrc +1 -5
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/icebreaker.gemspec +2 -2
- data/lib/icebreaker/cli.rb +7 -7
- data/lib/icebreaker/version.rb +1 -1
- data/templates/bootstrap.rb +7 -1
- data/templates/gemfile.rb +13 -13
- data/templates/haml.rb +15 -0
- data/templates/heroku.rb +1 -0
- data/templates/jquery.rb +7 -1
- data/templates/rails_clean.rb +1 -1
- data/templates/test_suite.rb +3 -78
- metadata +10 -24
    
        data/.gitignore
    CHANGED
    
    
    
        data/.rvmrc
    CHANGED
    
    
    
        data/LICENSE
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    
    
        data/icebreaker.gemspec
    CHANGED
    
    | @@ -11,12 +11,12 @@ Gem::Specification.new do |s| | |
| 11 11 | 
             
              s.summary     = "icebreaker-#{s.version}"
         | 
| 12 12 | 
             
              s.description = "Generate a Rails 3 app with the Mongoid ORM (or OM) and RSpec for BDD testing."
         | 
| 13 13 |  | 
| 14 | 
            -
              s.required_rubygems_version = "~> 1. | 
| 14 | 
            +
              s.required_rubygems_version = "~> 1.6.0"
         | 
| 15 15 | 
             
              s.rubyforge_project         = "icebreaker"
         | 
| 16 16 |  | 
| 17 17 | 
             
              s.add_dependency "thor"
         | 
| 18 18 | 
             
              # s.add_dependency "mail" # Hack to get around "mail requires i18n (~> 0.4.1, runtime)" error
         | 
| 19 | 
            -
              s.add_dependency "rails"
         | 
| 19 | 
            +
              s.add_dependency "rails", '3.1.0.beta1'
         | 
| 20 20 | 
             
              s.add_development_dependency "bundler"
         | 
| 21 21 |  | 
| 22 22 | 
             
              s.files        = `git ls-files`.split("\n")
         | 
    
        data/lib/icebreaker/cli.rb
    CHANGED
    
    | @@ -9,22 +9,22 @@ module IceBreaker | |
| 9 9 | 
             
                desc "new [app]", "Create a new Rails 3 application"
         | 
| 10 10 | 
             
                long_desc <<-D
         | 
| 11 11 | 
             
                  IceBreaker will ask you a few questions to determine what features you
         | 
| 12 | 
            -
                  would like to generate. Based on your answers it will setup a new Rails 3 application.
         | 
| 12 | 
            +
                  would like to generate. Based on your answers it will setup a new Rails 3.1 application.
         | 
| 13 13 | 
             
                D
         | 
| 14 14 |  | 
| 15 15 | 
             
                def new(project)
         | 
| 16 16 | 
             
                  # Check for a gemset and warn if none
         | 
| 17 17 | 
             
                  gemset = `rvm gemset name`.chomp
         | 
| 18 | 
            -
                  unless gemset ==  | 
| 19 | 
            -
                    say "It is recommend that you use a separate RVM gemset called ' | 
| 20 | 
            -
                    say "You can create it by running this command: rvm use 1.9.2 | 
| 21 | 
            -
                    if yes?("Would you like to exit now and create a separate RVM gemset for  | 
| 18 | 
            +
                  unless gemset == project
         | 
| 19 | 
            +
                    say "It is recommend that you use a separate RVM gemset called '#{project}' when creating a Rails project with IceBreaker.  This will keep your system gems clean."
         | 
| 20 | 
            +
                    say "You can exit now and create it by running this command: rvm use 1.9.2@#{project} --create"
         | 
| 21 | 
            +
                    if yes?("Would you like to exit now and create a separate RVM gemset for #{project}?")
         | 
| 22 22 | 
             
                      exit 0
         | 
| 23 23 | 
             
                    end
         | 
| 24 24 | 
             
                  end
         | 
| 25 25 |  | 
| 26 | 
            -
                  command = "rails new #{project} --skip-active-record --skip-test-unit -- | 
| 27 | 
            -
                  puts "Creating new Rails 3 project with: #{command}"
         | 
| 26 | 
            +
                  command = "rails new #{project} --skip-active-record --skip-test-unit --template=#{template} "
         | 
| 27 | 
            +
                  puts "Creating new Rails 3.1 project with: #{command}"
         | 
| 28 28 | 
             
                  exec(command)
         | 
| 29 29 | 
             
                end
         | 
| 30 30 |  | 
    
        data/lib/icebreaker/version.rb
    CHANGED
    
    
    
        data/templates/bootstrap.rb
    CHANGED
    
    | @@ -37,6 +37,9 @@ apply File.expand_path("../mongoid.rb", __FILE__) | |
| 37 37 | 
             
            # Apply JQuery
         | 
| 38 38 | 
             
            apply File.expand_path("../jquery.rb", __FILE__)
         | 
| 39 39 |  | 
| 40 | 
            +
            # Convert to HAML
         | 
| 41 | 
            +
            apply File.expand_path("../haml.rb", __FILE__)
         | 
| 42 | 
            +
             | 
| 40 43 | 
             
            # Apply Test Suite 
         | 
| 41 44 | 
             
            apply File.expand_path("../test_suite.rb", __FILE__)
         | 
| 42 45 |  | 
| @@ -49,8 +52,11 @@ apply File.expand_path("../rails_clean.rb", __FILE__) | |
| 49 52 | 
             
            # Apply RVM settings
         | 
| 50 53 | 
             
            apply File.expand_path("../rvm.rb", __FILE__)
         | 
| 51 54 |  | 
| 55 | 
            +
            # Install Heroku gem
         | 
| 56 | 
            +
            apply File.expand_path("../heroku.rb", __FILE__)
         | 
| 57 | 
            +
             | 
| 52 58 | 
             
            git :add => "."
         | 
| 53 | 
            -
            git :commit => "-am 'Initial Commit'"
         | 
| 59 | 
            +
            git :commit => "-am 'Initial Icebreaker Commit'"
         | 
| 54 60 |  | 
| 55 61 | 
             
            say <<-D
         | 
| 56 62 |  | 
    
        data/templates/gemfile.rb
    CHANGED
    
    | @@ -1,24 +1,26 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 1 | 
            +
            append_file "Gemfile" do
         | 
| 2 | 
            +
            <<-RUBY
         | 
| 3 3 |  | 
| 4 | 
            +
            # Project Gems
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            RUBY
         | 
| 7 | 
            +
            end
         | 
| 4 8 | 
             
            # Rails
         | 
| 5 | 
            -
            gem "rails", "3.0.4"
         | 
| 6 9 |  | 
| 7 10 | 
             
            # MongoID
         | 
| 8 | 
            -
            gem "mongoid", " | 
| 9 | 
            -
            gem  | 
| 10 | 
            -
            gem 'bson_ext', '1.2.1'
         | 
| 11 | 
            +
            gem "mongoid", :git => "http://github.com/mongoid/mongoid.git"
         | 
| 12 | 
            +
            gem "bson_ext"
         | 
| 11 13 |  | 
| 12 14 | 
             
            # HTML, CSS and JavaScript
         | 
| 13 | 
            -
            gem "haml | 
| 15 | 
            +
            gem "haml"
         | 
| 14 16 | 
             
            gem "will_paginate", "3.0.pre2"
         | 
| 15 17 |  | 
| 16 | 
            -
            #  | 
| 17 | 
            -
            gem " | 
| 18 | 
            +
            # Crypto
         | 
| 19 | 
            +
            gem "bcrypt-ruby", :require => "bcrypt"
         | 
| 18 20 |  | 
| 19 21 | 
             
            # Development dependencies
         | 
| 20 22 | 
             
            # gem 'html5-boilerplate' # TODO: Get html5-boilerplate working
         | 
| 21 | 
            -
            gem 'rspec-rails', '2. | 
| 23 | 
            +
            gem 'rspec-rails', '2.6.0.rc6', :group => [:development]
         | 
| 22 24 | 
             
            gem 'nifty-generators'
         | 
| 23 25 |  | 
| 24 26 | 
             
            # Development and test support
         | 
| @@ -26,13 +28,11 @@ gem 'factory_girl_rails', :group => [:development, :test] | |
| 26 28 | 
             
            gem 'faker', :group => [:development, :test]
         | 
| 27 29 |  | 
| 28 30 | 
             
            # Test dependencies
         | 
| 29 | 
            -
            gem 'rspec', '2. | 
| 31 | 
            +
            gem 'rspec', '2.6.0.rc6', :group => [:test]
         | 
| 30 32 | 
             
            gem 'webrat', '0.7.1', :group => [:test]
         | 
| 31 33 |  | 
| 32 34 | 
             
            # Utilities
         | 
| 33 35 | 
             
            gem 'awesome_print', :group => [:development]
         | 
| 34 | 
            -
            gem 'heroku', :group => :development
         | 
| 35 | 
            -
             | 
| 36 36 |  | 
| 37 37 | 
             
            # Install bundled gems
         | 
| 38 38 | 
             
            run 'bundle install'
         | 
    
        data/templates/haml.rb
    ADDED
    
    | @@ -0,0 +1,15 @@ | |
| 1 | 
            +
            run 'rm app/views/layouts/application.html.erb'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            create_file 'app/views/layouts/application.html.haml' do
         | 
| 4 | 
            +
            <<-HAML
         | 
| 5 | 
            +
            !!! 5
         | 
| 6 | 
            +
            %html
         | 
| 7 | 
            +
              %head
         | 
| 8 | 
            +
                %title= @title ? "#{app_name} | \#\{\@title\}\" : '#{app_name}'
         | 
| 9 | 
            +
                = stylesheet_link_tag    "application"
         | 
| 10 | 
            +
                = javascript_include_tag "application"
         | 
| 11 | 
            +
                = csrf_meta_tags
         | 
| 12 | 
            +
              %body
         | 
| 13 | 
            +
                = yield
         | 
| 14 | 
            +
            HAML
         | 
| 15 | 
            +
            end
         | 
    
        data/templates/heroku.rb
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            run 'gem install heroku'
         | 
    
        data/templates/jquery.rb
    CHANGED
    
    
    
        data/templates/rails_clean.rb
    CHANGED
    
    
    
        data/templates/test_suite.rb
    CHANGED
    
    | @@ -1,5 +1,8 @@ | |
| 1 1 | 
             
            run 'rails generate rspec:install'
         | 
| 2 2 |  | 
| 3 | 
            +
            # Specify rspec for generators
         | 
| 4 | 
            +
            gsub_file 'config/application.rb', /.*config\.generators\.test_framework = false/, '    # config.generators.test_framework = false'
         | 
| 5 | 
            +
             | 
| 3 6 | 
             
            # MongoID Teardown
         | 
| 4 7 | 
             
            gsub_file 'spec/spec_helper.rb', /config\.fixture_path/, '# config.fixture_path'
         | 
| 5 8 | 
             
            gsub_file 'spec/spec_helper.rb', /config\.use_transactional_fixtures/, '# config.use_transactional_fixtures'
         | 
| @@ -11,81 +14,3 @@ gsub_file 'spec/spec_helper.rb', /end/ do | |
| 11 14 | 
             
            end
         | 
| 12 15 | 
             
            RUBY
         | 
| 13 16 | 
             
            end
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            # cucumber_install = 'rails generate cucumber:install --capybara --rspec'
         | 
| 16 | 
            -
            # cucumber_install = "#{cucumber_install} --skip-database" if ENV['MOLOGUE_MONGOID']
         | 
| 17 | 
            -
            # run cucumber_install
         | 
| 18 | 
            -
            # 
         | 
| 19 | 
            -
            # if ENV['MOLOGUE_MONGOID']
         | 
| 20 | 
            -
            #   append_file 'features/support/env.rb' do
         | 
| 21 | 
            -
            #     <<-RUBY
         | 
| 22 | 
            -
            # 
         | 
| 23 | 
            -
            #     # Clean MongoDB between tests
         | 
| 24 | 
            -
            #     require 'database_cleaner'
         | 
| 25 | 
            -
            #     DatabaseCleaner.strategy = :truncation
         | 
| 26 | 
            -
            #     Before do
         | 
| 27 | 
            -
            #       DatabaseCleaner.clean
         | 
| 28 | 
            -
            #     end
         | 
| 29 | 
            -
            # 
         | 
| 30 | 
            -
            #     RUBY
         | 
| 31 | 
            -
            #   end
         | 
| 32 | 
            -
            # end
         | 
| 33 | 
            -
            # 
         | 
| 34 | 
            -
            # run 'rails generate pickle --email'
         | 
| 35 | 
            -
            # 
         | 
| 36 | 
            -
            # test_framework = "g.test_framework :rspec"
         | 
| 37 | 
            -
            # test_framework = "#{test_framework}, :fixture => false" if ENV['MOLOGUE_MONGOID']
         | 
| 38 | 
            -
            # inject_into_file 'config/application.rb', :after => "# Configure the default encoding used in templates for Ruby 1.9.\n" do
         | 
| 39 | 
            -
            # <<-RUBY
         | 
| 40 | 
            -
            #     config.generators do |g|
         | 
| 41 | 
            -
            #       #{test_framework}
         | 
| 42 | 
            -
            #     end
         | 
| 43 | 
            -
            # RUBY
         | 
| 44 | 
            -
            # end
         | 
| 45 | 
            -
            # 
         | 
| 46 | 
            -
            # inject_into_file 'features/support/env.rb', :after => "ENV[\"RAILS_ENV\"] ||= \"test\"\n" do 
         | 
| 47 | 
            -
            # <<-RUBY
         | 
| 48 | 
            -
            # $VERBOSE = nil
         | 
| 49 | 
            -
            # RUBY
         | 
| 50 | 
            -
            # end
         | 
| 51 | 
            -
            # 
         | 
| 52 | 
            -
            # gsub_file 'features/support/env.rb',/require 'cucumber\/rails\/capybara_javascript_emulation'/,'#require \'cucumber/rails/capybara_javascript_emulation\''
         | 
| 53 | 
            -
            # 
         | 
| 54 | 
            -
            # run 'mkdir spec/factories'
         | 
| 55 | 
            -
            # 
         | 
| 56 | 
            -
            # create_file 'features/step_definitions/web_steps_extended.rb' do
         | 
| 57 | 
            -
            # <<-'FILE'
         | 
| 58 | 
            -
            # When /^I confirm a js popup on the next step$/ do
         | 
| 59 | 
            -
            #   page.evaluate_script("window.alert = function(msg) { return true; }")
         | 
| 60 | 
            -
            #   page.evaluate_script("window.confirm = function(msg) { return true; }")
         | 
| 61 | 
            -
            # end
         | 
| 62 | 
            -
            # 
         | 
| 63 | 
            -
            # When /^I perform the following actions:$/ do |table|
         | 
| 64 | 
            -
            #   table.hashes.each do |row|
         | 
| 65 | 
            -
            #     case row['Action']
         | 
| 66 | 
            -
            #     when 'Fill in'
         | 
| 67 | 
            -
            #       Given "I fill in \"#{row['Field']}\" with \"#{row['Value']}\""
         | 
| 68 | 
            -
            #     when 'Check'
         | 
| 69 | 
            -
            #       if row['Value'] =~ /true/
         | 
| 70 | 
            -
            #         Given "I check \"#{row['Field']}\""
         | 
| 71 | 
            -
            #       else
         | 
| 72 | 
            -
            #         Given "I uncheck \"#{row['Field']}\""
         | 
| 73 | 
            -
            #       end
         | 
| 74 | 
            -
            #     when 'Choose'
         | 
| 75 | 
            -
            #       Given "I choose \"#{row['Field']}\""
         | 
| 76 | 
            -
            #     end
         | 
| 77 | 
            -
            #   end
         | 
| 78 | 
            -
            # end
         | 
| 79 | 
            -
            # FILE
         | 
| 80 | 
            -
            # end
         | 
| 81 | 
            -
            # 
         | 
| 82 | 
            -
            # create_file 'features/step_definitions/factory_steps.rb' do
         | 
| 83 | 
            -
            # <<-'FILE'
         | 
| 84 | 
            -
            # Given /^the following (.+) records?$/ do |factory, table|
         | 
| 85 | 
            -
            #   table.hashes.each do |hash|
         | 
| 86 | 
            -
            #     hash.each{|k,v| hash[k] = nil if v == "nil" } # FIXME: hack to make resend_email_verification.feature work
         | 
| 87 | 
            -
            #     Factory(factory, hash)
         | 
| 88 | 
            -
            #   end
         | 
| 89 | 
            -
            # end
         | 
| 90 | 
            -
            # FILE
         | 
| 91 | 
            -
            # end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,12 +1,8 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: icebreaker
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              prerelease:  | 
| 5 | 
            -
               | 
| 6 | 
            -
              - 0
         | 
| 7 | 
            -
              - 0
         | 
| 8 | 
            -
              - 4
         | 
| 9 | 
            -
              version: 0.0.4
         | 
| 4 | 
            +
              prerelease: 
         | 
| 5 | 
            +
              version: 0.1.0
         | 
| 10 6 | 
             
            platform: ruby
         | 
| 11 7 | 
             
            authors: 
         | 
| 12 8 | 
             
            - Mark Dillon
         | 
| @@ -14,7 +10,7 @@ autorequire: | |
| 14 10 | 
             
            bindir: bin
         | 
| 15 11 | 
             
            cert_chain: []
         | 
| 16 12 |  | 
| 17 | 
            -
            date: 2011- | 
| 13 | 
            +
            date: 2011-05-13 00:00:00 -07:00
         | 
| 18 14 | 
             
            default_executable: 
         | 
| 19 15 | 
             
            dependencies: 
         | 
| 20 16 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -25,8 +21,6 @@ dependencies: | |
| 25 21 | 
             
                requirements: 
         | 
| 26 22 | 
             
                - - ">="
         | 
| 27 23 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 28 | 
            -
                    segments: 
         | 
| 29 | 
            -
                    - 0
         | 
| 30 24 | 
             
                    version: "0"
         | 
| 31 25 | 
             
              type: :runtime
         | 
| 32 26 | 
             
              version_requirements: *id001
         | 
| @@ -36,11 +30,9 @@ dependencies: | |
| 36 30 | 
             
              requirement: &id002 !ruby/object:Gem::Requirement 
         | 
| 37 31 | 
             
                none: false
         | 
| 38 32 | 
             
                requirements: 
         | 
| 39 | 
            -
                - - " | 
| 33 | 
            +
                - - "="
         | 
| 40 34 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 41 | 
            -
                     | 
| 42 | 
            -
                    - 0
         | 
| 43 | 
            -
                    version: "0"
         | 
| 35 | 
            +
                    version: 3.1.0.beta1
         | 
| 44 36 | 
             
              type: :runtime
         | 
| 45 37 | 
             
              version_requirements: *id002
         | 
| 46 38 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -51,8 +43,6 @@ dependencies: | |
| 51 43 | 
             
                requirements: 
         | 
| 52 44 | 
             
                - - ">="
         | 
| 53 45 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 54 | 
            -
                    segments: 
         | 
| 55 | 
            -
                    - 0
         | 
| 56 46 | 
             
                    version: "0"
         | 
| 57 47 | 
             
              type: :development
         | 
| 58 48 | 
             
              version_requirements: *id003
         | 
| @@ -80,6 +70,8 @@ files: | |
| 80 70 | 
             
            - lib/icebreaker/version.rb
         | 
| 81 71 | 
             
            - templates/bootstrap.rb
         | 
| 82 72 | 
             
            - templates/gemfile.rb
         | 
| 73 | 
            +
            - templates/haml.rb
         | 
| 74 | 
            +
            - templates/heroku.rb
         | 
| 83 75 | 
             
            - templates/html5_boilerplate.rb
         | 
| 84 76 | 
             
            - templates/jquery.rb
         | 
| 85 77 | 
             
            - templates/mongoid.rb
         | 
| @@ -101,25 +93,19 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 101 93 | 
             
              requirements: 
         | 
| 102 94 | 
             
              - - ">="
         | 
| 103 95 | 
             
                - !ruby/object:Gem::Version 
         | 
| 104 | 
            -
                  segments: 
         | 
| 105 | 
            -
                  - 0
         | 
| 106 96 | 
             
                  version: "0"
         | 
| 107 97 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 108 98 | 
             
              none: false
         | 
| 109 99 | 
             
              requirements: 
         | 
| 110 100 | 
             
              - - ~>
         | 
| 111 101 | 
             
                - !ruby/object:Gem::Version 
         | 
| 112 | 
            -
                   | 
| 113 | 
            -
                  - 1
         | 
| 114 | 
            -
                  - 3
         | 
| 115 | 
            -
                  - 6
         | 
| 116 | 
            -
                  version: 1.3.6
         | 
| 102 | 
            +
                  version: 1.6.0
         | 
| 117 103 | 
             
            requirements: []
         | 
| 118 104 |  | 
| 119 105 | 
             
            rubyforge_project: icebreaker
         | 
| 120 | 
            -
            rubygems_version: 1. | 
| 106 | 
            +
            rubygems_version: 1.6.2
         | 
| 121 107 | 
             
            signing_key: 
         | 
| 122 108 | 
             
            specification_version: 3
         | 
| 123 | 
            -
            summary: icebreaker-0.0 | 
| 109 | 
            +
            summary: icebreaker-0.1.0
         | 
| 124 110 | 
             
            test_files: []
         | 
| 125 111 |  |