padrino-gen 0.2.6 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/padrino-gen/generators/components/actions.rb +4 -4
- data/lib/padrino-gen/generators/components/mocks/mocha_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/mocks/rr_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/bacon_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/riot_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/rspec_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/shoulda_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/testspec_test_gen.rb +1 -1
- data/padrino-gen.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.9
|
@@ -10,7 +10,7 @@ module Padrino
|
|
10
10
|
|
11
11
|
# Adds all the specified gems into the Gemfile for bundler
|
12
12
|
# require_dependencies 'activerecord'
|
13
|
-
# require_dependencies 'mocha', 'bacon', :
|
13
|
+
# require_dependencies 'mocha', 'bacon', :only => :testing
|
14
14
|
def require_dependencies(*gem_names)
|
15
15
|
options = gem_names.extract_options!
|
16
16
|
gem_names.reverse.each { |lib| insert_into_gemfile(lib, options) }
|
@@ -18,10 +18,10 @@ module Padrino
|
|
18
18
|
|
19
19
|
# Inserts a required gem into the Gemfile to add the bundler dependency
|
20
20
|
# insert_into_gemfile(name)
|
21
|
-
# insert_into_gemfile(name, :
|
21
|
+
# insert_into_gemfile(name, :only => :testing, :require_as => 'foo')
|
22
22
|
def insert_into_gemfile(name, options={})
|
23
|
-
after_pattern = options[:
|
24
|
-
gem_options = options.slice(:
|
23
|
+
after_pattern = options[:only] ? "#{options[:only].to_s.capitalize} requirements\n" : "Component requirements\n"
|
24
|
+
gem_options = options.slice(:only, :require_as).collect { |k, v| "#{k.inspect} => #{v.inspect}" }.join(", ")
|
25
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])
|
@@ -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 'rspec', :
|
19
|
+
require_dependencies 'rspec', :only => :testing, :require_as => 'spec'
|
20
20
|
insert_test_suite_setup RSPEC_SETUP
|
21
21
|
end
|
22
22
|
|
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.2.
|
8
|
+
s.version = "0.2.9"
|
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"]
|