reap 4.3.4 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MANIFEST +424 -0
- data/ProjectInfo +4 -3
- data/README +83 -51
- data/Rakefile +118 -0
- data/bin/reap +2 -1
- data/data/reap/scaffold/standard/setup.rb +1568 -0
- data/data/reap/scaffold/subversion/trunk/setup.rb +1568 -0
- data/data/reap/setup.rb +4 -0
- data/doc/LATEST +24 -0
- data/lib/reap/bin/reap.rb +15 -8
- data/lib/reap/projectinfo.rb +100 -35
- data/lib/reap/rake.rb +16 -0
- data/lib/reap/rake/adapter.rb +50 -0
- data/lib/reap/rake/announce.rb +10 -0
- data/lib/reap/rake/doap.rb +10 -0
- data/lib/reap/rake/extest.rb +10 -0
- data/lib/reap/rake/info.rb +10 -0
- data/lib/reap/rake/install.rb +10 -0
- data/lib/reap/rake/manifest.rb +9 -0
- data/lib/reap/rake/package.rb +10 -0
- data/lib/reap/rake/publish.rb +10 -0
- data/lib/reap/rake/rdoc.rb +10 -0
- data/lib/reap/rake/release.rb +10 -0
- data/lib/reap/rake/test.rb +10 -0
- data/lib/reap/reap.rb +6 -5
- data/lib/reap/task.rb +47 -38
- data/lib/reap/task/announce.rb +81 -51
- data/lib/reap/task/doap.rb +12 -9
- data/lib/reap/task/{testext.rb → extest.rb} +30 -22
- data/lib/reap/task/fileperm.rb +8 -6
- data/lib/reap/task/info.rb +0 -4
- data/lib/reap/task/install.rb +11 -4
- data/lib/reap/task/manifest.rb +59 -0
- data/lib/reap/task/noop.rb +2 -3
- data/lib/reap/task/package.rb +22 -31
- data/lib/reap/task/publish.rb +113 -28
- data/lib/reap/task/rdoc.rb +30 -18
- data/lib/reap/task/release.rb +15 -16
- data/lib/reap/task/test.rb +22 -14
- metadata +26 -6
data/data/reap/setup.rb
CHANGED
@@ -647,6 +647,10 @@ module FileOperations
|
|
647
647
|
}
|
648
648
|
File.chmod mode, realdest
|
649
649
|
|
650
|
+
# Do not make InstalledFiles entry if to alternate root.
|
651
|
+
# This prevents problem with root permissions on this file.
|
652
|
+
return true unless $setup_install_root
|
653
|
+
|
650
654
|
File.open("#{objdir_root()}/InstalledFiles", 'a') {|f|
|
651
655
|
if prefix
|
652
656
|
f.puts realdest.sub(prefix, '')
|
data/doc/LATEST
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
Hey, today I'm gald to have gotten Reap 4.3.4 out the door.
|
2
|
+
|
3
|
+
This realease fixes a bunch nagging no-ops that have been
|
4
|
+
real turn-offs for those who have only dipped their
|
5
|
+
first big toe into the Reaping fields. Like the template
|
6
|
+
and scaffold commands actually do something now!
|
7
|
+
|
8
|
+
I've also added some hot off the skillet features.
|
9
|
+
Reap can now cook you up a DOAP XML project file
|
10
|
+
(<Project> section only as of yet). She can
|
11
|
+
now release directly to Rubyforge -- Woohoo! is life easier
|
12
|
+
without all that point-and-clickery. And best of all
|
13
|
+
Reap can not plunk down a .deb package as easy as a
|
14
|
+
.tar.gz or .gem. You gotta love that! (Note, that you'll need to
|
15
|
+
use Reap's slightly modified version of setup.rb for this.
|
16
|
+
Just copy it out of the installation if you need it.)
|
17
|
+
|
18
|
+
Boy oh boy, more of goodies, good fixes and solidity.
|
19
|
+
Reaps coming along nice. She'll move to version 4.4 once
|
20
|
+
all the little undiscovered cockaroaches are scurried away.
|
21
|
+
|
22
|
+
Ciao,
|
23
|
+
T.
|
24
|
+
|
data/lib/reap/bin/reap.rb
CHANGED
@@ -4,14 +4,15 @@ require 'rbconfig'
|
|
4
4
|
|
5
5
|
require 'facets'
|
6
6
|
require 'consoleapp'
|
7
|
+
#require 'console/command'
|
7
8
|
|
8
9
|
require 'reap/reap'
|
9
10
|
|
10
11
|
|
11
|
-
class ReapCommand < Console::
|
12
|
+
class ReapCommand < Console::Command
|
12
13
|
|
13
14
|
# to do first for every task
|
14
|
-
#def
|
15
|
+
#def command_setup
|
15
16
|
# $PROJECT_INFO = ProjectInfo.new( $PROJECT_FILE )
|
16
17
|
#end
|
17
18
|
|
@@ -65,7 +66,7 @@ class ReapCommand < Console::Application
|
|
65
66
|
# display version
|
66
67
|
|
67
68
|
def version
|
68
|
-
puts "Reap v
|
69
|
+
puts "Reap v#{Reap::Version}"
|
69
70
|
exit 0
|
70
71
|
end
|
71
72
|
|
@@ -94,8 +95,11 @@ class ReapCommand < Console::Application
|
|
94
95
|
def tasks
|
95
96
|
if Reap.projectfile?
|
96
97
|
puts
|
97
|
-
Reap.tasks.
|
98
|
-
|
98
|
+
sorted_names = Reap.tasks.keys.sort
|
99
|
+
margin = sorted_names.collect{ |n| n.size }.max + 6
|
100
|
+
sorted_names.each do |name|
|
101
|
+
task_class = Reap.tasks[name]
|
102
|
+
puts " #{name}".ljust(margin) + "#{task_class.task_desc}"
|
99
103
|
end
|
100
104
|
puts
|
101
105
|
else
|
@@ -147,12 +151,15 @@ class ReapCommand < Console::Application
|
|
147
151
|
end
|
148
152
|
|
149
153
|
# Add all the reap tasks.
|
154
|
+
|
150
155
|
if Reap.register
|
156
|
+
|
151
157
|
Reap.tasks.each do |sym,taskclass|
|
152
158
|
define_method(sym) do |*args|
|
153
|
-
taskclass.new(*args)
|
159
|
+
taskclass.new(*args).execute
|
154
160
|
end
|
155
161
|
end
|
162
|
+
|
156
163
|
end
|
157
164
|
|
158
165
|
end
|
@@ -166,7 +173,7 @@ HELP = <<-HERE
|
|
166
173
|
|
167
174
|
COMMANDS:
|
168
175
|
|
169
|
-
tasks
|
176
|
+
tasks
|
170
177
|
List all the current tasks with descriptions.
|
171
178
|
This is the default action if no command
|
172
179
|
is given. (Also aliased as 'ls'.)
|
@@ -178,7 +185,7 @@ HELP = <<-HERE
|
|
178
185
|
|
179
186
|
template
|
180
187
|
Copies a ProjectInfo template into the current
|
181
|
-
directory
|
188
|
+
directory (if it does not already exist).
|
182
189
|
|
183
190
|
scaffold [directory] [type]
|
184
191
|
Builds a starter project directory. There are
|
data/lib/reap/projectinfo.rb
CHANGED
@@ -5,6 +5,12 @@ require 'facet/hash/traverse'
|
|
5
5
|
require 'facet/string/tabto'
|
6
6
|
require 'facet/dir/self/ascend'
|
7
7
|
|
8
|
+
require 'facet/basicobject'
|
9
|
+
|
10
|
+
|
11
|
+
#--
|
12
|
+
# NOTE At some point get past the use of the global variable perhaps?
|
13
|
+
#++
|
8
14
|
|
9
15
|
class ProjectInfo
|
10
16
|
|
@@ -15,66 +21,117 @@ class ProjectInfo
|
|
15
21
|
'reapfile'
|
16
22
|
]
|
17
23
|
|
18
|
-
|
19
|
-
|
24
|
+
class << self
|
25
|
+
|
26
|
+
# Load the project information from a file. Generally
|
27
|
+
# no file needs to be specified; the file will be found
|
28
|
+
# by ascending up the current path until a default
|
29
|
+
# file name is found (eg. ProjectInfo or Reapfile).
|
30
|
+
|
31
|
+
def load( fpath=nil, report=false )
|
32
|
+
if fpath
|
33
|
+
new.read( fpath, report )
|
34
|
+
else
|
35
|
+
new.read( find, report )
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Find project information file.
|
40
|
+
|
41
|
+
def find
|
42
|
+
info_dir, info_file = nil, nil
|
43
|
+
Dir.ascend(Dir.pwd) do |info_dir|
|
44
|
+
info_file = INFO_FILES.find{ |f| File.file?( File.join( info_dir, f ) ) }
|
45
|
+
break if info_file
|
46
|
+
end
|
47
|
+
return File.join( info_dir, info_file )
|
48
|
+
end
|
49
|
+
|
50
|
+
#def add_file( f )
|
51
|
+
# INFO_FILES.unshift( f )
|
52
|
+
#end
|
53
|
+
|
20
54
|
end
|
21
55
|
|
22
|
-
#def self.[](name)
|
23
|
-
# @self ||= self.new
|
24
|
-
# @self[name]
|
25
|
-
#end
|
26
56
|
|
27
|
-
attr_reader :info, :info_stream, :info_dir
|
57
|
+
attr_reader :info, :info_stream, :info_dir, :info_file
|
28
58
|
|
29
|
-
def initialize(
|
59
|
+
def initialize( &block )
|
60
|
+
@info = {}
|
61
|
+
@info_stream = nil
|
30
62
|
|
31
|
-
|
32
|
-
# NOTE Should this work out of the current working dir only?
|
33
|
-
add_info_file( alt_info_file ) if alt_info_file
|
63
|
+
define( &block ) if block_given?
|
34
64
|
|
35
|
-
|
36
|
-
|
65
|
+
$PROJECT_INFO = self
|
66
|
+
end
|
37
67
|
|
38
|
-
|
39
|
-
#Dir.chdir(info_dir)
|
40
|
-
info_file = INFO_FILES.find{ |f| File.file?( File.join( info_dir, f ) ) }
|
41
|
-
break if info_file
|
42
|
-
end
|
68
|
+
# Define project information programmatically.
|
43
69
|
|
44
|
-
|
70
|
+
def define( &block )
|
71
|
+
return unless block
|
45
72
|
|
46
|
-
|
47
|
-
@
|
48
|
-
@info_file = info_file
|
49
|
-
Dir.chdir(info_dir)
|
73
|
+
@info = HashBuilder.new( &block ).to_h
|
74
|
+
@info_stream = @info.to_yaml
|
50
75
|
|
51
|
-
|
76
|
+
validate
|
77
|
+
defaults
|
78
|
+
|
79
|
+
self
|
80
|
+
end
|
52
81
|
|
53
|
-
|
82
|
+
# Load project information from YAML file.
|
54
83
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
84
|
+
def read( fpath, report=true )
|
85
|
+
return unless fpath
|
86
|
+
|
87
|
+
@info_dir = File.dirname( fpath )
|
88
|
+
@info_file = fpath #File.basename( fpath )
|
89
|
+
@info_stream = File.read( fpath ).strip
|
90
|
+
@info = YAML::load( info_stream ).traverse{ |k,v| [k.to_s.downcase, v] }
|
91
|
+
|
92
|
+
Dir.chdir(@info_dir)
|
93
|
+
if report
|
94
|
+
puts "(in #{Dir.pwd})" #unless dir == Dir.pwd
|
60
95
|
end
|
61
96
|
|
62
|
-
|
63
|
-
|
97
|
+
validate
|
98
|
+
defaults
|
99
|
+
|
100
|
+
self
|
101
|
+
end
|
102
|
+
|
103
|
+
# Update project information.
|
104
|
+
|
105
|
+
def update( info=nil, &block )
|
106
|
+
if info
|
107
|
+
@info.update( info.traverse{ |k,v| [k.to_s.downcase, v] } )
|
108
|
+
end
|
109
|
+
if block_given?
|
110
|
+
@info.update( HashBuilder.new( &block ).to_h )
|
111
|
+
end
|
112
|
+
@info_stream = @info.to_yaml
|
64
113
|
|
65
114
|
validate
|
66
115
|
defaults
|
116
|
+
|
117
|
+
self
|
67
118
|
end
|
68
119
|
|
120
|
+
# Project information file exists? (may need to change to info exists?)
|
121
|
+
|
69
122
|
def exists?
|
70
|
-
@
|
123
|
+
@info_file
|
71
124
|
end
|
72
125
|
|
126
|
+
# Validate project information.
|
127
|
+
|
73
128
|
def validate
|
74
129
|
raise "NAME is a required piece of information" unless info['name']
|
75
130
|
raise "VERSION is a required piece of informatiomn" unless info['version']
|
76
131
|
end
|
77
132
|
|
133
|
+
# Project information defaults.
|
134
|
+
|
78
135
|
def defaults
|
79
136
|
self['title'] ||= self['name'].capitalize
|
80
137
|
self['series'] ||= '1'
|
@@ -88,14 +145,20 @@ class ProjectInfo
|
|
88
145
|
self['homepage'] ||= self['rubyforge'] ? self['rubyforge']['homepage'] : nil
|
89
146
|
end
|
90
147
|
|
148
|
+
# Information fetch.
|
149
|
+
|
91
150
|
def [](name)
|
92
151
|
info[name]
|
93
152
|
end
|
94
153
|
|
154
|
+
# Information sore.
|
155
|
+
|
95
156
|
def []=(name, x)
|
96
157
|
info[name] = x
|
97
158
|
end
|
98
159
|
|
160
|
+
# Information to hash.
|
161
|
+
|
99
162
|
def to_h
|
100
163
|
@info
|
101
164
|
end
|
@@ -121,6 +184,7 @@ class ProjectInfo::HashBuilder < BasicObject
|
|
121
184
|
def to_h ; @hash ; end
|
122
185
|
|
123
186
|
def method_missing( sym, *args, &block )
|
187
|
+
sym = sym.to_s.downcase
|
124
188
|
|
125
189
|
if @hash.key?(sym)
|
126
190
|
unless @flag[sym]
|
@@ -128,13 +192,13 @@ class ProjectInfo::HashBuilder < BasicObject
|
|
128
192
|
@flag[sym] = true
|
129
193
|
end
|
130
194
|
if block_given?
|
131
|
-
@hash[sym] <<
|
195
|
+
@hash[sym] << self.__class__.new( &block ).to_h
|
132
196
|
else
|
133
197
|
@hash[sym] << args[0]
|
134
198
|
end
|
135
199
|
else
|
136
200
|
if block_given?
|
137
|
-
@hash[sym] =
|
201
|
+
@hash[sym] = self.__class__.new( &block ).to_h
|
138
202
|
else
|
139
203
|
@hash[sym] = args[0]
|
140
204
|
end
|
@@ -143,3 +207,4 @@ class ProjectInfo::HashBuilder < BasicObject
|
|
143
207
|
end
|
144
208
|
|
145
209
|
end
|
210
|
+
|
data/lib/reap/rake.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
# This file requires all rake adapted reap tasks.
|
3
|
+
|
4
|
+
require 'rake'
|
5
|
+
|
6
|
+
require 'reap/rake/announce.rb'
|
7
|
+
require 'reap/rake/package.rb'
|
8
|
+
require 'reap/rake/test.rb'
|
9
|
+
require 'reap/rake/extest.rb'
|
10
|
+
require 'reap/rake/release.rb'
|
11
|
+
require 'reap/rake/publish.rb'
|
12
|
+
require 'reap/rake/info.rb'
|
13
|
+
require 'reap/rake/doap.rb'
|
14
|
+
require 'reap/rake/install.rb'
|
15
|
+
require 'reap/rake/rdoc.rb'
|
16
|
+
require 'reap/rake/manifest.rb'
|
@@ -0,0 +1,50 @@
|
|
1
|
+
|
2
|
+
#require 'rake'
|
3
|
+
require 'rake/tasklib'
|
4
|
+
|
5
|
+
require 'reap/projectinfo.rb'
|
6
|
+
require 'facet/hash/keys_to_s'
|
7
|
+
|
8
|
+
|
9
|
+
module Reap
|
10
|
+
|
11
|
+
def self.RakeAdapter( reapclass )
|
12
|
+
|
13
|
+
Class.new( ::Rake::TaskLib ) do
|
14
|
+
|
15
|
+
define_method( :reapclass ) { reapclass }
|
16
|
+
|
17
|
+
attr_accessor :name, :options
|
18
|
+
|
19
|
+
# Create task.
|
20
|
+
def initialize(name=reapclass.task_name) # :yield:
|
21
|
+
@name = name
|
22
|
+
@options = nil
|
23
|
+
if block_given?
|
24
|
+
options = OpenObject.new
|
25
|
+
yield( options )
|
26
|
+
@options = options.to_h.keys_to_s
|
27
|
+
#reapclass.master[reapclass.task_name].update( @options )
|
28
|
+
end
|
29
|
+
define
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create the tasks defined by this task lib.
|
33
|
+
def define
|
34
|
+
desc reapclass.task_desc
|
35
|
+
task name do
|
36
|
+
rc = reapclass.new
|
37
|
+
if @options
|
38
|
+
rc.execute( @options.to_h )
|
39
|
+
else
|
40
|
+
rc.execute
|
41
|
+
end
|
42
|
+
end
|
43
|
+
self
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|