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.
- data/{CHANGES → HISTORY} +23 -7
- data/README +96 -66
- data/bin/rabal +6 -7
- data/gemspec.rb +47 -0
- data/lib/rabal.rb +63 -19
- data/lib/rabal/application.rb +4 -4
- data/lib/rabal/plugin/foundation.rb +4 -3
- data/lib/rabal/version.rb +16 -14
- data/resources/trees/bin/rabal.project +7 -8
- data/resources/trees/core/HISTORY.erb +4 -0
- data/resources/trees/core/README.erb +6 -0
- data/resources/trees/core/Rakefile.erb +53 -7
- data/resources/trees/core/gemspec.rb.erb +48 -0
- data/resources/trees/core/lib/rabal.project.rb.erb +52 -20
- data/resources/trees/core/lib/rabal.project/version.rb.erb +21 -13
- data/resources/trees/core/tasks/announce.rake.erb +36 -54
- data/resources/trees/core/tasks/config.rb.erb +107 -0
- data/resources/trees/core/tasks/distribution.rake.erb +19 -13
- data/resources/trees/core/tasks/documentation.rake.erb +25 -19
- data/resources/trees/core/tasks/utils.rb.erb +80 -0
- data/resources/trees/ext/tasks/extension.rake.erb +42 -10
- data/resources/trees/rubyforge/tasks/rubyforge.rake.erb +48 -40
- data/resources/trees/spec/spec/rabal.project_spec.rb.erb +10 -10
- data/resources/trees/spec/tasks/rspec.rake.erb +23 -18
- data/resources/trees/test/tasks/testunit.rake.erb +14 -9
- data/resources/trees/test/test/rabal.project_test.rb.erb +6 -6
- data/resources/trees/website/tasks/site.rake.erb +5 -5
- data/spec/application_spec.rb +3 -3
- data/spec/bin_plugin_spec.rb +1 -1
- data/spec/core_plugin_spec.rb +1 -1
- data/spec/license_plugin_spec.rb +1 -1
- data/spec/plugin_tree_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -6
- data/spec/spec_plugin_spec.rb +1 -1
- data/spec/test_plugin_spec.rb +1 -1
- data/tasks/announce.rake +40 -0
- data/tasks/config.rb +99 -0
- data/tasks/distribution.rake +45 -0
- data/tasks/documentation.rake +31 -0
- data/tasks/rspec.rake +29 -0
- data/tasks/rubyforge.rake +52 -0
- data/tasks/utils.rb +80 -0
- metadata +105 -59
- data/Rakefile +0 -12
- data/lib/rabal/specification.rb +0 -128
- data/resources/trees/core/CHANGES.erb +0 -4
- data/resources/trees/core/lib/rabal.project/gemspec.rb.erb +0 -51
- data/resources/trees/core/lib/rabal.project/specification.rb.erb +0 -128
- data/resources/trees/core/tasks/setup.rb.erb +0 -40
data/{CHANGES → HISTORY}
RENAMED
@@ -1,24 +1,40 @@
|
|
1
|
-
=
|
2
|
-
|
1
|
+
= Release Notes
|
2
|
+
== Version 0.3.3
|
3
|
+
|
4
|
+
* update rubyforge templates to fix bugs
|
5
|
+
* update announce templates to include gem install instructions
|
6
|
+
|
7
|
+
== Version 0.3.2
|
8
|
+
|
9
|
+
* fix extension templates
|
10
|
+
* update gemspec to use extension Configuration
|
11
|
+
|
12
|
+
== Version 0.3.0
|
13
|
+
|
14
|
+
* rework templates to use Configuration and pull gemspec out of the project
|
15
|
+
code itself
|
16
|
+
* switch from attributes to fattr
|
17
|
+
|
18
|
+
== Version 0.2.3
|
3
19
|
|
4
20
|
* fix compatibility bug with main 2.8.0
|
5
21
|
|
6
|
-
|
22
|
+
== Version 0.2.2
|
7
23
|
|
8
24
|
* put in missing init.rb stub to avoid GemPlugin confusion
|
9
25
|
|
10
|
-
|
26
|
+
== Version 0.2.1
|
11
27
|
|
12
28
|
* fix bug wherein some templates get lost for subdirectories when multiple modules are in use.
|
13
29
|
|
14
|
-
|
30
|
+
== Version 0.2.0
|
15
31
|
|
16
32
|
* create conditional tasks based upon the availability of libraries (webby, heel, rubyforge)
|
17
33
|
* added in site plugin and associated tasks
|
18
34
|
* moved all rake tasks to .rake files
|
19
35
|
* added tasks to show website and rdoc if heel is installed
|
20
36
|
|
21
|
-
|
37
|
+
== Version 0.1.0
|
22
38
|
|
23
39
|
* Support for building ruby C extensions
|
24
40
|
* Highline prompting for arguments missed on the commandline
|
@@ -27,6 +43,6 @@
|
|
27
43
|
* rubyforge support
|
28
44
|
* rspec and ruby unit templates
|
29
45
|
|
30
|
-
|
46
|
+
== Version 0.0.1
|
31
47
|
|
32
48
|
* Initial public release
|
data/README
CHANGED
@@ -28,137 +28,165 @@ For example, the +core+ plugin that is the base main required plugin of
|
|
28
28
|
rabal is defined by the parameters +author+ and +email+ and the
|
29
29
|
following directory/file template:
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
./core/CHANGES.erb
|
32
|
+
./core/lib/rabal.project
|
33
|
+
./core/lib/rabal.project/gemspec.rb.erb
|
34
|
+
./core/lib/rabal.project/specification.rb.erb
|
35
|
+
./core/lib/rabal.project/version.rb.erb
|
36
|
+
./core/lib/rabal.project.rb.erb
|
37
|
+
./core/Rakefile.erb
|
38
|
+
./core/README.erb
|
39
|
+
./core/tasks/announce.rake.erb
|
40
|
+
./core/tasks/distribution.rake.erb
|
41
|
+
./core/tasks/documentation.rake.erb
|
42
|
+
./core/tasks/setup.rb.erb
|
40
43
|
|
41
44
|
From this template with 'example' as the project the following structure
|
42
45
|
was created:
|
43
46
|
|
44
|
-
./example/
|
45
|
-
./example/lib
|
46
|
-
./example/lib/example
|
47
|
-
./example/lib/example.rb
|
48
|
-
./example/lib/example/version.rb
|
49
47
|
./example/CHANGES
|
50
|
-
./example/
|
51
|
-
./example/
|
48
|
+
./example/lib/example/gemspec.rb
|
49
|
+
./example/lib/example/specification.rb
|
50
|
+
./example/lib/example/version.rb
|
51
|
+
./example/lib/example.rb
|
52
|
+
./example/LICENSE
|
52
53
|
./example/Rakefile
|
54
|
+
./example/README
|
55
|
+
./example/tasks/announce.rake
|
56
|
+
./example/tasks/distribution.rake
|
57
|
+
./example/tasks/documentation.rake
|
58
|
+
./example/tasks/setup.rb
|
53
59
|
|
54
60
|
Rabal currently ships with plugins for:
|
55
61
|
|
56
|
-
*
|
62
|
+
* bin - command line application
|
63
|
+
* core - core functionality and baseline information need by every project
|
64
|
+
* ext - ruby C extensions
|
57
65
|
* license - indicate under what license your project is released. Has
|
58
66
|
templates for BSD, GPL, LGPL, MIT and Ruby License
|
59
|
-
* bin - command line application
|
60
67
|
* spec - an RSpec starting point
|
61
68
|
* test - a Test::Unit starting point
|
69
|
+
* website - a website starting point (using webby framework)
|
62
70
|
|
63
71
|
You are highly encouraged to write your own plugins and distribute them.
|
64
72
|
See the README.PLUGIN for information on how to develop your own.
|
65
73
|
|
66
74
|
== EXAMPLE
|
67
75
|
|
68
|
-
% rabal --use-all
|
76
|
+
% rabal --use-all myproj
|
77
|
+
Author of the project (full name) ? Ruby Programmer
|
78
|
+
Email address of the author ? rp@example.com
|
79
|
+
Name of the resulting .so file (e.g. myext) ? myprojext
|
80
|
+
Check for the existence of this method in the library ? main
|
81
|
+
Library to link against (e.g. libsomething) ? libmyproj
|
82
|
+
Flavor of License for your project: BSD, GPL, LGPL, MIT, RUBY ? RUBY
|
69
83
|
[...]
|
70
84
|
% find ./myproj
|
71
|
-
./myproj
|
72
|
-
./myproj/
|
85
|
+
./myproj
|
86
|
+
./myproj/bin
|
87
|
+
./myproj/bin/myproj
|
88
|
+
./myproj/CHANGES
|
73
89
|
./myproj/COPYING
|
74
|
-
./myproj/
|
90
|
+
./myproj/ext
|
91
|
+
./myproj/ext/myproj
|
92
|
+
./myproj/ext/myproj/ext
|
93
|
+
./myproj/ext/myproj/ext/mkrf_conf.rb
|
75
94
|
./myproj/lib
|
76
95
|
./myproj/lib/myproj
|
96
|
+
./myproj/lib/myproj/gemspec.rb
|
97
|
+
./myproj/lib/myproj/specification.rb
|
77
98
|
./myproj/lib/myproj/version.rb
|
78
99
|
./myproj/lib/myproj.rb
|
100
|
+
./myproj/LICENSE
|
79
101
|
./myproj/Rakefile
|
80
|
-
./myproj/
|
81
|
-
./myproj/CHANGES
|
102
|
+
./myproj/README
|
82
103
|
./myproj/spec
|
83
|
-
./myproj/spec/spec_helper.rb
|
84
104
|
./myproj/spec/myproj_spec.rb
|
85
|
-
./myproj/
|
86
|
-
./myproj/
|
105
|
+
./myproj/spec/spec_helper.rb
|
106
|
+
./myproj/tasks
|
107
|
+
./myproj/tasks/announce.rake
|
108
|
+
./myproj/tasks/distribution.rake
|
109
|
+
./myproj/tasks/documentation.rake
|
110
|
+
./myproj/tasks/extension.rake
|
111
|
+
./myproj/tasks/rspec.rake
|
112
|
+
./myproj/tasks/rubyforge.rake
|
113
|
+
./myproj/tasks/setup.rb
|
114
|
+
./myproj/tasks/site.rake
|
115
|
+
./myproj/tasks/testunit.rake
|
116
|
+
./myproj/test
|
117
|
+
./myproj/test/myproj_test.rb
|
118
|
+
./myproj/test/test_helper.rb
|
119
|
+
|
87
120
|
|
88
121
|
== SYNOPSIS
|
89
122
|
|
90
123
|
NAME
|
91
|
-
rabal v0.
|
124
|
+
rabal v0.2.3
|
92
125
|
|
93
126
|
SYNOPSIS
|
94
127
|
rabal project [options]+
|
95
128
|
|
96
129
|
DESCRIPTION
|
97
|
-
Ruby Architecture for Building Applications and Libraries.
|
98
|
-
|
99
|
-
|
100
|
-
distributing ruby projects.
|
130
|
+
Ruby Architecture for Building Applications and Libraries. Rabal is a
|
131
|
+
commandline application for bootstrapping, packaging and distributing
|
132
|
+
ruby projects.
|
101
133
|
|
102
134
|
GLOBAL OPTIONS
|
103
|
-
--directory=directory, -d
|
104
|
-
|
105
|
-
--help, -h
|
106
|
-
--logfile=logfile, -l
|
107
|
-
--use-all, -a
|
108
|
-
--verbosity=verbosity, -v
|
109
|
-
|
110
|
-
--version, -V - Display the version number
|
135
|
+
--directory=directory, -d - The directory in which to
|
136
|
+
create the project directory.
|
137
|
+
--help, -h
|
138
|
+
--logfile=logfile, -l - The location of the logfile
|
139
|
+
--use-all, -a - Use all available plugins.
|
140
|
+
--verbosity=verbosity, -v - One of : DEBUG, INFO, WARN,
|
141
|
+
ERROR, FATAL, ANY
|
111
142
|
|
112
143
|
AVAILABLE MODULES
|
113
144
|
Force any module to be used by giving the --use-[modulename] option.
|
114
145
|
Modules with a '*' next to them are always used.
|
115
146
|
|
116
|
-
bin (/rabal/bin)
|
117
|
-
*core (/rabal/core)
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
147
|
+
bin (/rabal/bin) - Add a commandline application.
|
148
|
+
*core (/rabal/core) - The core functionality and
|
149
|
+
baseline information needed by
|
150
|
+
every project.
|
151
|
+
ext (/rabal/ext) - Add a ruby extension
|
152
|
+
*license (/rabal/license) - Indicate under what license your
|
153
|
+
project is released.
|
154
|
+
rubyforge (/rabal/rubyforge) - Add rubyforge support
|
155
|
+
spec (/rabal/spec) - Add an RSpec framework.
|
156
|
+
test (/rabal/test) - Add a Test::Unit framework.
|
157
|
+
website (/rabal/website) - Add a website for your
|
158
|
+
application.
|
126
159
|
|
127
160
|
MODULE OPTIONS - CORE
|
128
|
-
--core-author=[core-author]
|
129
|
-
|
161
|
+
--core-author=[core-author] - Author of the project (full
|
162
|
+
name)
|
163
|
+
--core-email=[core-email] - Email address of the author
|
130
164
|
|
131
165
|
MODULE OPTIONS - LICENSE
|
132
|
-
--license-flavor=[license-flavor]
|
133
|
-
|
134
|
-
|
135
|
-
MODULE OPTIONS - SPEC
|
136
|
-
No options available
|
137
|
-
|
138
|
-
MODULE OPTIONS - TEST
|
139
|
-
No options available
|
166
|
+
--license-flavor=[license-flavor] - Flavor of License for your
|
167
|
+
project: BSD, GPL, LGPL, MIT,
|
168
|
+
RUBY
|
140
169
|
|
141
170
|
AUTHOR
|
142
|
-
Jeremy Hinegardner
|
171
|
+
Jeremy Hinegardner
|
143
172
|
|
173
|
+
|
144
174
|
|
145
175
|
== REQUIREMENTS
|
176
|
+
|
146
177
|
=== For running
|
147
178
|
* main
|
148
179
|
* gem_plugin
|
180
|
+
* rake
|
149
181
|
|
150
182
|
=== For development
|
151
|
-
* rake
|
152
183
|
* rspec
|
153
184
|
* rcov
|
154
185
|
* mktemp
|
155
186
|
|
156
187
|
== BUGS
|
157
188
|
|
158
|
-
|
159
|
-
are guaranteed to be bugs. In fact, there are some known options that
|
160
|
-
currently do nothing. Please report all bugs in the {rubyforge bug
|
161
|
-
tracker}[http://rubyforge.org/tracker/?atid=14326&group_id=3707&func=browse]
|
189
|
+
Please report all bugs in the {rubyforge bug tracker}[http://rubyforge.org/tracker/?atid=14326&group_id=3707&func=browse]
|
162
190
|
|
163
191
|
== CREDITS
|
164
192
|
|
@@ -171,3 +199,5 @@ rabal is inspired by:
|
|
171
199
|
== LICENSE:
|
172
200
|
|
173
201
|
Released under the same conditions as Ruby. See LICENSE and COPYING
|
202
|
+
|
203
|
+
Code Generated by Rabal is licensed under the conditions of your project
|
data/bin/rabal
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
#--
|
4
|
+
# Copyright (c) 2007, 2008 Jeremy Hinegardner
|
5
|
+
# All rights reserved. See LICENSE and/or COPYING for details
|
6
|
+
#++
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
rescue LoadError => e
|
8
|
-
$: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
|
9
|
-
retry
|
10
|
-
end
|
8
|
+
$: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
|
9
|
+
require 'rabal'
|
11
10
|
|
12
11
|
Rabal.application.run(ARGV)
|
data/gemspec.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rabal/version'
|
3
|
+
require 'tasks/config'
|
4
|
+
|
5
|
+
Rabal::GEM_SPEC = Gem::Specification.new do |spec|
|
6
|
+
proj = Configuration.for('project')
|
7
|
+
spec.name = proj.name
|
8
|
+
spec.version = Rabal::VERSION
|
9
|
+
|
10
|
+
spec.author = proj.author
|
11
|
+
spec.email = proj.email
|
12
|
+
spec.homepage = proj.homepage
|
13
|
+
spec.summary = proj.summary
|
14
|
+
spec.description = proj.description
|
15
|
+
spec.platform = Gem::Platform::RUBY
|
16
|
+
|
17
|
+
|
18
|
+
pkg = Configuration.for('packaging')
|
19
|
+
spec.files = pkg.files.all
|
20
|
+
spec.executables = pkg.files.bin.collect { |b| File.basename(b) }
|
21
|
+
|
22
|
+
# add dependencies here
|
23
|
+
spec.add_dependency("configuration", ">= 0.0.5")
|
24
|
+
spec.add_dependency("rake", ">= 0.8.1")
|
25
|
+
spec.add_dependency("main", ">= 2.8.1")
|
26
|
+
spec.add_dependency("gem_plugin", ">= 0.2.1")
|
27
|
+
spec.add_dependency("highline", ">= 1.2.9")
|
28
|
+
spec.add_dependency("fattr", ">= 1.0.3")
|
29
|
+
|
30
|
+
|
31
|
+
if rdoc = Configuration.for_if_exist?('rdoc') then
|
32
|
+
spec.has_rdoc = true
|
33
|
+
spec.extra_rdoc_files = pkg.files.rdoc
|
34
|
+
spec.rdoc_options = rdoc.options + [ "--main" , rdoc.main_page ]
|
35
|
+
else
|
36
|
+
spec.has_rdoc = false
|
37
|
+
end
|
38
|
+
|
39
|
+
if test = Configuration.for_if_exist?('testing') then
|
40
|
+
spec.test_files = test.files
|
41
|
+
end
|
42
|
+
|
43
|
+
if rf = Configuration.for_if_exist?('rubyforge') then
|
44
|
+
spec.rubyforge_project = rf.project
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
data/lib/rabal.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
require 'find'
|
2
3
|
require 'erb'
|
3
4
|
require 'logger'
|
@@ -7,26 +8,71 @@ require 'rubygems'
|
|
7
8
|
require 'main'
|
8
9
|
|
9
10
|
module Rabal
|
11
|
+
# The root directory of the project is considered to be the parent directory
|
12
|
+
# of the 'lib' directory.
|
13
|
+
#
|
14
|
+
# returns:: [String] The full expanded path of the parent directory of 'lib'
|
15
|
+
# going up the path from the current file. Trailing
|
16
|
+
# File::SEPARATOR is guaranteed.
|
17
|
+
#
|
18
|
+
def self.root_dir
|
19
|
+
unless @root_dir
|
20
|
+
path_parts = ::File.expand_path(__FILE__).split(::File::SEPARATOR)
|
21
|
+
lib_index = path_parts.rindex("lib")
|
22
|
+
@root_dir = path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
|
23
|
+
end
|
24
|
+
return @root_dir
|
25
|
+
end
|
26
|
+
|
27
|
+
# returns:: [String] The full expanded path of the +config+ directory
|
28
|
+
# below _root_dir_. All parameters passed in are joined onto the
|
29
|
+
# result. Trailing File::SEPARATOR is guaranteed if _args_ are
|
30
|
+
# *not* present.
|
31
|
+
#
|
32
|
+
def self.config_path(*args)
|
33
|
+
self.sub_path("config", *args)
|
34
|
+
end
|
35
|
+
|
36
|
+
# returns:: [String] The full expanded path of the +resource+ directory below
|
37
|
+
# _root_dir_. All parameters passed in are joined onto the
|
38
|
+
# result. Trailing File::SEPARATOR is guaranteed if
|
39
|
+
# _*args_ are *not* present.
|
40
|
+
#
|
41
|
+
def self.resource_path(*args)
|
42
|
+
self.sub_path("resources", *args)
|
43
|
+
end
|
44
|
+
|
45
|
+
# returns:: [String] The full expanded path of the +lib+ directory below
|
46
|
+
# _root_dir_. All parameters passed in are joined onto the
|
47
|
+
# result. Trailing File::SEPARATOR is guaranteed if
|
48
|
+
# _*args_ are *not* present.
|
49
|
+
#
|
50
|
+
def self.lib_path(*args)
|
51
|
+
self.sub_path("lib", *args)
|
52
|
+
end
|
10
53
|
|
11
|
-
|
12
|
-
|
13
|
-
|
54
|
+
def self.sub_path(sub,*args)
|
55
|
+
sp = ::File.join(root_dir, sub) + File::SEPARATOR
|
56
|
+
sp = ::File.join(sp, *args) if args
|
57
|
+
end
|
58
|
+
|
59
|
+
KNOWN_WORDS = {
|
14
60
|
"rabal.project" => lambda { |tree| tree.root.project_name }
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
61
|
+
}
|
62
|
+
|
63
|
+
#
|
64
|
+
# Module singleton methods, allow for accessing a single rabal
|
65
|
+
# application from anywhere
|
66
|
+
#
|
67
|
+
class << self
|
68
|
+
def application
|
69
|
+
@application ||= Rabal::Application.new
|
70
|
+
end
|
71
|
+
|
72
|
+
def application=(app)
|
73
|
+
@application = app
|
29
74
|
end
|
75
|
+
end
|
30
76
|
end
|
31
77
|
|
32
78
|
# require all the files
|
@@ -35,12 +81,10 @@ require 'rabal/application'
|
|
35
81
|
require 'rabal/directory_tree'
|
36
82
|
require 'rabal/error'
|
37
83
|
require 'rabal/file_tree'
|
38
|
-
require 'rabal/gemspec'
|
39
84
|
require 'rabal/logger'
|
40
85
|
require 'rabal/plugin'
|
41
86
|
require 'rabal/plugin_tree'
|
42
87
|
require 'rabal/project_tree'
|
43
|
-
require 'rabal/specification'
|
44
88
|
require 'rabal/tree'
|
45
89
|
require 'rabal/usage'
|
46
90
|
require 'rabal/util'
|