rabal 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. data/CHANGES +13 -0
  2. data/README.PLUGIN +8 -8
  3. data/Rakefile +79 -0
  4. data/lib/rabal.rb +26 -28
  5. data/lib/rabal/application.rb +53 -15
  6. data/lib/rabal/directory_tree.rb +3 -3
  7. data/lib/rabal/error.rb +2 -0
  8. data/lib/rabal/file_tree.rb +9 -4
  9. data/lib/rabal/gemspec.rb +50 -0
  10. data/lib/rabal/logger.rb +15 -6
  11. data/lib/rabal/plugin.rb +9 -5
  12. data/lib/rabal/plugin/core.rb +4 -3
  13. data/lib/rabal/plugin/ext.rb +17 -0
  14. data/lib/rabal/plugin/foundation.rb +21 -10
  15. data/lib/rabal/plugin/license.rb +8 -13
  16. data/lib/rabal/plugin/rubyforge.rb +22 -0
  17. data/lib/rabal/plugin/spec.rb +6 -0
  18. data/lib/rabal/plugin/test.rb +7 -0
  19. data/lib/rabal/plugin_tree.rb +1 -2
  20. data/lib/rabal/project_tree.rb +7 -2
  21. data/lib/rabal/specification.rb +128 -0
  22. data/lib/rabal/tree.rb +19 -5
  23. data/lib/rabal/usage.rb +8 -5
  24. data/lib/rabal/util.rb +2 -2
  25. data/lib/rabal/version.rb +6 -3
  26. data/resources/trees/bin/rabal.project +3 -3
  27. data/resources/trees/core/{CHANGES → CHANGES.erb} +1 -1
  28. data/resources/trees/core/{README → README.erb} +1 -1
  29. data/resources/trees/core/Rakefile.erb +67 -0
  30. data/resources/trees/core/lib/rabal.project.rb.erb +0 -2
  31. data/resources/trees/core/lib/rabal.project/gemspec.rb.erb +51 -0
  32. data/resources/trees/core/lib/rabal.project/specification.rb.erb +128 -0
  33. data/resources/trees/core/lib/rabal.project/version.rb.erb +2 -1
  34. data/resources/trees/ext/ext/rabal.project/ext/mkrf_conf.rb.erb +7 -0
  35. data/resources/trees/ext/tasks/extension.rb.erb +15 -0
  36. data/resources/trees/rubyforge/tasks/rubyforge.rb.erb +105 -0
  37. data/resources/trees/spec/{rabal.project_spec.rb.erb → spec/rabal.project_spec.rb.erb} +0 -0
  38. data/resources/trees/spec/{spec_helper.rb.erb → spec/spec_helper.rb.erb} +0 -0
  39. data/resources/trees/spec/tasks/rspec.rb.erb +20 -0
  40. data/resources/trees/test/tasks/testunit.rb.erb +14 -0
  41. data/resources/trees/test/{rabal.project_test.rb.erb → test/rabal.project_test.rb.erb} +1 -1
  42. data/resources/trees/test/{test_helper.rb.erb → test/test_helper.rb.erb} +1 -1
  43. data/spec/application_spec.rb +47 -0
  44. data/spec/bin_plugin_spec.rb +1 -1
  45. data/spec/core_plugin_spec.rb +10 -3
  46. data/spec/license_plugin_spec.rb +10 -8
  47. data/spec/plugin_tree_spec.rb +4 -4
  48. data/spec/spec_plugin_spec.rb +1 -1
  49. data/spec/test_plugin_spec.rb +1 -1
  50. data/spec/version_spec.rb +1 -1
  51. metadata +73 -24
  52. data/resources/trees/core/Rakefile +0 -0
@@ -0,0 +1,20 @@
1
+ require 'spec/rake/spectask'
2
+
3
+ #-----------------------------------------------------------------------
4
+ # Testing - this is either test or spec, include the appropriate one
5
+ #-----------------------------------------------------------------------
6
+ namespace :test do
7
+
8
+ task :default => :spec
9
+
10
+ Spec::Rake::SpecTask.new do |r|
11
+ r.rcov = true
12
+ r.rcov_dir = <%= project_name.camelize %>::SPEC.local_coverage_dir
13
+ r.libs = <%= project_name.camelize %>::SPEC.require_paths
14
+ r.spec_opts = %w(--format specdoc)
15
+ end
16
+
17
+ task :coverage => [:spec] do
18
+ show_files <%= project_name.camelize %>::SPEC.local_coverage_dir
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ require 'rake/testtask'
2
+ #-----------------------------------------------------------------------
3
+ # Testing - this is either test or spec, include the appropriate one
4
+ #-----------------------------------------------------------------------
5
+ namespace :test do
6
+
7
+ task :default => :test
8
+
9
+ Rake::TestTask.new do |t|
10
+ t.libs = <%= project_name.camelize %>::SPEC.require_paths
11
+ t.test_files= FileList["test/**/*.rb"]
12
+ end
13
+
14
+ end
@@ -1,6 +1,6 @@
1
1
  require File.join(File.dirname(__FILE__),"test_helper.rb")
2
2
 
3
- class Test<%= root.name.capitalize %> < Test::Unit::TestCase
3
+ class Test<%= project_name.camelize %> < Test::Unit::TestCase
4
4
  def setup
5
5
  end
6
6
 
@@ -1,3 +1,3 @@
1
1
  require 'test/unit'
2
2
  $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
3
- require '<%= root.name %>'
3
+ require '<%= project_name %>'
@@ -0,0 +1,47 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__),"spec_helper"))
2
+ require 'rabal/application'
3
+ require 'stringio'
4
+
5
+ describe Rabal::Application do
6
+ before(:each) do
7
+ @working_dir = my_temp_dir
8
+ @before = Dir.pwd
9
+ @base_tree = Set.new(%w(README Rakefile CHANGES LICENSE lib lib/spec-proj lib/new_spec_proj.rb lib/spec-proj/version.rb lib/spec-proj/specification.rb lib/spec-proj/gemspec.rb))
10
+ @stdin = StringIO.new
11
+ @stdout = StringIO.new
12
+ @stderr = StringIO.new
13
+ @application = Rabal::Application.new(@stdin,@stdout,@stderr)
14
+ Dir.chdir(@working_dir)
15
+ end
16
+
17
+ after(:each) do
18
+ Dir.chdir(@before)
19
+ FileUtils.rm_rf @working_dir
20
+ end
21
+
22
+ it "should exit 0 on --help" do
23
+ begin
24
+ @application.run(%w[--help])
25
+ rescue SystemExit => se
26
+ se.status.should == 0
27
+ end
28
+ end
29
+
30
+ it "should output to stderr on bad parameters" do
31
+ begin
32
+ @application.run(%w[--blah])
33
+ rescue SystemExit => se
34
+ se.status.should == 1
35
+ @stderr.string.should =~ /unrecognized option `--blah'/m
36
+ end
37
+ end
38
+
39
+ it "should have allow for plugin options" do
40
+ begin
41
+ @application.run(%w[--use-all --help])
42
+ rescue SystemExit => se
43
+ se.status.should == 0
44
+ end
45
+ end
46
+ end
47
+
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Bin do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb bin bin/new_spec_proj))
8
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb bin bin/new_spec_proj lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -4,7 +4,7 @@ describe Rabal::Plugin::Core do
4
4
  @working_dir = my_temp_dir
5
5
  @before = Dir.pwd
6
6
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
7
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb))
7
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb))
8
8
  Dir.chdir(@working_dir)
9
9
  end
10
10
 
@@ -22,8 +22,15 @@ describe Rabal::Plugin::Core do
22
22
  find_in("new-spec-proj").sort.should == @base_tree.sort
23
23
  end
24
24
 
25
- it "should raise PluginParameterMissingError if missing information" do
26
- lambda {Rabal::Plugin::Core.new({})}.should raise_error(Rabal::PluginParameterMissingError)
25
+ it "the tree should have author and email" do
26
+ @core.tree.process
27
+ @core.tree.author.should == "Foo Bar"
28
+ @core.tree.email.should == "foobar@example.com"
27
29
  end
28
30
 
31
+ # TODO: test to make sure that highline is used
32
+ # it "should raise PluginParameterMissingError if missing information" do
33
+ # lambda {Rabal::Plugin::Core.new({})}.should raise_error(Rabal::PluginParameterMissingError)
34
+ # end
35
+
29
36
  end
@@ -4,7 +4,7 @@ describe Rabal::Plugin::License do
4
4
  @working_dir = my_temp_dir
5
5
  @before = Dir.pwd
6
6
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
7
- @base_tree = Set.new(%w(README Rakefile CHANGES COPYING LICENSE lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb))
7
+ @base_tree = Set.new(%w(README Rakefile CHANGES COPYING LICENSE lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb))
8
8
  Dir.chdir(@working_dir)
9
9
  end
10
10
 
@@ -12,10 +12,11 @@ describe Rabal::Plugin::License do
12
12
  Dir.chdir(@before)
13
13
  FileUtils.rm_rf @working_dir
14
14
  end
15
-
16
- it "should raise an error if the flavor is missing" do
17
- lambda { Rabal::Plugin::License.new({}) }.should raise_error(PluginParameterMissingError)
18
- end
15
+
16
+ # TODO: Change this to test that highline is used
17
+ # it "should raise an error if the flavor is missing" do
18
+ # lambda { Rabal::Plugin::License.new({}) }.should raise_error(PluginParameterMissingError)
19
+ # end
19
20
 
20
21
  it "should create a valid tree structure" do
21
22
  lic = Rabal::Plugin::License.new({:flavor => "BSD"})
@@ -32,8 +33,9 @@ describe Rabal::Plugin::License do
32
33
  end
33
34
 
34
35
 
35
- it "should raise an error if the flavor is incorrect" do
36
- lambda { Rabal::Plugin::License.new({:flavor => "BLAH"}) }.should raise_error(PluginParameterMissingError)
37
- end
36
+ # TODO: change this to make sure that highline is used
37
+ #it "should raise an error if the flavor is incorrect" do
38
+ # lambda { Rabal::Plugin::License.new({:flavor => "BLAH"}) }.should raise_error(PluginParameterMissingError)
39
+ #end
38
40
 
39
41
  end
@@ -8,7 +8,7 @@ describe Rabal::PluginTree do
8
8
  @tree = ProjectTree.new('new-spec-proj', {:author => "Some Author", :email => "author@example.com"})
9
9
  @tree << PluginTree.new({:data1 => "some_data" },resource_handle("core"))
10
10
 
11
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb))
11
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb))
12
12
 
13
13
  @before = Dir.pwd
14
14
  Dir.chdir(@working_dir)
@@ -27,7 +27,7 @@ describe Rabal::PluginTree do
27
27
  it "should allow for insertion into the Plugin Tree" do
28
28
  @tree << PluginTree.new({},resource_handle("test"),"test")
29
29
  @tree.process
30
- find_in('new-spec-proj').sort.should == (@base_tree + %w(test test/new_spec_proj_test.rb test/test_helper.rb)).sort
30
+ find_in('new-spec-proj').sort.should == (@base_tree + %w(test test/tasks test/tasks/testunit.rb test/test test/test/new_spec_proj_test.rb test/test/test_helper.rb)).sort
31
31
  end
32
32
 
33
33
  it "should allow for insertion into the Plugin Tree somewhere other than the root" do
@@ -36,8 +36,8 @@ describe Rabal::PluginTree do
36
36
  @tree << d1
37
37
  d1d2 = %w(misc misc/stuff)
38
38
 
39
- @tree.add_at_path("misc/stuff", PluginTree.new({},resource_handle("spec"),"spec"))
40
- spec = %w(misc/stuff/spec misc/stuff/spec/spec_helper.rb misc/stuff/spec/new_spec_proj_spec.rb)
39
+ @tree.add_at_path("misc/stuff", PluginTree.new({},resource_handle("spec"),"subdir"))
40
+ spec = %w(misc/stuff/subdir misc/stuff/subdir/spec/spec_helper.rb misc/stuff/subdir/spec/new_spec_proj_spec.rb misc/stuff/subdir/tasks/rspec.rb misc/stuff/subdir/spec misc/stuff/subdir/tasks)
41
41
 
42
42
  @tree.process
43
43
  find_in('new-spec-proj').sort.should == (@base_tree + d1d2 + spec).sort
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Spec do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb spec spec/new_spec_proj_spec.rb spec/spec_helper.rb))
8
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb spec spec/new_spec_proj_spec.rb spec/spec_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/rspec.rb))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Test do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb test test/new_spec_proj_test.rb test/test_helper.rb))
8
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb test test/new_spec_proj_test.rb test/test_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/testunit.rb ))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -8,7 +8,7 @@ describe "Rabal::Version" do
8
8
  Rabal::Version::MINOR.should >= 0
9
9
  end
10
10
 
11
- it "should have a build number that is >= 0" do
11
+ it "should have a tiny number that is >= 0" do
12
12
  Rabal::Version::BUILD.should >= 0
13
13
  end
14
14
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rabal
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2007-06-12 00:00:00 -06:00
6
+ version: 0.1.0
7
+ date: 2007-08-08 00:00:00 -06:00
8
8
  summary: A tool for bootstrapping project development
9
9
  require_paths:
10
10
  - lib
@@ -13,7 +13,7 @@ homepage: http://copiousfreetime.rubyforge.org/rabal/
13
13
  rubyforge_project: copiousfreetime
14
14
  description: Ruby Architecture for Building Applications and Libraries. Rabal is a commandline application for bootstrapping, packaging and distributing ruby projects.
15
15
  autorequire:
16
- default_executable:
16
+ default_executable: rabal
17
17
  bindir: bin
18
18
  has_rdoc: true
19
19
  required_ruby_version: !ruby/object:Gem::Version::Requirement
@@ -29,15 +29,40 @@ post_install_message:
29
29
  authors:
30
30
  - Jeremy Hinegardner
31
31
  files:
32
+ - spec/plugin_tree_spec.rb
33
+ - spec/core_plugin_spec.rb
34
+ - spec/application_spec.rb
35
+ - spec/version_spec.rb
36
+ - spec/test_plugin_spec.rb
37
+ - spec/bin_plugin_spec.rb
38
+ - spec/directory_tree_spec.rb
39
+ - spec/action_tree_spec.rb
40
+ - spec/utils_spec.rb
41
+ - spec/license_plugin_spec.rb
42
+ - spec/spec_plugin_spec.rb
43
+ - spec/spec_helper.rb
44
+ - spec/file_tree_spec.rb
45
+ - spec/tree_spec.rb
46
+ - spec/project_tree_spec.rb
47
+ - Rakefile
48
+ - README
49
+ - LICENSE
50
+ - CHANGES
51
+ - README.PLUGIN
52
+ - COPYING
32
53
  - lib/rabal.rb
54
+ - lib/rabal/specification.rb
33
55
  - lib/rabal/util.rb
34
56
  - lib/rabal/plugin/bin.rb
57
+ - lib/rabal/plugin/ext.rb
35
58
  - lib/rabal/plugin/license.rb
36
59
  - lib/rabal/plugin/core.rb
37
60
  - lib/rabal/plugin/foundation.rb
61
+ - lib/rabal/plugin/rubyforge.rb
38
62
  - lib/rabal/plugin/spec.rb
39
63
  - lib/rabal/plugin/test.rb
40
64
  - lib/rabal/directory_tree.rb
65
+ - lib/rabal/gemspec.rb
41
66
  - lib/rabal/application.rb
42
67
  - lib/rabal/version.rb
43
68
  - lib/rabal/error.rb
@@ -51,13 +76,24 @@ files:
51
76
  - lib/rabal/action_tree.rb
52
77
  - resources/trees
53
78
  - resources/trees/ext
54
- - resources/trees/ext/rabal.project
79
+ - resources/trees/ext/ext
80
+ - resources/trees/ext/ext/rabal.project
81
+ - resources/trees/ext/ext/rabal.project/ext
82
+ - resources/trees/ext/ext/rabal.project/ext/mkrf_conf.rb.erb
83
+ - resources/trees/ext/tasks
84
+ - resources/trees/ext/tasks/extension.rb.erb
55
85
  - resources/trees/spec
56
- - resources/trees/spec/spec_helper.rb.erb
57
- - resources/trees/spec/rabal.project_spec.rb.erb
86
+ - resources/trees/spec/spec
87
+ - resources/trees/spec/spec/spec_helper.rb.erb
88
+ - resources/trees/spec/spec/rabal.project_spec.rb.erb
89
+ - resources/trees/spec/tasks
90
+ - resources/trees/spec/tasks/rspec.rb.erb
58
91
  - resources/trees/test
59
- - resources/trees/test/rabal.project_test.rb.erb
60
- - resources/trees/test/test_helper.rb.erb
92
+ - resources/trees/test/test
93
+ - resources/trees/test/test/rabal.project_test.rb.erb
94
+ - resources/trees/test/test/test_helper.rb.erb
95
+ - resources/trees/test/tasks
96
+ - resources/trees/test/tasks/testunit.rb.erb
61
97
  - resources/trees/license
62
98
  - resources/trees/license/LICENSE.ruby
63
99
  - resources/trees/license/COPYING.ruby
@@ -66,23 +102,25 @@ files:
66
102
  - resources/trees/license/COPYING.gpl
67
103
  - resources/trees/license/COPYING.lgpl
68
104
  - resources/trees/core
69
- - resources/trees/core/Rakefile
70
- - resources/trees/core/README
71
- - resources/trees/core/CHANGES
105
+ - resources/trees/core/Rakefile.erb
106
+ - resources/trees/core/README.erb
107
+ - resources/trees/core/CHANGES.erb
72
108
  - resources/trees/core/lib
73
109
  - resources/trees/core/lib/rabal.project
74
110
  - resources/trees/core/lib/rabal.project/version.rb.erb
111
+ - resources/trees/core/lib/rabal.project/specification.rb.erb
112
+ - resources/trees/core/lib/rabal.project/gemspec.rb.erb
75
113
  - resources/trees/core/lib/rabal.project.rb.erb
76
114
  - resources/trees/bin
77
115
  - resources/trees/bin/rabal.project
116
+ - resources/trees/rubyforge
117
+ - resources/trees/rubyforge/tasks
118
+ - resources/trees/rubyforge/tasks/rubyforge.rb.erb
78
119
  - bin/rabal
79
- - LICENSE
80
- - README
81
- - COPYING
82
- - README.PLUGIN
83
120
  test_files:
84
121
  - spec/plugin_tree_spec.rb
85
122
  - spec/core_plugin_spec.rb
123
+ - spec/application_spec.rb
86
124
  - spec/version_spec.rb
87
125
  - spec/test_plugin_spec.rb
88
126
  - spec/bin_plugin_spec.rb
@@ -96,17 +134,19 @@ test_files:
96
134
  - spec/tree_spec.rb
97
135
  - spec/project_tree_spec.rb
98
136
  rdoc_options:
99
- - - --line-numbers
100
- - --inline-source
101
- - --title
102
- - Rabal -- Ruby Architecture for Building Applications and Libraries
103
- - --main
104
- - README
137
+ - --line-numbers
138
+ - --inline-source
139
+ - --main
140
+ - README
141
+ - --title
142
+ - "'rabal -- A tool for bootstrapping project development'"
105
143
  extra_rdoc_files:
106
- - LICENSE
144
+ - Rakefile
107
145
  - README
108
- - COPYING
146
+ - LICENSE
147
+ - CHANGES
109
148
  - README.PLUGIN
149
+ - COPYING
110
150
  executables:
111
151
  - rabal
112
152
  extensions: []
@@ -132,3 +172,12 @@ dependencies:
132
172
  - !ruby/object:Gem::Version
133
173
  version: 0.2.1
134
174
  version:
175
+ - !ruby/object:Gem::Dependency
176
+ name: highline
177
+ version_requirement:
178
+ version_requirements: !ruby/object:Gem::Version::Requirement
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: 1.2.9
183
+ version:
File without changes