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/lib/rabal/application.rb
CHANGED
@@ -46,7 +46,7 @@ module Rabal
|
|
46
46
|
# only going to happen if run from outside a gem. Basically
|
47
47
|
# while Jeremy is testing.
|
48
48
|
if not plugin_manager.loaded?("rabal") then
|
49
|
-
plugin_manager.gems["rabal"] =
|
49
|
+
plugin_manager.gems["rabal"] = Rabal.root_dir
|
50
50
|
end
|
51
51
|
|
52
52
|
|
@@ -93,9 +93,9 @@ module Rabal
|
|
93
93
|
def main
|
94
94
|
return @main if @main
|
95
95
|
@main = Main.new(app_argv) {
|
96
|
-
|
97
|
-
description Rabal
|
98
|
-
author
|
96
|
+
|
97
|
+
description "Rabal is the Ruby Architecture for Building Applications and Libraries."
|
98
|
+
author "Jeremy Hinegardner <jeremy@hinegardner.org>"
|
99
99
|
version Rabal::VERSION
|
100
100
|
|
101
101
|
# Project, the whole reason rabal exists
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'gem_plugin'
|
2
2
|
require 'highline/import'
|
3
3
|
require 'rabal/logger'
|
4
|
+
require 'fattr'
|
4
5
|
|
5
6
|
module Rabal
|
6
7
|
module Plugin
|
@@ -35,7 +36,7 @@ module Rabal
|
|
35
36
|
|
36
37
|
# allows Plugin::Base to store the registration
|
37
38
|
# information in the class variable.
|
38
|
-
|
39
|
+
fattr :register_as => nil
|
39
40
|
|
40
41
|
# part of the mini DSL for describing a Plugin
|
41
42
|
def parameter(pname,description,block = nil)
|
@@ -58,8 +59,8 @@ module Rabal
|
|
58
59
|
@use_always = d
|
59
60
|
end
|
60
61
|
|
61
|
-
|
62
|
-
|
62
|
+
fattr :description => "I Need a Description"
|
63
|
+
fattr :register_path
|
63
64
|
|
64
65
|
def use_name
|
65
66
|
name.split("::").last.dashify
|
data/lib/rabal/version.rb
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
require 'rabal'
|
2
2
|
|
3
3
|
module Rabal
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
module Version
|
5
|
+
MAJOR = 0
|
6
|
+
MINOR = 3
|
7
|
+
BUILD = 3
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
9
|
+
def to_a
|
10
|
+
[MAJOR, MINOR, BUILD]
|
11
|
+
end
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
def to_s
|
14
|
+
to_a.join(".")
|
15
|
+
end
|
16
|
+
module_function :to_a
|
17
|
+
module_function :to_s
|
18
|
+
|
19
|
+
STRING = Version.to_s
|
20
|
+
end
|
21
|
+
VERSION = Version.to_s
|
20
22
|
end
|
21
23
|
|
@@ -1,12 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
3
|
+
#--
|
4
|
+
# Copyright (c) <%= Date.today.year %> <% author %>
|
5
|
+
# All rights reserved. See LICENSE and/or COPYING for details.
|
6
|
+
#++
|
7
|
+
|
8
|
+
$: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
|
9
|
+
require '<%= project_name %>'
|
11
10
|
|
12
11
|
puts "I am the killer app <%= project_name %> at version #{<%= project_name.camelize %>::VERSION}!"
|
@@ -1,14 +1,60 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) <%= Date.today.year %> <%= author %>
|
3
|
+
# All rights reserved. See LICENSE and/or COPYING for details.
|
4
|
+
#++
|
3
5
|
|
6
|
+
#-------------------------------------------------------------------------------
|
7
|
+
# make sure our project's top level directory and the lib directory are added to
|
8
|
+
# the ruby search path.
|
9
|
+
#-------------------------------------------------------------------------------
|
10
|
+
$: << File.expand_path(File.join(File.dirname(__FILE__),"lib"))
|
11
|
+
$: << File.expand_path(File.dirname(__FILE__))
|
12
|
+
|
13
|
+
|
14
|
+
#-------------------------------------------------------------------------------
|
15
|
+
# load the global project configuration and add in the top level clean and
|
16
|
+
# clobber tasks so that other tasks can utilize those constants if necessary
|
17
|
+
# This loads up the defaults for the whole project configuration
|
18
|
+
#-------------------------------------------------------------------------------
|
4
19
|
require 'rubygems'
|
5
|
-
require '
|
20
|
+
require 'tasks/config.rb'
|
6
21
|
require 'rake/clean'
|
7
|
-
require 'rake/rdoctask'
|
8
|
-
require 'rake/contrib/sshpublisher'
|
9
22
|
|
10
|
-
|
23
|
+
#-------------------------------------------------------------------------------
|
24
|
+
# Main configuration for the project, these overwrite the items that are in
|
25
|
+
# tasks/config.rb
|
26
|
+
#-------------------------------------------------------------------------------
|
27
|
+
require '<%= project_name %>'
|
28
|
+
Configuration.for("project") {
|
29
|
+
name "<%= project_name %>"
|
30
|
+
version <%= project_name.camelize %>::VERSION
|
31
|
+
author "<%= author %>"
|
32
|
+
email "<%= email %>"
|
33
|
+
homepage "http://<%= project_name %>.rubyforge.org/"
|
34
|
+
}
|
11
35
|
|
12
|
-
|
36
|
+
#-------------------------------------------------------------------------------
|
37
|
+
# load up all the project tasks and setup the default task to be the
|
38
|
+
# test:default task.
|
39
|
+
#-------------------------------------------------------------------------------
|
40
|
+
Configuration.for("packaging").files.tasks.each do |tasklib|
|
41
|
+
import tasklib
|
42
|
+
end
|
43
|
+
task :default => 'test:default'
|
13
44
|
|
45
|
+
#-------------------------------------------------------------------------------
|
46
|
+
# Finalize the loading of all pending imports and update the top level clobber
|
47
|
+
# task to depend on all possible sub-level tasks that have a name like
|
48
|
+
# ':clobber' in other namespaces. This allows us to say:
|
49
|
+
#
|
50
|
+
# rake clobber
|
51
|
+
#
|
52
|
+
# and it will get everything.
|
53
|
+
#-------------------------------------------------------------------------------
|
54
|
+
Rake.application.load_imports
|
55
|
+
Rake.application.tasks.each do |t|
|
56
|
+
if t.name =~ /:clobber/ then
|
57
|
+
task :clobber => [t.name]
|
58
|
+
end
|
59
|
+
end
|
14
60
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require '<%= project_name %>/version'
|
3
|
+
require 'tasks/config'
|
4
|
+
|
5
|
+
<%= project_name.camelize %>::GEM_SPEC = Gem::Specification.new do |spec|
|
6
|
+
proj = Configuration.for('project')
|
7
|
+
spec.name = proj.name
|
8
|
+
spec.version = <%= project_name.camelize %>::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("rake", ">= 0.8.1")
|
24
|
+
spec.add_dependency("configuration", ">= 0.0.5")
|
25
|
+
|
26
|
+
if ext_conf = Configuration.for_if_exist?("extension") then
|
27
|
+
spec.extensions << ext_conf.configs
|
28
|
+
spec.extensions.flatten!
|
29
|
+
spec.require_paths << "ext"
|
30
|
+
end
|
31
|
+
|
32
|
+
if rdoc = Configuration.for_if_exist?('rdoc') then
|
33
|
+
spec.has_rdoc = true
|
34
|
+
spec.extra_rdoc_files = pkg.files.rdoc
|
35
|
+
spec.rdoc_options = rdoc.options + [ "--main" , rdoc.main_page ]
|
36
|
+
else
|
37
|
+
spec.has_rdoc = false
|
38
|
+
end
|
39
|
+
|
40
|
+
if test = Configuration.for_if_exist?('testing') then
|
41
|
+
spec.test_files = test.files
|
42
|
+
end
|
43
|
+
|
44
|
+
if rf = Configuration.for_if_exist?('rubyforge') then
|
45
|
+
spec.rubyforge_project = rf.project
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -1,25 +1,57 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) <%= Date.today.year %> <%= author %>
|
3
|
+
# All rights reserved. See LICENSE and/or COPYING for details.
|
4
|
+
#++
|
5
|
+
|
1
6
|
module <%= project_name.camelize %>
|
2
|
-
|
3
|
-
ROOT_DIR = File.expand_path(File.join(File.dirname(__FILE__),".."))
|
4
|
-
LIB_DIR = File.join(ROOT_DIR,"lib").freeze
|
5
|
-
RESOURCE_DIR = File.join(ROOT_DIR,"resources").freeze
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
8
|
+
# The root directory of the project is considered to be the parent directory
|
9
|
+
# of the 'lib' directory.
|
10
|
+
#
|
11
|
+
# returns:: [String] The full expanded path of the parent directory of 'lib'
|
12
|
+
# going up the path from the current file. Trailing
|
13
|
+
# File::SEPARATOR is guaranteed.
|
14
|
+
#
|
15
|
+
def self.root_dir
|
16
|
+
unless @root_dir
|
17
|
+
path_parts = ::File.expand_path(__FILE__).split(::File::SEPARATOR)
|
18
|
+
lib_index = path_parts.rindex("lib")
|
19
|
+
@root_dir = path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
|
20
20
|
end
|
21
|
-
|
21
|
+
return @root_dir
|
22
|
+
end
|
22
23
|
|
23
|
-
|
24
|
+
# returns:: [String] The full expanded path of the +config+ directory
|
25
|
+
# below _root_dir_. All parameters passed in are joined onto the
|
26
|
+
# result. Trailing File::SEPARATOR is guaranteed if _args_ are
|
27
|
+
# *not* present.
|
28
|
+
#
|
29
|
+
def self.config_path(*args)
|
30
|
+
self.sub_path("config", *args)
|
31
|
+
end
|
32
|
+
|
33
|
+
# returns:: [String] The full expanded path of the +data+ directory below
|
34
|
+
# _root_dir_. All parameters passed in are joined onto the
|
35
|
+
# result. Trailing File::SEPARATOR is guaranteed if
|
36
|
+
# _*args_ are *not* present.
|
37
|
+
#
|
38
|
+
def self.data_path(*args)
|
39
|
+
self.sub_path("data", *args)
|
40
|
+
end
|
24
41
|
|
25
|
-
|
42
|
+
# returns:: [String] The full expanded path of the +lib+ directory below
|
43
|
+
# _root_dir_. All parameters passed in are joined onto the
|
44
|
+
# result. Trailing File::SEPARATOR is guaranteed if
|
45
|
+
# _*args_ are *not* present.
|
46
|
+
#
|
47
|
+
def self.lib_path(*args)
|
48
|
+
self.sub_path("lib", *args)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.sub_path(sub,*args)
|
52
|
+
sp = ::File.join(root_dir, sub) + File::SEPARATOR
|
53
|
+
sp = ::File.join(sp, *args) if args
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
require '<%= project_name %>/version'
|
@@ -1,18 +1,26 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) <%= Date.today.year %> <%= author %>
|
3
|
+
# All rights reserved. See LICENSE and/or COPYING for details
|
4
|
+
#++
|
5
|
+
|
1
6
|
module <%= project_name.camelize %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
7
|
+
module Version
|
8
|
+
MAJOR = 0
|
9
|
+
MINOR = 0
|
10
|
+
BUILD = 1
|
6
11
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
12
|
+
def to_a
|
13
|
+
[MAJOR, MINOR, BUILD]
|
14
|
+
end
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
+
def to_s
|
17
|
+
to_a.join(".")
|
16
18
|
end
|
17
|
-
|
19
|
+
|
20
|
+
module_function :to_a
|
21
|
+
module_function :to_s
|
22
|
+
|
23
|
+
STRING = Version.to_s
|
24
|
+
end
|
25
|
+
VERSION = Version.to_s
|
18
26
|
end
|
@@ -1,57 +1,39 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
|
5
|
-
#-----------------------------------------------------------------------
|
6
|
-
def changes
|
7
|
-
change_file = File.expand_path(File.join(<%= project_name.camelize %>::ROOT_DIR,"CHANGES"))
|
8
|
-
sections = File.read(change_file).split(/^(?===)/)
|
9
|
-
end
|
10
|
-
|
11
|
-
def last_changeset
|
12
|
-
changes[1]
|
13
|
-
end
|
14
|
-
|
15
|
-
def announcement
|
16
|
-
urls = " #{<%= project_name.camelize %>::SPEC.homepage}"
|
17
|
-
subject = "#{<%= project_name.camelize %>::SPEC.name} #{<%= project_name.camelize %>::VERSION} Released"
|
18
|
-
title = "#{<%= project_name.camelize %>::SPEC.name} version #{<%= project_name.camelize %>::VERSION} has been released."
|
19
|
-
body = <<BODY
|
20
|
-
#{<%= project_name.camelize %>::SPEC.description.rstrip}
|
21
|
-
|
22
|
-
{{ Changelog for Version #{<%= project_name.camelize %>::VERSION} }}
|
23
|
-
|
24
|
-
#{last_changeset.rstrip}
|
25
|
-
|
26
|
-
BODY
|
27
|
-
|
28
|
-
return subject, title, body, urls
|
29
|
-
end
|
1
|
+
require 'tasks/config'
|
2
|
+
#-------------------------------------------------------------------------------
|
3
|
+
# announcement methods
|
4
|
+
#-------------------------------------------------------------------------------
|
30
5
|
|
6
|
+
proj_config = Configuration.for('project')
|
31
7
|
namespace :announce do
|
32
|
-
|
33
|
-
|
34
|
-
|
8
|
+
desc "create email for ruby-talk"
|
9
|
+
task :email do
|
10
|
+
info = Utils.announcement
|
11
|
+
|
12
|
+
File.open("email.txt", "w") do |mail|
|
13
|
+
mail.puts "From: #{proj_config.author} <#{proj_config.email}>"
|
14
|
+
mail.puts "To: ruby-talk@ruby-lang.org"
|
15
|
+
mail.puts "Date: #{Time.now.rfc2822}"
|
16
|
+
mail.puts "Subject: [ANN] #{info[:subject]}"
|
17
|
+
mail.puts
|
18
|
+
mail.puts info[:title]
|
19
|
+
mail.puts
|
20
|
+
mail.puts " gem install #{<%= project_name.camelize %>::GEM_SPEC.name}"
|
21
|
+
mail.puts
|
22
|
+
mail.puts info[:urls]
|
23
|
+
mail.puts
|
24
|
+
mail.puts info[:description]
|
25
|
+
mail.puts
|
26
|
+
mail.puts "{{ Release notes for Version #{<%= project_name.camelize %>::VERSION} }}"
|
27
|
+
mail.puts
|
28
|
+
mail.puts info[:release_notes]
|
29
|
+
mail.puts
|
30
|
+
end
|
31
|
+
puts "Created the following as email.txt:"
|
32
|
+
puts "-" * 72
|
33
|
+
puts File.read("email.txt")
|
34
|
+
puts "-" * 72
|
35
|
+
end
|
36
|
+
|
37
|
+
CLOBBER << "email.txt"
|
38
|
+
end
|
35
39
|
|
36
|
-
File.open("email.txt", "w") do |mail|
|
37
|
-
mail.puts "From: #{<%= project_name.camelize %>::SPEC.author} <#{<%= project_name.camelize %>::SPEC.email}>"
|
38
|
-
mail.puts "To: ruby-talk@ruby-lang.org"
|
39
|
-
mail.puts "Date: #{Time.now.rfc2822}"
|
40
|
-
mail.puts "Subject: [ANN] #{subject}"
|
41
|
-
mail.puts
|
42
|
-
mail.puts title
|
43
|
-
mail.puts
|
44
|
-
mail.puts urls
|
45
|
-
mail.puts
|
46
|
-
mail.puts body
|
47
|
-
mail.puts
|
48
|
-
mail.puts urls
|
49
|
-
end
|
50
|
-
puts "Created the following as email.txt:"
|
51
|
-
puts "-" * 72
|
52
|
-
puts File.read("email.txt")
|
53
|
-
puts "-" * 72
|
54
|
-
end
|
55
|
-
|
56
|
-
CLOBBER << "email.txt"
|
57
|
-
end
|