ronin-gen 1.0.0.rc2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 1.0.0 / 2011-02-01
1
+ ### 1.0.0 / 2011-03-25
2
2
 
3
3
  * Upgraded to the GPL-3 license.
4
4
  * Require open_namespace ~> 0.3.
data/gemspec.yml CHANGED
@@ -16,8 +16,8 @@ dependencies:
16
16
  data_paths: ~> 0.2, >= 0.2.1
17
17
  thor: ~> 0.14.3
18
18
  # Ronin dependencies:
19
- ronin-support: ~> 0.1.0.rc2
20
- ronin: ~> 1.0.0.rc2
19
+ ronin-support: ~> 0.1.0
20
+ ronin: ~> 1.0.0
21
21
 
22
22
  development_dependencies:
23
23
  bundler: ~> 1.0.10
data/lib/ronin/gen/gen.rb CHANGED
@@ -21,8 +21,13 @@ require 'ronin/gen/exceptions/unknown_generator'
21
21
  require 'ronin/gen/generators'
22
22
  require 'ronin/installation'
23
23
 
24
+ require 'set'
25
+
24
26
  module Ronin
25
27
  module Gen
28
+ # The loaded generator names
29
+ @generators = SortedSet[]
30
+
26
31
  #
27
32
  # Loads the generator with the given name.
28
33
  #
@@ -48,9 +53,8 @@ module Ronin
48
53
  #
49
54
  def Gen.generator(name)
50
55
  name = name.to_s
51
- path = name.gsub(/[_-]+/,'_').gsub(/:+/,File::SEPARATOR)
52
56
 
53
- unless (generator = Generators.require_const(path))
57
+ unless (generator = Generators.require_const(name))
54
58
  raise(UnknownGenerator,"unknown generator #{name.dump}")
55
59
  end
56
60
 
@@ -66,19 +70,22 @@ module Ronin
66
70
  # @since 0.3.0
67
71
  #
68
72
  def Gen.generators
69
- unless defined?(@@ronin_gen_generators)
73
+ if @generators.empty?
70
74
  directory = File.join('lib',Generators.namespace_root)
71
75
 
72
- @@ronin_gen_generators = {}
76
+ Installation.each_file_in(directory,:rb) do |path|
77
+ # strip the tailing '.rb' file extension
78
+ name = path.chomp('.rb')
73
79
 
74
- Installation.each_file(directory) do |path|
75
- name = path.gsub(/\.rb$/,'').split(File::SEPARATOR).join(':')
80
+ # replace any file separators with a ':', to mimic the
81
+ # naming convention of Rake/Thor.
82
+ name.tr!(File::SEPARATOR,':')
76
83
 
77
- @@ronin_gen_generators[name] = path
84
+ @generators << name
78
85
  end
79
86
  end
80
87
 
81
- return @@ronin_gen_generators
88
+ return @generators
82
89
  end
83
90
  end
84
91
  end
@@ -103,7 +103,7 @@ module Ronin
103
103
  #
104
104
  def self.inherited(super_class)
105
105
  class_name = super_class.name.sub('Ronin::Gen::Generators::','')
106
- gen_name = class_name.split('::').join(':').underscore
106
+ gen_name = Support::Inflector.underscore(class_name.gsub('::',':'))
107
107
 
108
108
  super_class.namespace(gen_name)
109
109
  end
@@ -196,6 +196,15 @@ module Ronin
196
196
  end
197
197
  end
198
198
 
199
+ #
200
+ # Finalizes the generated library.
201
+ #
202
+ def finalize
203
+ unless options[:no_git]
204
+ system('git','commit','-a','-m','Initial commit.')
205
+ end
206
+ end
207
+
199
208
  end
200
209
  end
201
210
  end
@@ -20,6 +20,6 @@
20
20
  module Ronin
21
21
  module Gen
22
22
  # Ronin Gen version
23
- VERSION = '1.0.0.rc2'
23
+ VERSION = '1.0.0'
24
24
  end
25
25
  end
@@ -42,8 +42,8 @@ module Ronin
42
42
  return
43
43
  end
44
44
 
45
- print_title 'Available Generators'
46
- print_array Ronin::Gen.generators.keys.sort
45
+ print_array Ronin::Gen.generators,
46
+ :title => 'Available Generators'
47
47
  end
48
48
 
49
49
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-gen
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 1.0.0.rc2
4
+ prerelease:
5
+ version: 1.0.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Postmodern
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-06 00:00:00 -08:00
13
+ date: 2011-03-25 00:00:00 -04:00
14
14
  default_executable: ronin-gen
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -29,12 +29,12 @@ dependencies:
29
29
  requirement: &id002 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: "0.2"
35
32
  - - ">="
36
33
  - !ruby/object:Gem::Version
37
34
  version: 0.2.1
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: "0.2"
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: *id002
@@ -56,7 +56,7 @@ dependencies:
56
56
  requirements:
57
57
  - - ~>
58
58
  - !ruby/object:Gem::Version
59
- version: 0.1.0.rc2
59
+ version: 0.1.0
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: *id004
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ~>
69
69
  - !ruby/object:Gem::Version
70
- version: 1.0.0.rc2
70
+ version: 1.0.0
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: *id005
@@ -193,12 +193,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  requirements:
194
194
  - git >= 1.6.0.0, for the library generator
195
195
  rubyforge_project: ronin-gen
196
- rubygems_version: 1.5.2
196
+ rubygems_version: 1.6.2
197
197
  signing_key:
198
198
  specification_version: 3
199
199
  summary: A Ruby library for Ronin that provides various generators.
200
200
  test_files:
201
+ - spec/gen/generator_spec.rb
201
202
  - spec/gen/gen_spec.rb
202
203
  - spec/gen/generators/library_spec.rb
203
204
  - spec/gen/generators/repository_spec.rb
204
- - spec/gen/generator_spec.rb