sprout 1.0.15.pre → 1.0.16.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sprout might be problematic. Click here for more details.

data/bin/sprout-class ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ Bundler.require
6
+
7
+ generator = Sprout::Generator.create_instance :class
8
+ generator.parse! ARGV
9
+ generator.execute
10
+
@@ -10,13 +10,14 @@ module Sprout
10
10
  super(generator_class)
11
11
  end
12
12
 
13
- def create_instance class_base_name, options=nil
13
+ def create_instance type, options=nil
14
+ class_name = "#{type.to_s.camel_case}Generator"
14
15
  registered_entities.each do |entity|
15
- if(entity.to_s.match /#{class_base_name}$/)
16
+ if(entity.to_s.match(/::#{class_name}$/) || entity.to_s.match(/^#{class_name}$/))
16
17
  return entity.new
17
18
  end
18
19
  end
19
- raise Sprout::Errors::MissingGeneratorError.new "Could not find any generator named: (#{class_base_name}). Perhaps you need to add a RubyGem to your Gemfile?"
20
+ raise Sprout::Errors::MissingGeneratorError.new "Could not find any generator named: (#{class_name}). Perhaps you need to add a RubyGem to your Gemfile?"
20
21
  end
21
22
 
22
23
  def template_folder_for clazz
@@ -230,8 +231,7 @@ module Sprout
230
231
  end
231
232
 
232
233
  def generator name, options={}
233
- class_name = "#{name.to_s.camel_case}Generator"
234
- instance = Sprout::Generator.create_instance class_name, options
234
+ instance = Sprout::Generator.create_instance name, options
235
235
  instance.from_hash to_hash.merge(options)
236
236
  instance.logger = logger
237
237
  instance.execute
@@ -6,7 +6,7 @@ module Sprout
6
6
  module VERSION #:nodoc:
7
7
  MAJOR = 1
8
8
  MINOR = 0
9
- TINY = 15
9
+ TINY = 16
10
10
  RELEASE = 'pre'
11
11
 
12
12
  STRING = [MAJOR, MINOR, TINY, RELEASE].join('.')
data/sprout.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.rubyforge_project = "sprout"
21
21
  s.require_path = ['lib']
22
22
  s.files = FileList['**/**/*'].exclude /.git|.svn|.DS_Store/
23
- s.executables = ['sprout', 'sprout-library', 'sprout-tool', 'sprout-generator']
23
+ s.executables = ['sprout', 'sprout-library', 'sprout-tool', 'sprout-generator', 'sprout-class']
24
24
  s.add_bundler_dependencies
25
25
  end
26
26
 
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 15
8
+ - 16
9
9
  - pre
10
- version: 1.0.15.pre
10
+ version: 1.0.16.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Bayes
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-01 00:00:00 -07:00
18
+ date: 2010-07-03 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -181,12 +181,14 @@ executables:
181
181
  - sprout-library
182
182
  - sprout-tool
183
183
  - sprout-generator
184
+ - sprout-class
184
185
  extensions: []
185
186
 
186
187
  extra_rdoc_files: []
187
188
 
188
189
  files:
189
190
  - bin/sprout
191
+ - bin/sprout-class
190
192
  - bin/sprout-generator
191
193
  - bin/sprout-library
192
194
  - bin/sprout-tool