padrino-gen 0.1.5 → 0.2.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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.2.0
@@ -17,12 +17,12 @@ module Padrino
17
17
  end
18
18
 
19
19
  # Inserts a required gem into the Gemfile to add the bundler dependency
20
- # insert_dependency_to_gemfile(name)
21
- # insert_dependency_to_gemfile(name, :env => :testing)
20
+ # insert_into_gemfile(name)
21
+ # insert_into_gemfile(name, :env => :testing, :require_as => 'foo')
22
22
  def insert_into_gemfile(name, options={})
23
- after_pattern = "# Component requirements\n"
24
- after_pattern = "# #{options[:env].to_s.capitalize} requirements\n" if environment = options[:env]
25
- include_text = "gem '#{name}'" << (environment ? ", :only => #{environment.inspect}" : "") << "\n"
23
+ after_pattern = options[:env] ? "#{options[:env].to_s.capitalize} requirements\n" : "Component requirements\n"
24
+ gem_options = options.slice(:env, :require_as).collect { |k, v| "#{k.inspect} => #{v.inspect}" }.join(", ")
25
+ include_text = "gem '#{name}'" << (gem_options.present? ? ", #{gem_options}" : "") << "\n"
26
26
  options.merge!(:content => include_text, :after => after_pattern)
27
27
  inject_into_file('Gemfile', options[:content], :after => options[:after])
28
28
  end
@@ -16,7 +16,7 @@ module Padrino
16
16
 
17
17
  # TODO move to spec directory to follow convention
18
18
  def setup_test
19
- require_dependencies 'spec', :env => :testing
19
+ require_dependencies 'rspec', :env => :testing, :require_as => 'spec'
20
20
  insert_test_suite_setup RSPEC_SETUP
21
21
  end
22
22
 
@@ -3,4 +3,5 @@ log/**/*
3
3
  tmp/**/*
4
4
  bin/*
5
5
  vendor/gems/*
6
- !vendor/gems/cache/
6
+ !vendor/gems/cache/
7
+ .sass-cache/*
data/padrino-gen.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{padrino-gen}
8
- s.version = "0.1.5"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
@@ -187,7 +187,7 @@ class TestSkeletonGenerator < Test::Unit::TestCase
187
187
  should "properly generate for rspec" do
188
188
  buffer = silence_logger { @skeleton.start(['sample_app', '/tmp', '--test=rspec', '--script=none']) }
189
189
  assert_match /Applying.*?rspec.*?test/, buffer
190
- assert_match_in_file(/gem 'spec'/, '/tmp/sample_app/Gemfile')
190
+ assert_match_in_file(/gem 'rspec'.*?:require_as => "spec"/, '/tmp/sample_app/Gemfile')
191
191
  assert_match_in_file(/Bundler.require_env\(:testing\)/, '/tmp/sample_app/test/test_config.rb')
192
192
  assert_match_in_file(/Spec::Runner/, '/tmp/sample_app/test/test_config.rb')
193
193
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team