rabal 0.2.3 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/{CHANGES → HISTORY} +23 -7
  2. data/README +96 -66
  3. data/bin/rabal +6 -7
  4. data/gemspec.rb +47 -0
  5. data/lib/rabal.rb +63 -19
  6. data/lib/rabal/application.rb +4 -4
  7. data/lib/rabal/plugin/foundation.rb +4 -3
  8. data/lib/rabal/version.rb +16 -14
  9. data/resources/trees/bin/rabal.project +7 -8
  10. data/resources/trees/core/HISTORY.erb +4 -0
  11. data/resources/trees/core/README.erb +6 -0
  12. data/resources/trees/core/Rakefile.erb +53 -7
  13. data/resources/trees/core/gemspec.rb.erb +48 -0
  14. data/resources/trees/core/lib/rabal.project.rb.erb +52 -20
  15. data/resources/trees/core/lib/rabal.project/version.rb.erb +21 -13
  16. data/resources/trees/core/tasks/announce.rake.erb +36 -54
  17. data/resources/trees/core/tasks/config.rb.erb +107 -0
  18. data/resources/trees/core/tasks/distribution.rake.erb +19 -13
  19. data/resources/trees/core/tasks/documentation.rake.erb +25 -19
  20. data/resources/trees/core/tasks/utils.rb.erb +80 -0
  21. data/resources/trees/ext/tasks/extension.rake.erb +42 -10
  22. data/resources/trees/rubyforge/tasks/rubyforge.rake.erb +48 -40
  23. data/resources/trees/spec/spec/rabal.project_spec.rb.erb +10 -10
  24. data/resources/trees/spec/tasks/rspec.rake.erb +23 -18
  25. data/resources/trees/test/tasks/testunit.rake.erb +14 -9
  26. data/resources/trees/test/test/rabal.project_test.rb.erb +6 -6
  27. data/resources/trees/website/tasks/site.rake.erb +5 -5
  28. data/spec/application_spec.rb +3 -3
  29. data/spec/bin_plugin_spec.rb +1 -1
  30. data/spec/core_plugin_spec.rb +1 -1
  31. data/spec/license_plugin_spec.rb +1 -1
  32. data/spec/plugin_tree_spec.rb +1 -1
  33. data/spec/spec_helper.rb +3 -6
  34. data/spec/spec_plugin_spec.rb +1 -1
  35. data/spec/test_plugin_spec.rb +1 -1
  36. data/tasks/announce.rake +40 -0
  37. data/tasks/config.rb +99 -0
  38. data/tasks/distribution.rake +45 -0
  39. data/tasks/documentation.rake +31 -0
  40. data/tasks/rspec.rake +29 -0
  41. data/tasks/rubyforge.rake +52 -0
  42. data/tasks/utils.rb +80 -0
  43. metadata +105 -59
  44. data/Rakefile +0 -12
  45. data/lib/rabal/specification.rb +0 -128
  46. data/resources/trees/core/CHANGES.erb +0 -4
  47. data/resources/trees/core/lib/rabal.project/gemspec.rb.erb +0 -51
  48. data/resources/trees/core/lib/rabal.project/specification.rb.erb +0 -128
  49. data/resources/trees/core/tasks/setup.rb.erb +0 -40
@@ -1,4 +0,0 @@
1
- = <%= project_name %> Changelog
2
- === Version 0.0.1
3
-
4
- * Initial public release
@@ -1,51 +0,0 @@
1
- require 'rubygems'
2
- require '<%= project_name %>/specification'
3
- require '<%= project_name %>/version'
4
- require 'rake'
5
-
6
- # The Gem Specification plus some extras for <%= project_name %>.
7
- module <%= project_name.camelize %>
8
- SPEC = <%= project_name.camelize %>::Specification.new do |spec|
9
- spec.name = "<%= project_name %>"
10
- spec.version = <%= project_name.camelize %>::VERSION
11
- spec.rubyforge_project = "<%= project_name %>"
12
- spec.author = "<%= root.author %>"
13
- spec.email = "<%= root.email %>"
14
- spec.homepage = "http://<%= project_name %>.rubyforge.org/"
15
-
16
- spec.summary = "A Summary of <%= project_name %>."
17
- spec.description = <<-DESC
18
- A longer more detailed description of <%= project_name %>.
19
- DESC
20
-
21
- spec.extra_rdoc_files = FileList["[A-Z]*"]
22
- spec.has_rdoc = true
23
- spec.rdoc_main = "README"
24
- spec.rdoc_options = [ "--line-numbers" , "--inline-source" ]
25
-
26
- spec.test_files = FileList["spec/**/*.rb", "test/**/*.rb"]
27
- spec.files = spec.test_files + spec.extra_rdoc_files +
28
- FileList["lib/**/*.rb", "resources/**/*"]
29
- <% if root.has_subtree?(["bin"]) then %>
30
- spec.executable = spec.name
31
- <% end %>
32
-
33
- # add dependencies
34
- # spec.add_dependency("somegem", ">= 0.4.2")
35
- <% if root.has_subtree?(["ext"]) then %>
36
- spec.add_dependency("mkrf")
37
- spec.extensions << "ext/<%= project_name %>/ext/mkrf_conf.rb"
38
- <% end %>
39
- spec.platform = Gem::Platform::RUBY
40
-
41
- spec.local_rdoc_dir = "doc/rdoc"
42
- spec.remote_rdoc_dir = "#{spec.name}/rdoc"
43
- spec.local_coverage_dir = "doc/coverage"
44
- spec.remote_coverage_dir= "#{spec.name}/coverage"
45
-
46
- spec.remote_site_dir = "#{spec.name}/"
47
-
48
- end
49
- end
50
-
51
-
@@ -1,128 +0,0 @@
1
- require 'rubygems'
2
- require 'rubygems/specification'
3
- require 'rake'
4
-
5
- module <%= project_name.camelize %>
6
- # Add some additional items to Gem::Specification
7
- # A <%= project_name.camelize %>::Specification adds additional pieces of information the
8
- # typical gem specification
9
- class Specification
10
-
11
- RUBYFORGE_ROOT = "/var/www/gforge-projects/"
12
-
13
- # user that accesses remote site
14
- attr_accessor :remote_user
15
-
16
- # remote host, default 'rubyforge.org'
17
- attr_accessor :remote_host
18
-
19
- # name the rdoc main
20
- attr_accessor :rdoc_main
21
-
22
- # local directory in development holding the generated rdoc
23
- # default 'doc'
24
- attr_accessor :local_rdoc_dir
25
-
26
- # remote directory for storing rdoc, default 'doc'
27
- attr_accessor :remote_rdoc_dir
28
-
29
- # local directory for coverage report
30
- attr_accessor :local_coverage_dir
31
-
32
- # remote directory for storing coverage reports
33
- # This defaults to 'coverage'
34
- attr_accessor :remote_coverage_dir
35
-
36
- # local directory for generated website, default +site/public+
37
- attr_accessor :local_site_dir
38
-
39
- # remote directory relative to +remote_root+ for the website.
40
- # website.
41
- attr_accessor :remote_site_dir
42
-
43
- # is a .tgz to be created?, default 'true'
44
- attr_accessor :need_tar
45
-
46
- # is a .zip to be created, default 'true'
47
- attr_accessor :need_zip
48
-
49
-
50
- def initialize
51
- @remote_user = nil
52
- @remote_host = "rubyforge.org"
53
-
54
- @rdoc_main = "README"
55
- @local_rdoc_dir = "doc"
56
- @remote_rdoc_dir = "doc"
57
- @local_coverage_dir = "coverage"
58
- @remote_coverage_dir = "coverage"
59
- @local_site_dir = "site/public"
60
- @remote_site_dir = "."
61
-
62
- @need_tar = true
63
- @need_zip = true
64
-
65
- @spec = Gem::Specification.new
66
-
67
- yield self if block_given?
68
-
69
- # update rdoc options to take care of the rdoc_main if it is
70
- # there, and add a default title if one is not given
71
- if not @spec.rdoc_options.include?("--main") then
72
- @spec.rdoc_options.concat(["--main", rdoc_main])
73
- end
74
-
75
- if not @spec.rdoc_options.include?("--title") then
76
- @spec.rdoc_options.concat(["--title","'#{name} -- #{summary}'"])
77
- end
78
- end
79
-
80
- # if this gets set then it overwrites what would be the
81
- # rubyforge default. If rubyforge project is not set then use
82
- # name. If rubyforge project and name are set, but they are
83
- # different then assume that name is a subproject of the
84
- # rubyforge project
85
- def remote_root
86
- if rubyforge_project.nil? or
87
- rubyforge_project == name then
88
- return RUBYFORGE_ROOT + "#{name}/"
89
- else
90
- return RUBYFORGE_ROOT + "#{rubyforge_project}/#{name}/"
91
- end
92
- end
93
-
94
- # rdoc files is the same as what would be generated during gem
95
- # installation. That is, everything in the require paths plus
96
- # the rdoc_extra_files
97
- #
98
- def rdoc_files
99
- flist = extra_rdoc_files.dup
100
- @spec.require_paths.each do |rp|
101
- flist << FileList["#{rp}/**/*.rb"]
102
- end
103
- flist.flatten.uniq
104
- end
105
-
106
- # calculate the remote directories
107
- def remote_root_location
108
- "#{remote_user}@#{remote_host}:#{remote_root}"
109
- end
110
-
111
- def remote_rdoc_location
112
- remote_root_location + @remote_rdoc_dir
113
- end
114
-
115
- def remote_coverage_location
116
- remote_root_loation + @remote_coverage_dir
117
- end
118
-
119
- def remote_site_location
120
- remote_root_location + @remote_site_dir
121
- end
122
-
123
- # we delegate any other calls to spec
124
- def method_missing(method_id,*params,&block)
125
- @spec.send method_id, *params, &block
126
- end
127
- end
128
- end
@@ -1,40 +0,0 @@
1
- #-----------------------------------------------------------------------
2
- # Try to load the given _library_ using the built-in require, but do not
3
- # raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
4
- # successfully loaded; returns +false+ otherwise.
5
- #-----------------------------------------------------------------------
6
- def try_require( lib )
7
- require lib
8
- true
9
- rescue LoadError
10
- false
11
- end
12
-
13
- #-----------------------------------------------------------------------
14
- # setup global constants so the task libs can make decisions based upon
15
- # the availability of other libraries.
16
- # - heel is a mongrel based webserver used to serve up files locally
17
- # - webby is a static site generation tool
18
- # - rubyforge is self explanatory
19
- #-----------------------------------------------------------------------
20
- %w(heel webby rubyforge).each do |lib|
21
- Object.instance_eval { const_set "HAVE_#{lib.upcase}", try_require(lib) }
22
- end
23
-
24
- #-----------------------------------------------------------------------
25
- # load all the extra tasks for the project and setup the default task
26
- # the test:default is set by the spec or by the testunit library.
27
- #-----------------------------------------------------------------------
28
- FileList["tasks/*.rake"].each { |tasklib| import tasklib }
29
-
30
- task :default => 'test:default'
31
-
32
- #-----------------------------------------------------------------------
33
- # update the top level clobber task to depend on all possible sub-level
34
- # tasks that have a name like ':clobber' in other namespaces
35
- #-----------------------------------------------------------------------
36
- Rake.application.tasks.each do |t|
37
- if t.name =~ /:clobber/ then
38
- task :clobber => [t.name]
39
- end
40
- end