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.
Files changed (87) hide show
  1. data/.document +4 -0
  2. data/.rspec +1 -0
  3. data/.yardopts +1 -0
  4. data/ChangeLog.md +41 -0
  5. data/Gemfile +27 -0
  6. data/{README.txt → README.md} +30 -21
  7. data/Rakefile +24 -20
  8. data/bin/ronin-gen +27 -8
  9. data/data/ronin/gen/library/.document +5 -0
  10. data/data/ronin/gen/library/.gitignore +10 -0
  11. data/data/ronin/gen/library/.rspec +1 -0
  12. data/data/ronin/gen/library/.yardopts.erb +1 -0
  13. data/data/ronin/gen/library/COPYING.txt +339 -0
  14. data/data/ronin/gen/library/ChangeLog.md.erb +4 -0
  15. data/data/ronin/gen/library/Gemfile.erb +23 -0
  16. data/data/ronin/gen/library/README.md.erb +46 -0
  17. data/data/ronin/gen/library/Rakefile +30 -0
  18. data/data/ronin/gen/library/bin/ronin-command.erb +25 -0
  19. data/data/ronin/gen/library/bin/ronin-name.erb +27 -0
  20. data/data/ronin/gen/library/gemspec.yml.erb +20 -0
  21. data/data/ronin/gen/library/lib/ronin/_license.erb +19 -0
  22. data/data/ronin/gen/library/lib/ronin/gen/generators/generator.rb.erb +22 -0
  23. data/data/ronin/gen/library/lib/ronin/name.rb.erb +3 -0
  24. data/data/ronin/gen/library/lib/ronin/name/version.rb.erb +8 -0
  25. data/data/ronin/gen/library/lib/ronin/ui/command_line/commands/command.rb.erb +22 -0
  26. data/data/ronin/gen/library/library.gemspec.erb +10 -0
  27. data/data/ronin/gen/library/spec/name/name_spec.rb.erb +8 -0
  28. data/data/ronin/gen/library/spec/spec_helper.rb.erb +4 -0
  29. data/data/ronin/gen/repository/.rspec +1 -0
  30. data/data/ronin/gen/repository/Rakefile.erb +32 -0
  31. data/data/ronin/gen/repository/ronin.yml.erb +18 -0
  32. data/{static/ronin/generators/platform → data/ronin/gen/repository}/spec/spec_helper.rb +0 -0
  33. data/gemspec.yml +24 -0
  34. data/lib/ronin/gen.rb +26 -0
  35. data/lib/ronin/{ui/command_line/commands/gen_overlay.rb → gen/config.rb} +6 -8
  36. data/lib/ronin/{generators → gen}/dir_generator.rb +25 -21
  37. data/lib/ronin/{generators.rb → gen/exceptions.rb} +2 -5
  38. data/lib/ronin/{generators/platform/static.rb → gen/exceptions/unknown_generator.rb} +3 -6
  39. data/lib/ronin/gen/file_generator.rb +73 -0
  40. data/lib/ronin/gen/gen.rb +85 -0
  41. data/lib/ronin/gen/generatable.rb +36 -0
  42. data/lib/ronin/gen/generator.rb +312 -0
  43. data/lib/ronin/{ui/command_line/commands/gen_extension.rb → gen/generators.rb} +8 -9
  44. data/lib/ronin/gen/generators/library.rb +196 -0
  45. data/lib/ronin/gen/generators/repository.rb +130 -0
  46. data/lib/ronin/gen/ruby_generator.rb +34 -0
  47. data/lib/ronin/gen/source_code_generator.rb +46 -0
  48. data/lib/ronin/{generators → gen}/version.rb +3 -3
  49. data/lib/ronin/ui/{command_line → cli}/commands/gen.rb +18 -19
  50. data/ronin-gen.gemspec +10 -0
  51. data/spec/gen/classes/basic_generator.rb +16 -0
  52. data/spec/gen/classes/dir_generator.rb +9 -0
  53. data/spec/{generators → gen}/classes/file_generator.rb +2 -2
  54. data/spec/{generators → gen}/classes/templated_generator.rb +3 -3
  55. data/spec/gen/classes/touch_generator.rb +9 -0
  56. data/spec/gen/gen_spec.rb +22 -0
  57. data/spec/gen/generator_spec.rb +68 -0
  58. data/spec/gen/generators/library_spec.rb +132 -0
  59. data/spec/gen/generators/repository_spec.rb +92 -0
  60. data/spec/gen/helpers/data.rb +9 -0
  61. data/spec/{generators/helpers/static → gen/helpers/data}/generators/templated.txt.erb +0 -0
  62. data/spec/spec_helper.rb +3 -5
  63. metadata +190 -114
  64. data.tar.gz.sig +0 -0
  65. data/History.txt +0 -41
  66. data/Manifest.txt +0 -39
  67. data/bin/ronin-gen-extension +0 -12
  68. data/bin/ronin-gen-overlay +0 -12
  69. data/lib/ronin/generators/generator.rb +0 -165
  70. data/lib/ronin/generators/platform/extension.rb +0 -52
  71. data/lib/ronin/generators/platform/overlay.rb +0 -223
  72. data/spec/generated_extension_examples.rb +0 -27
  73. data/spec/generated_overlay_examples.rb +0 -72
  74. data/spec/generators/classes/dir_generator.rb +0 -9
  75. data/spec/generators/classes/touch_generator.rb +0 -9
  76. data/spec/generators/generator_spec.rb +0 -50
  77. data/spec/generators/generators_spec.rb +0 -9
  78. data/spec/generators/helpers/generators.rb +0 -3
  79. data/spec/generators/platform/extension_spec.rb +0 -22
  80. data/spec/generators/platform/overlay_spec.rb +0 -36
  81. data/spec/ui/command_line/commands/gen_extension_spec.rb +0 -22
  82. data/spec/ui/command_line/commands/gen_overlay_spec.rb +0 -38
  83. data/static/ronin/generators/platform/Rakefile.erb +0 -5
  84. data/static/ronin/generators/platform/extension.rb +0 -9
  85. data/tasks/spec.rb +0 -10
  86. data/tasks/yard.rb +0 -13
  87. 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,9 +0,0 @@
1
- require 'ronin/generators/generator'
2
-
3
- class DirGenerator < Generators::Generator
4
-
5
- def generate
6
- mkdir 'test'
7
- end
8
-
9
- end
@@ -1,9 +0,0 @@
1
- require 'ronin/generators/generator'
2
-
3
- class TouchGenerator < Generators::Generator
4
-
5
- def generate
6
- touch('test2.txt')
7
- end
8
-
9
- 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,9 +0,0 @@
1
- require 'ronin/generators/version'
2
-
3
- require 'spec_helper'
4
-
5
- describe Generators do
6
- it "should have a version" do
7
- Generators.const_defined?('VERSION').should == true
8
- end
9
- end
@@ -1,3 +0,0 @@
1
- require 'ronin/static/static'
2
-
3
- Static.directory File.join(File.dirname(__FILE__),'static')
@@ -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
@@ -1,5 +0,0 @@
1
- # -*- ruby -*-
2
- <% @tasks.each do |task| %>
3
- require 'ronin/platform/tasks/<%= task %>
4
- <% end %>
5
- # vim: syntax=Ruby
@@ -1,9 +0,0 @@
1
- ronin_extension do
2
-
3
- setup do
4
- end
5
-
6
- teardown do
7
- end
8
-
9
- end
@@ -1,10 +0,0 @@
1
- require 'spec/rake/spectask'
2
-
3
- desc "Run all specifications"
4
- Spec::Rake::SpecTask.new(:spec) do |t|
5
- t.libs += ['lib', 'spec']
6
- t.spec_opts = ['--colour', '--format', 'specdoc']
7
- end
8
-
9
- task :test => :spec
10
- task :default => :spec
@@ -1,13 +0,0 @@
1
- require 'ronin/yard/handlers'
2
-
3
- YARD::Rake::YardocTask.new do |t|
4
- t.files = ['lib/**/*.rb']
5
- t.options = [
6
- '--protected',
7
- '--files', 'History.txt',
8
- '--title', 'Ronin Generators',
9
- '--quiet'
10
- ]
11
- end
12
-
13
- task :docs => :yardoc
metadata.gz.sig DELETED
Binary file