ronin-gen 1.1.0.rc1 → 1.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
data/.yardopts CHANGED
@@ -1 +1,2 @@
1
1
  --markup markdown --title 'Ronin Gen Documentation' --protected
2
+ --plugin yard-parameters
data/ChangeLog.md CHANGED
@@ -4,6 +4,13 @@
4
4
  * Require ronin-support ~> 0.4.
5
5
  * Require ronin ~> 1.4.
6
6
  * Added {Ronin::Gen::SourceCodeGenerator.template}.
7
+ * Added {Ronin::Gen::Generators::Repository#svn}.
8
+ * Added {Ronin::Gen::Generators::Repository#git}.
9
+ * Added {Ronin::Gen::Generators::Repository#hg}.
10
+ * Renamed `Ronin::Gen::SourceCodeGenerator#no_edit` to
11
+ {Ronin::Gen::SourceCodeGenerator#edit}.
12
+ * Renamed `Ronin::Gen::Generators::Library#no_git` to
13
+ {Ronin::Gen::Generators::Library#git}.
7
14
  * Removed thor from the dependencies.
8
15
  * Refactored {Ronin::Gen::Generator} to use
9
16
  [Parameters](http://github.com/postmodern/parameters) and
data/Gemfile CHANGED
@@ -6,6 +6,10 @@ RONIN_URI = 'http://github.com/ronin-ruby'
6
6
 
7
7
  gemspec
8
8
 
9
+ platforms :jruby do
10
+ gem 'jruby-openssl', '~> 0.7.0'
11
+ end
12
+
9
13
  # Ronin dependencies:
10
14
  # gem 'ronin-support', '~> 0.4.0.rc1', :git => "#{RONIN_URI}/ronin-support.git"
11
15
  # gem 'ronin', '~> 1.4.0.rc1', :git => "#{RONIN_URI}/ronin.git"
data/README.md CHANGED
@@ -60,7 +60,7 @@ Generate a skeleton Overlay:
60
60
 
61
61
  ## License
62
62
 
63
- Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
63
+ Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
64
64
 
65
65
  This file is part of Ronin Gen.
66
66
 
@@ -15,5 +15,5 @@ dependencies:
15
15
  <%- end -%>
16
16
 
17
17
  development_dependencies:
18
- bundler: ~> 1.0.10
19
- yard: ~> 0.6.4
18
+ bundler: ~> 1.0
19
+ yard: ~> 0.7
@@ -14,5 +14,5 @@ authors:
14
14
  - <%= name %>
15
15
  <%- end -%>
16
16
 
17
- description:
17
+ description: |
18
18
  <%= @description %>
data/gemspec.yml CHANGED
@@ -16,9 +16,10 @@ dependencies:
16
16
  data_paths: ~> 0.3
17
17
  parameters: ~> 0.4
18
18
  # Ronin dependencies:
19
- ronin-support: ~> 0.4.0.rc1
20
- ronin: ~> 1.4.0.rc1
19
+ ronin-support: ~> 0.4.0.rc2
20
+ ronin: ~> 1.4.0.rc2
21
21
 
22
22
  development_dependencies:
23
- bundler: ~> 1.0.10
23
+ bundler: ~> 1.0
24
24
  yard: ~> 0.7.0
25
+ yard-parameters: ~> 0.1.0
data/lib/ronin/gen.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
data/lib/ronin/gen/gen.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -63,7 +63,8 @@ module Ronin
63
63
  parameter :generators, :type => Array[String],
64
64
  :default => []
65
65
 
66
- parameter :no_git, :type => true
66
+ parameter :git, :type => true,
67
+ :default => true
67
68
 
68
69
  #
69
70
  # Sets up the library generator.
@@ -90,9 +91,7 @@ module Ronin
90
91
  # Generates top-level files.
91
92
  #
92
93
  def generate
93
- unless no_git?
94
- run "git init"
95
- end
94
+ run 'git', 'init' if git?
96
95
 
97
96
  template 'Gemfile.erb', 'Gemfile'
98
97
  cp 'Rakefile'
@@ -100,10 +99,7 @@ module Ronin
100
99
  template 'name.gemspec.erb', "#{@name}.gemspec"
101
100
  template 'gemspec.yml.erb', 'gemspec.yml'
102
101
 
103
- unless no_git?
104
- cp '.gitignore'
105
- end
106
-
102
+ cp '.gitignore' if git?
107
103
  cp '.rspec'
108
104
  cp '.document'
109
105
  template '.yardopts.erb', '.yardopts'
@@ -139,9 +135,9 @@ module Ronin
139
135
  generate_commands unless @commands.empty?
140
136
  generate_generators unless @generators.empty?
141
137
 
142
- unless no_git?
143
- run 'git add .'
144
- run 'git commit -m "Initial commit."'
138
+ if git?
139
+ run 'git', 'add', '.'
140
+ run 'git', 'commit', '-m', 'Initial commit.'
145
141
  end
146
142
  end
147
143
 
@@ -156,7 +152,7 @@ module Ronin
156
152
  @command_class = @command_file.to_const_string
157
153
 
158
154
  template File.join('bin','ronin-command.erb'),
159
- File.join('bin','ronin-' + @command_file.gsub('_','-'))
155
+ File.join('bin','ronin-' + @command_file.gsub('_','-'))
160
156
 
161
157
  template File.join(COMMANDS_DIR,'command.rb.erb'),
162
158
  File.join(COMMANDS_DIR,"#{@command_file}.rb")
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -61,6 +61,15 @@ module Ronin
61
61
  parameter :tests, :type => true
62
62
  parameter :docs, :type => true
63
63
 
64
+ parameter :svn, :type => true,
65
+ :description => 'Create a SVN repository'
66
+
67
+ parameter :git, :type => true,
68
+ :description => 'Create a Git repository'
69
+
70
+ parameter :hg, :type => true,
71
+ :description => 'Create a Hg repository'
72
+
64
73
  #
65
74
  # Sets up the repository generator.
66
75
  #
@@ -97,6 +106,14 @@ module Ronin
97
106
  mkdir 'spec'
98
107
  cp File.join('spec','spec_helper.rb')
99
108
  end
109
+
110
+ if svn?
111
+ run 'svnadmin', 'create', @path
112
+ elsif git?
113
+ run 'git', 'init'
114
+ elsif hg?
115
+ run 'hg', 'init'
116
+ end
100
117
  end
101
118
 
102
119
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -26,11 +26,11 @@ module Ronin
26
26
  #
27
27
  class SourceCodeGenerator < FileGenerator
28
28
 
29
- parameter :editor, :type => String,
29
+ parameter :editor, :type => String,
30
30
  :default => ENV['EDITOR']
31
31
 
32
- parameter :no_edit, :type => true,
33
- :default => false
32
+ parameter :edit, :type => true,
33
+ :default => true
34
34
 
35
35
  #
36
36
  # Generates the source code file and spawns a text-editor.
@@ -42,7 +42,7 @@ module Ronin
42
42
  def generate
43
43
  template self.class.template, @path
44
44
 
45
- if (no_edit? && editor?)
45
+ if (edit? && editor?)
46
46
  # spawn the text editor for the newly generated file
47
47
  system(editor,@path)
48
48
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -20,6 +20,6 @@
20
20
  module Ronin
21
21
  module Gen
22
22
  # Ronin Gen version
23
- VERSION = '1.1.0.rc1'
23
+ VERSION = '1.1.0.rc2'
24
24
  end
25
25
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2009-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2009-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Gen.
5
5
  #
@@ -34,7 +34,7 @@ module Ronin
34
34
 
35
35
  summary "Prints the list of available generators"
36
36
 
37
- usage '[options] | GENERATOR [options]'
37
+ usage '[options] | GENERATOR [generator-options]'
38
38
 
39
39
  option :version, :type => true,
40
40
  :flag => '-V',
@@ -48,20 +48,20 @@ module Ronin
48
48
  #
49
49
  def start(argv=ARGV)
50
50
  if (argv.empty? || argv.first.start_with?('-'))
51
- super(argv)
52
- else
53
- generator_name = argv.shift
54
- generator = Ronin::Gen.generator(generator_name).new
55
-
56
- opts = Parameters::Options.parser(generator) do |opts|
57
- opts.banner = "ronin-gen #{generator_name} PATH [options]"
58
- end
51
+ return super(argv)
52
+ end
59
53
 
60
- args = opts.parse(argv)
54
+ generator_name = argv.shift
55
+ generator = Ronin::Gen.generator(generator_name).new
61
56
 
62
- generator.path = args.first
63
- generator.generate!
57
+ opts = Parameters::Options.parser(generator) do |opts|
58
+ opts.banner = "ronin-gen #{generator_name} PATH [options]"
64
59
  end
60
+
61
+ args = opts.parse(argv)
62
+
63
+ generator.path = args.first
64
+ generator.generate!
65
65
  end
66
66
 
67
67
  #
@@ -73,8 +73,7 @@ module Ronin
73
73
  return
74
74
  end
75
75
 
76
- print_array Ronin::Gen.generators,
77
- :title => 'Available Generators'
76
+ print_array Ronin::Gen.generators, :title => 'Available Generators'
78
77
  end
79
78
 
80
79
  end
@@ -16,11 +16,12 @@ describe Gen::Generators::Repository do
16
16
 
17
17
  before(:all) do
18
18
  Gen::Generators::Repository.generate(path,
19
- :title => title,
20
- :uri => uri,
21
- :source => source,
22
- :website => website,
23
- :license => license,
19
+ :git => true,
20
+ :title => title,
21
+ :uri => uri,
22
+ :source => source,
23
+ :website => website,
24
+ :license => license,
24
25
  :description => description
25
26
  )
26
27
  end
@@ -53,6 +54,12 @@ describe Gen::Generators::Repository do
53
54
  path.join('ronin.yml').should be_file
54
55
  end
55
56
 
57
+ context "when @git == true" do
58
+ it "should initialize a Git repository" do
59
+ path.join('.git').should be_directory
60
+ end
61
+ end
62
+
56
63
  describe "ronin.yml" do
57
64
  subject { YAML.load_file(path.join('ronin.yml')) }
58
65
 
@@ -81,7 +88,7 @@ describe Gen::Generators::Repository do
81
88
  end
82
89
 
83
90
  it "should have the description" do
84
- subject['description'].should == description
91
+ subject['description'].chomp.should == description
85
92
  end
86
93
  end
87
94
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.rc1
4
+ version: 1.1.0.rc2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-31 00:00:00.000000000 Z
12
+ date: 2012-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: open_namespace
16
- requirement: &18377340 !ruby/object:Gem::Requirement
16
+ requirement: &11422740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *18377340
24
+ version_requirements: *11422740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: data_paths
27
- requirement: &18376620 !ruby/object:Gem::Requirement
27
+ requirement: &11421940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *18376620
35
+ version_requirements: *11421940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: parameters
38
- requirement: &18376060 !ruby/object:Gem::Requirement
38
+ requirement: &11420820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,43 +43,43 @@ dependencies:
43
43
  version: '0.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *18376060
46
+ version_requirements: *11420820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: ronin-support
49
- requirement: &18375580 !ruby/object:Gem::Requirement
49
+ requirement: &11420000 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 0.4.0.rc1
54
+ version: 0.4.0.rc2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *18375580
57
+ version_requirements: *11420000
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: ronin
60
- requirement: &18375080 !ruby/object:Gem::Requirement
60
+ requirement: &11419340 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
64
64
  - !ruby/object:Gem::Version
65
- version: 1.4.0.rc1
65
+ version: 1.4.0.rc2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *18375080
68
+ version_requirements: *11419340
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
- requirement: &18374540 !ruby/object:Gem::Requirement
71
+ requirement: &11418360 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
75
75
  - !ruby/object:Gem::Version
76
- version: 1.0.10
76
+ version: '1.0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *18374540
79
+ version_requirements: *11418360
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &18374040 !ruby/object:Gem::Requirement
82
+ requirement: &11417300 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,7 +87,18 @@ dependencies:
87
87
  version: 0.7.0
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *18374040
90
+ version_requirements: *11417300
91
+ - !ruby/object:Gem::Dependency
92
+ name: yard-parameters
93
+ requirement: &11416340 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ~>
97
+ - !ruby/object:Gem::Version
98
+ version: 0.1.0
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *11416340
91
102
  description: Ronin Gen is a Ruby library for Ronin that provides various generators.
92
103
  email: postmodern.mod3@gmail.com
93
104
  executables: