ronin-gen 0.2.0 → 1.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +4 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +41 -0
- data/Gemfile +27 -0
- data/{README.txt → README.md} +30 -21
- data/Rakefile +24 -20
- data/bin/ronin-gen +27 -8
- data/data/ronin/gen/library/.document +5 -0
- data/data/ronin/gen/library/.gitignore +10 -0
- data/data/ronin/gen/library/.rspec +1 -0
- data/data/ronin/gen/library/.yardopts.erb +1 -0
- data/data/ronin/gen/library/COPYING.txt +339 -0
- data/data/ronin/gen/library/ChangeLog.md.erb +4 -0
- data/data/ronin/gen/library/Gemfile.erb +23 -0
- data/data/ronin/gen/library/README.md.erb +46 -0
- data/data/ronin/gen/library/Rakefile +30 -0
- data/data/ronin/gen/library/bin/ronin-command.erb +25 -0
- data/data/ronin/gen/library/bin/ronin-name.erb +27 -0
- data/data/ronin/gen/library/gemspec.yml.erb +20 -0
- data/data/ronin/gen/library/lib/ronin/_license.erb +19 -0
- data/data/ronin/gen/library/lib/ronin/gen/generators/generator.rb.erb +22 -0
- data/data/ronin/gen/library/lib/ronin/name.rb.erb +3 -0
- data/data/ronin/gen/library/lib/ronin/name/version.rb.erb +8 -0
- data/data/ronin/gen/library/lib/ronin/ui/command_line/commands/command.rb.erb +22 -0
- data/data/ronin/gen/library/library.gemspec.erb +10 -0
- data/data/ronin/gen/library/spec/name/name_spec.rb.erb +8 -0
- data/data/ronin/gen/library/spec/spec_helper.rb.erb +4 -0
- data/data/ronin/gen/repository/.rspec +1 -0
- data/data/ronin/gen/repository/Rakefile.erb +32 -0
- data/data/ronin/gen/repository/ronin.yml.erb +18 -0
- data/{static/ronin/generators/platform → data/ronin/gen/repository}/spec/spec_helper.rb +0 -0
- data/gemspec.yml +24 -0
- data/lib/ronin/gen.rb +26 -0
- data/lib/ronin/{ui/command_line/commands/gen_overlay.rb → gen/config.rb} +6 -8
- data/lib/ronin/{generators → gen}/dir_generator.rb +25 -21
- data/lib/ronin/{generators.rb → gen/exceptions.rb} +2 -5
- data/lib/ronin/{generators/platform/static.rb → gen/exceptions/unknown_generator.rb} +3 -6
- data/lib/ronin/gen/file_generator.rb +73 -0
- data/lib/ronin/gen/gen.rb +85 -0
- data/lib/ronin/gen/generatable.rb +36 -0
- data/lib/ronin/gen/generator.rb +312 -0
- data/lib/ronin/{ui/command_line/commands/gen_extension.rb → gen/generators.rb} +8 -9
- data/lib/ronin/gen/generators/library.rb +196 -0
- data/lib/ronin/gen/generators/repository.rb +130 -0
- data/lib/ronin/gen/ruby_generator.rb +34 -0
- data/lib/ronin/gen/source_code_generator.rb +46 -0
- data/lib/ronin/{generators → gen}/version.rb +3 -3
- data/lib/ronin/ui/{command_line → cli}/commands/gen.rb +18 -19
- data/ronin-gen.gemspec +10 -0
- data/spec/gen/classes/basic_generator.rb +16 -0
- data/spec/gen/classes/dir_generator.rb +9 -0
- data/spec/{generators → gen}/classes/file_generator.rb +2 -2
- data/spec/{generators → gen}/classes/templated_generator.rb +3 -3
- data/spec/gen/classes/touch_generator.rb +9 -0
- data/spec/gen/gen_spec.rb +22 -0
- data/spec/gen/generator_spec.rb +68 -0
- data/spec/gen/generators/library_spec.rb +132 -0
- data/spec/gen/generators/repository_spec.rb +92 -0
- data/spec/gen/helpers/data.rb +9 -0
- data/spec/{generators/helpers/static → gen/helpers/data}/generators/templated.txt.erb +0 -0
- data/spec/spec_helper.rb +3 -5
- metadata +190 -114
- data.tar.gz.sig +0 -0
- data/History.txt +0 -41
- data/Manifest.txt +0 -39
- data/bin/ronin-gen-extension +0 -12
- data/bin/ronin-gen-overlay +0 -12
- data/lib/ronin/generators/generator.rb +0 -165
- data/lib/ronin/generators/platform/extension.rb +0 -52
- data/lib/ronin/generators/platform/overlay.rb +0 -223
- data/spec/generated_extension_examples.rb +0 -27
- data/spec/generated_overlay_examples.rb +0 -72
- data/spec/generators/classes/dir_generator.rb +0 -9
- data/spec/generators/classes/touch_generator.rb +0 -9
- data/spec/generators/generator_spec.rb +0 -50
- data/spec/generators/generators_spec.rb +0 -9
- data/spec/generators/helpers/generators.rb +0 -3
- data/spec/generators/platform/extension_spec.rb +0 -22
- data/spec/generators/platform/overlay_spec.rb +0 -36
- data/spec/ui/command_line/commands/gen_extension_spec.rb +0 -22
- data/spec/ui/command_line/commands/gen_overlay_spec.rb +0 -38
- data/static/ronin/generators/platform/Rakefile.erb +0 -5
- data/static/ronin/generators/platform/extension.rb +0 -9
- data/tasks/spec.rb +0 -10
- data/tasks/yard.rb +0 -13
- metadata.gz.sig +0 -0
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'ronin/platform/extension'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
shared_examples_for "Generated Extension" do
|
6
|
-
|
7
|
-
before(:all) do
|
8
|
-
@lib_dir = File.join(@path,Ronin::Platform::Extension::LIB_DIR)
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should create the extension directory" do
|
12
|
-
File.directory?(@path).should == true
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should create a lib/ directory" do
|
16
|
-
File.directory?(@lib_dir).should == true
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should create an empty load file in the lib/ directory" do
|
20
|
-
File.file?(File.join(@lib_dir,@name + '.rb')).should == true
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should create an empty directory within the lib/ directory" do
|
24
|
-
File.directory?(File.join(@lib_dir,@name)).should == true
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
require 'ronin/platform/overlay'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'nokogiri'
|
5
|
-
|
6
|
-
shared_examples_for "Generated Overlay" do
|
7
|
-
|
8
|
-
it "should create the overlay directory" do
|
9
|
-
File.directory?(@path).should == true
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should create a static directory" do
|
13
|
-
static_dir = File.join(@path,'static')
|
14
|
-
|
15
|
-
File.directory?(static_dir).should == true
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should create a lib directory" do
|
19
|
-
lib_dir = File.join(@path,Ronin::Platform::Overlay::LIB_DIR)
|
20
|
-
|
21
|
-
File.directory?(lib_dir).should == true
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should create a objects directory" do
|
25
|
-
objects_dir = File.join(@path,Ronin::Platform::Overlay::OBJECTS_DIR)
|
26
|
-
|
27
|
-
File.directory?(objects_dir).should == true
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should create a Rakefile" do
|
31
|
-
rakefile = File.join(@path,'Rakefile')
|
32
|
-
|
33
|
-
File.file?(rakefile).should == true
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should create a XML metadata file" do
|
37
|
-
metadata_file = File.join(@path,Ronin::Platform::Overlay::METADATA_FILE)
|
38
|
-
|
39
|
-
File.file?(metadata_file).should == true
|
40
|
-
end
|
41
|
-
|
42
|
-
describe "XML metadata file" do
|
43
|
-
before(:all) do
|
44
|
-
@doc = Nokogiri::XML(open(File.join(@path,Ronin::Platform::Overlay::METADATA_FILE)))
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should have the title" do
|
48
|
-
@doc.at('/ronin-overlay/title').inner_text.should == @title
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should have the source URL" do
|
52
|
-
@doc.at('/ronin-overlay/source').inner_text.should == @source
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should have the source-view URL" do
|
56
|
-
@doc.at('/ronin-overlay/source-view').inner_text.should == @source_view
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should have the website URL" do
|
60
|
-
@doc.at('/ronin-overlay/website').inner_text.should == @website
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should have the license" do
|
64
|
-
@doc.at('/ronin-overlay/license').inner_text.should == @license
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should have the description" do
|
68
|
-
@doc.at('/ronin-overlay/description').inner_text.should == @description
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'ronin/generators/generator'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'generators/helpers/generators'
|
5
|
-
require 'generators/classes/file_generator'
|
6
|
-
require 'generators/classes/touch_generator'
|
7
|
-
require 'generators/classes/dir_generator'
|
8
|
-
require 'generators/classes/templated_generator'
|
9
|
-
|
10
|
-
require 'tmpdir'
|
11
|
-
require 'fileutils'
|
12
|
-
|
13
|
-
describe Generators::Generator do
|
14
|
-
before(:all) do
|
15
|
-
@previous_dir = Dir.pwd
|
16
|
-
@dir = File.join(Dir.tmpdir,'ronin_generators')
|
17
|
-
|
18
|
-
FileUtils.mkdir(@dir)
|
19
|
-
Dir.chdir(@dir)
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should generate files" do
|
23
|
-
FileGenerator.generate
|
24
|
-
|
25
|
-
File.read(File.join(@dir,'test.txt')).should == "hello"
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should touch files" do
|
29
|
-
TouchGenerator.generate
|
30
|
-
|
31
|
-
File.file?(File.join(@dir,'test2.txt')).should == true
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should generate directories" do
|
35
|
-
DirGenerator.generate
|
36
|
-
|
37
|
-
File.directory?(File.join(@dir,'test')).should == true
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should generate files using templates" do
|
41
|
-
TemplatedGenerator.generate(:message => 'hello')
|
42
|
-
|
43
|
-
File.read(File.join(@dir,'templated.txt')).should == "message: hello\n"
|
44
|
-
end
|
45
|
-
|
46
|
-
after(:all) do
|
47
|
-
FileUtils.rm_r(@dir)
|
48
|
-
Dir.chdir(@previous_dir)
|
49
|
-
end
|
50
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'ronin/generators/platform/extension'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'generated_extension_examples'
|
5
|
-
|
6
|
-
require 'tmpdir'
|
7
|
-
require 'fileutils'
|
8
|
-
|
9
|
-
describe Generators::Platform::Overlay do
|
10
|
-
before(:all) do
|
11
|
-
@name = 'ronin_generated_extension'
|
12
|
-
@path = File.join(Dir.tmpdir,@name)
|
13
|
-
|
14
|
-
Generators::Platform::Extension.generate(@path)
|
15
|
-
end
|
16
|
-
|
17
|
-
it_should_behave_like "Generated Extension"
|
18
|
-
|
19
|
-
after(:all) do
|
20
|
-
FileUtils.rm_r(@path)
|
21
|
-
end
|
22
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'ronin/generators/platform/overlay'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'generated_overlay_examples'
|
5
|
-
|
6
|
-
require 'tmpdir'
|
7
|
-
require 'fileutils'
|
8
|
-
|
9
|
-
describe Generators::Platform::Overlay do
|
10
|
-
before(:all) do
|
11
|
-
@name = 'ronin_generated_overlay'
|
12
|
-
@path = File.join(Dir.tmpdir,@name)
|
13
|
-
@title = 'Test Overlay'
|
14
|
-
@source = 'ssh+svn://www.example.com/var/svn/test/'
|
15
|
-
@source_view = 'http://www.example.com/test/'
|
16
|
-
@website = 'http://www.example.com/blog/'
|
17
|
-
@license = 'GPL-2'
|
18
|
-
@description = 'This is a test overlay'
|
19
|
-
|
20
|
-
Generators::Platform::Overlay.generate(
|
21
|
-
@path,
|
22
|
-
:title => @title,
|
23
|
-
:source => @source,
|
24
|
-
:source_view => @source_view,
|
25
|
-
:website => @website,
|
26
|
-
:license => @license,
|
27
|
-
:description => @description
|
28
|
-
)
|
29
|
-
end
|
30
|
-
|
31
|
-
it_should_behave_like "Generated Overlay"
|
32
|
-
|
33
|
-
after(:all) do
|
34
|
-
FileUtils.rm_r(@path)
|
35
|
-
end
|
36
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'ronin/ui/command_line/commands/gen_extension'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'generated_extension_examples'
|
5
|
-
|
6
|
-
require 'tmpdir'
|
7
|
-
require 'fileutils'
|
8
|
-
|
9
|
-
describe UI::CommandLine::Commands::GenExtension do
|
10
|
-
before(:all) do
|
11
|
-
@name = 'ronin_generated_extension'
|
12
|
-
@path = File.join(Dir.tmpdir,@name)
|
13
|
-
|
14
|
-
UI::CommandLine::Commands::GenExtension.start [@path]
|
15
|
-
end
|
16
|
-
|
17
|
-
it_should_behave_like "Generated Extension"
|
18
|
-
|
19
|
-
after(:all) do
|
20
|
-
FileUtils.rm_r(@path)
|
21
|
-
end
|
22
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'ronin/ui/command_line/commands/gen_overlay'
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'generated_overlay_examples'
|
5
|
-
|
6
|
-
require 'tmpdir'
|
7
|
-
require 'fileutils'
|
8
|
-
|
9
|
-
describe UI::CommandLine::Commands::GenOverlay do
|
10
|
-
|
11
|
-
before(:all) do
|
12
|
-
@name = 'ronin_generated_overlay'
|
13
|
-
@path = File.join(Dir.tmpdir,@name)
|
14
|
-
@title = 'Test Overlay'
|
15
|
-
@source = 'ssh+svn://www.example.com/var/svn/test/'
|
16
|
-
@source_view = 'http://www.example.com/test/'
|
17
|
-
@website = 'http://www.example.com/blog/'
|
18
|
-
@license = 'GPL-2'
|
19
|
-
@description = 'This is a test overlay'
|
20
|
-
|
21
|
-
UI::CommandLine::Commands::GenOverlay.start [
|
22
|
-
@path,
|
23
|
-
'--title', @title,
|
24
|
-
'--source', @source,
|
25
|
-
'--source-view', @source_view,
|
26
|
-
'--website', @website,
|
27
|
-
'--license', @license,
|
28
|
-
'--description', @description
|
29
|
-
]
|
30
|
-
end
|
31
|
-
|
32
|
-
it_should_behave_like "Generated Overlay"
|
33
|
-
|
34
|
-
after(:all) do
|
35
|
-
FileUtils.rm_r(@path)
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
data/tasks/spec.rb
DELETED
data/tasks/yard.rb
DELETED
metadata.gz.sig
DELETED
Binary file
|