rabal 0.2.3 → 0.3.3

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 (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
@@ -0,0 +1,52 @@
1
+ require 'tasks/config'
2
+
3
+ #-----------------------------------------------------------------------
4
+ # Rubyforge additions to the task library
5
+ #-----------------------------------------------------------------------
6
+ if rf_conf = Configuration.for_if_exist?("rubyforge") then
7
+
8
+ abort("rubyforge gem not installed 'gem install rubyforge'") unless Utils.try_require('rubyforge')
9
+
10
+ proj_conf = Configuration.for('project')
11
+
12
+ namespace :dist do
13
+ desc "Release files to rubyforge"
14
+ task :rubyforge => [:clean, :package] do
15
+
16
+ rubyforge = RubyForge.new
17
+
18
+ config = {}
19
+ config["release_notes"] = proj_conf.description
20
+ config["release_changes"] = Utils.release_notes_from(proj_conf.history)[Rabal::VERSION]
21
+ config["Prefomatted"] = true
22
+
23
+ rubyforge.configure config
24
+
25
+ # make sure this release doesn't already exist
26
+ releases = rubyforge.autoconfig['release_ids']
27
+ if releases.has_key?(Rabal::GEM_SPEC.name) and releases[Rabal::GEM_SPEC.name][Rabal::VERSION] then
28
+ abort("Release #{Rabal::VERSION} already exists! Unable to release.")
29
+ end
30
+
31
+
32
+ puts "Uploading to rubyforge..."
33
+ files = FileList[File.join("pkg","#{Rabal::GEM_SPEC.name}-#{Rabal::VERSION}*.*")].to_a
34
+ rubyforge.login
35
+ rubyforge.add_release(Rabal::GEM_SPEC.rubyforge_project, Rabal::GEM_SPEC.name, Rabal::VERSION, *files)
36
+ puts "done."
37
+ end
38
+ end
39
+
40
+ namespace :announce do
41
+ desc "Post news of #{proj_conf.name} to #{rf_conf.project} on rubyforge"
42
+ task :rubyforge do
43
+ info = Utils.announcement
44
+ rubyforge = RubyForge.new
45
+ rubyforge.login
46
+ rubyforge.configure
47
+ rubyforge.post_news(rf_conf.project, info[:subject], "#{info[:title]}\n\n#{info[:urls]}\n\n#{info[:release_notes]}")
48
+ puts "Posted to rubyforge"
49
+ end
50
+
51
+ end
52
+ end
@@ -0,0 +1,80 @@
1
+ require 'rabal/version'
2
+
3
+ #-------------------------------------------------------------------------------
4
+ # Additions to the Configuration class that are useful
5
+ #-------------------------------------------------------------------------------
6
+ class Configuration
7
+ class << self
8
+ def exist?( name )
9
+ Configuration::Table.has_key?( name )
10
+ end
11
+
12
+ def for_if_exist?( name )
13
+ if self.exist?( name ) then
14
+ self.for( name )
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ #-------------------------------------------------------------------------------
21
+ # some useful utilitiy methods for the tasks
22
+ #-------------------------------------------------------------------------------
23
+ module Utils
24
+ class << self
25
+
26
+ # Try to load the given _library_ using the built-in require, but do not
27
+ # raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
28
+ # successfully loaded; returns +false+ otherwise.
29
+ #
30
+ def try_require( lib )
31
+ require lib
32
+ true
33
+ rescue LoadError
34
+ false
35
+ end
36
+
37
+ # partition an rdoc file into sections, and return the text of the section
38
+ # given.
39
+ def section_of(file, section_name)
40
+ File.read(file).split(/^(?==)/).each do |section|
41
+ lines = section.split("\n")
42
+ return lines[1..-1].join("\n").strip if lines.first =~ /#{section_name}/i
43
+ end
44
+ nil
45
+ end
46
+
47
+ # Get an array of all the changes in the application for a particular
48
+ # release. This is done by looking in the history file and grabbing the
49
+ # information for the most recent release. The history file is assumed to
50
+ # be in RDoc format and version release are 2nd tier sections separated by
51
+ # '== Version X.Y.Z'
52
+ #
53
+ # returns:: A hash of notes keyed by version number
54
+ #
55
+ def release_notes_from(history_file)
56
+ releases = {}
57
+ File.read(history_file).split(/^(?==)/).each do |section|
58
+ lines = section.split("\n")
59
+ md = %r{Version ((\w+\.)+\w+)}.match(lines.first)
60
+ next unless md
61
+ releases[md[1]] = lines[1..-1].join("\n").strip
62
+ end
63
+ return releases
64
+ end
65
+
66
+ # return a hash of useful information for the latest release
67
+ # urls, subject, title, description and latest release notes
68
+ #
69
+ def announcement
70
+ cfg = Configuration.for("project")
71
+ {
72
+ :subject => "#{cfg.name} #{Rabal::VERSION} Released",
73
+ :title => "#{cfg.name} version #{Rabal::VERSION} has been released.",
74
+ :urls => "#{cfg.homepage}",
75
+ :description => "#{cfg.description.rstrip}",
76
+ :release_notes => Utils.release_notes_from(cfg.history)[Rabal::VERSION].rstrip
77
+ }
78
+ end
79
+ end
80
+ end # << self
metadata CHANGED
@@ -1,28 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
5
- platform: ""
4
+ version: 0.3.3
5
+ platform: ruby
6
6
  authors:
7
7
  - Jeremy Hinegardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-10 00:00:00 -07:00
13
- default_executable: rabal
12
+ date: 2008-09-14 00:00:00 -06:00
13
+ default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: configuration
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.5
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.1
34
+ version:
15
35
  - !ruby/object:Gem::Dependency
16
36
  name: main
37
+ type: :runtime
17
38
  version_requirement:
18
39
  version_requirements: !ruby/object:Gem::Requirement
19
40
  requirements:
20
41
  - - ">="
21
42
  - !ruby/object:Gem::Version
22
- version: 2.8.0
43
+ version: 2.8.1
23
44
  version:
24
45
  - !ruby/object:Gem::Dependency
25
46
  name: gem_plugin
47
+ type: :runtime
26
48
  version_requirement:
27
49
  version_requirements: !ruby/object:Gem::Requirement
28
50
  requirements:
@@ -32,6 +54,7 @@ dependencies:
32
54
  version:
33
55
  - !ruby/object:Gem::Dependency
34
56
  name: highline
57
+ type: :runtime
35
58
  version_requirement:
36
59
  version_requirements: !ruby/object:Gem::Requirement
37
60
  requirements:
@@ -39,41 +62,28 @@ dependencies:
39
62
  - !ruby/object:Gem::Version
40
63
  version: 1.2.9
41
64
  version:
42
- description: Ruby Architecture for Building Applications and Libraries. Rabal is a commandline application for bootstrapping, packaging and distributing ruby projects.
65
+ - !ruby/object:Gem::Dependency
66
+ name: fattr
67
+ type: :runtime
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 1.0.3
74
+ version:
75
+ description: Rabal is the Ruby Architecture for Building Applications and Libraries. Taking ideas from Haskell's Cabal, the Hoe and Rubyforge projects, rabal is a generalised project generation tool for initial creation of the files and directories considered necessary in any ruby project.
43
76
  email: jeremy@hinegardner.org
44
77
  executables:
45
78
  - rabal
46
79
  extensions: []
47
80
 
48
81
  extra_rdoc_files:
49
- - CHANGES
50
- - COPYING
51
- - LICENSE
52
- - Rakefile
53
82
  - README
54
83
  - README.PLUGIN
55
- files:
56
- - spec/action_tree_spec.rb
57
- - spec/application_spec.rb
58
- - spec/bin_plugin_spec.rb
59
- - spec/core_plugin_spec.rb
60
- - spec/directory_tree_spec.rb
61
- - spec/file_tree_spec.rb
62
- - spec/license_plugin_spec.rb
63
- - spec/plugin_tree_spec.rb
64
- - spec/project_tree_spec.rb
65
- - spec/spec_helper.rb
66
- - spec/spec_plugin_spec.rb
67
- - spec/test_plugin_spec.rb
68
- - spec/tree_spec.rb
69
- - spec/utils_spec.rb
70
- - spec/version_spec.rb
71
- - CHANGES
72
- - COPYING
84
+ - HISTORY
73
85
  - LICENSE
74
- - Rakefile
75
- - README
76
- - README.PLUGIN
86
+ - COPYING
77
87
  - lib/rabal/action_tree.rb
78
88
  - lib/rabal/application.rb
79
89
  - lib/rabal/directory_tree.rb
@@ -94,30 +104,71 @@ files:
94
104
  - lib/rabal/plugin.rb
95
105
  - lib/rabal/plugin_tree.rb
96
106
  - lib/rabal/project_tree.rb
97
- - lib/rabal/specification.rb
98
107
  - lib/rabal/tree.rb
99
108
  - lib/rabal/usage.rb
100
109
  - lib/rabal/util.rb
101
110
  - lib/rabal/version.rb
102
111
  - lib/rabal.rb
112
+ files:
113
+ - bin/rabal
114
+ - lib/rabal/action_tree.rb
115
+ - lib/rabal/application.rb
116
+ - lib/rabal/directory_tree.rb
117
+ - lib/rabal/error.rb
118
+ - lib/rabal/file_tree.rb
119
+ - lib/rabal/gemspec.rb
120
+ - lib/rabal/init.rb
121
+ - lib/rabal/logger.rb
122
+ - lib/rabal/plugin/bin.rb
123
+ - lib/rabal/plugin/core.rb
124
+ - lib/rabal/plugin/ext.rb
125
+ - lib/rabal/plugin/foundation.rb
126
+ - lib/rabal/plugin/license.rb
127
+ - lib/rabal/plugin/rubyforge.rb
128
+ - lib/rabal/plugin/spec.rb
129
+ - lib/rabal/plugin/test.rb
130
+ - lib/rabal/plugin/website.rb
131
+ - lib/rabal/plugin.rb
132
+ - lib/rabal/plugin_tree.rb
133
+ - lib/rabal/project_tree.rb
134
+ - lib/rabal/tree.rb
135
+ - lib/rabal/usage.rb
136
+ - lib/rabal/util.rb
137
+ - lib/rabal/version.rb
138
+ - lib/rabal.rb
139
+ - spec/action_tree_spec.rb
140
+ - spec/application_spec.rb
141
+ - spec/bin_plugin_spec.rb
142
+ - spec/core_plugin_spec.rb
143
+ - spec/directory_tree_spec.rb
144
+ - spec/file_tree_spec.rb
145
+ - spec/license_plugin_spec.rb
146
+ - spec/plugin_tree_spec.rb
147
+ - spec/project_tree_spec.rb
148
+ - spec/spec_helper.rb
149
+ - spec/spec_plugin_spec.rb
150
+ - spec/test_plugin_spec.rb
151
+ - spec/tree_spec.rb
152
+ - spec/utils_spec.rb
153
+ - spec/version_spec.rb
103
154
  - resources/trees
104
155
  - resources/trees/bin
105
156
  - resources/trees/bin/rabal.project
106
157
  - resources/trees/core
107
- - resources/trees/core/CHANGES.erb
158
+ - resources/trees/core/gemspec.rb.erb
159
+ - resources/trees/core/HISTORY.erb
108
160
  - resources/trees/core/lib
109
161
  - resources/trees/core/lib/rabal.project
110
- - resources/trees/core/lib/rabal.project/gemspec.rb.erb
111
- - resources/trees/core/lib/rabal.project/specification.rb.erb
112
162
  - resources/trees/core/lib/rabal.project/version.rb.erb
113
163
  - resources/trees/core/lib/rabal.project.rb.erb
114
164
  - resources/trees/core/Rakefile.erb
115
165
  - resources/trees/core/README.erb
116
166
  - resources/trees/core/tasks
117
167
  - resources/trees/core/tasks/announce.rake.erb
168
+ - resources/trees/core/tasks/config.rb.erb
118
169
  - resources/trees/core/tasks/distribution.rake.erb
119
170
  - resources/trees/core/tasks/documentation.rake.erb
120
- - resources/trees/core/tasks/setup.rb.erb
171
+ - resources/trees/core/tasks/utils.rb.erb
121
172
  - resources/trees/ext
122
173
  - resources/trees/ext/ext
123
174
  - resources/trees/ext/ext/rabal.project
@@ -150,8 +201,19 @@ files:
150
201
  - resources/trees/website
151
202
  - resources/trees/website/tasks
152
203
  - resources/trees/website/tasks/site.rake.erb
153
- - resources/trees/website/website
154
- - bin/rabal
204
+ - README
205
+ - README.PLUGIN
206
+ - HISTORY
207
+ - LICENSE
208
+ - COPYING
209
+ - tasks/announce.rake
210
+ - tasks/distribution.rake
211
+ - tasks/documentation.rake
212
+ - tasks/rspec.rake
213
+ - tasks/rubyforge.rake
214
+ - tasks/config.rb
215
+ - tasks/utils.rb
216
+ - gemspec.rb
155
217
  has_rdoc: true
156
218
  homepage: http://copiousfreetime.rubyforge.org/rabal/
157
219
  post_install_message:
@@ -160,15 +222,13 @@ rdoc_options:
160
222
  - --inline-source
161
223
  - --main
162
224
  - README
163
- - --title
164
- - "'rabal -- A tool for bootstrapping project development'"
165
225
  require_paths:
166
226
  - lib
167
227
  required_ruby_version: !ruby/object:Gem::Requirement
168
228
  requirements:
169
229
  - - ">="
170
230
  - !ruby/object:Gem::Version
171
- version: 1.8.5
231
+ version: "0"
172
232
  version:
173
233
  required_rubygems_version: !ruby/object:Gem::Requirement
174
234
  requirements:
@@ -179,23 +239,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
239
  requirements: []
180
240
 
181
241
  rubyforge_project: copiousfreetime
182
- rubygems_version: 0.9.5
242
+ rubygems_version: 1.2.0
183
243
  signing_key:
184
244
  specification_version: 2
185
- summary: A tool for bootstrapping project development
186
- test_files:
187
- - spec/action_tree_spec.rb
188
- - spec/application_spec.rb
189
- - spec/bin_plugin_spec.rb
190
- - spec/core_plugin_spec.rb
191
- - spec/directory_tree_spec.rb
192
- - spec/file_tree_spec.rb
193
- - spec/license_plugin_spec.rb
194
- - spec/plugin_tree_spec.rb
195
- - spec/project_tree_spec.rb
196
- - spec/spec_helper.rb
197
- - spec/spec_plugin_spec.rb
198
- - spec/test_plugin_spec.rb
199
- - spec/tree_spec.rb
200
- - spec/utils_spec.rb
201
- - spec/version_spec.rb
245
+ summary: Rabal is the Ruby Architecture for Building Applications and Libraries
246
+ test_files: []
247
+
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # make sure our project's ./lib directory is added to the ruby search path
2
- $: << File.join(File.dirname(__FILE__),"lib")
3
-
4
- require 'rubygems'
5
- require 'rake/gempackagetask'
6
- require 'rake/clean'
7
- require 'rake/rdoctask'
8
- require 'rake/contrib/sshpublisher'
9
-
10
- require 'rabal'
11
-
12
- load 'tasks/setup.rb'
@@ -1,128 +0,0 @@
1
- require 'rubygems'
2
- require 'rubygems/specification'
3
- require 'rake'
4
-
5
- module Rabal
6
- # Add some additional items to Gem::Specification
7
- # A Rabal::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 extra_rdoc_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