reap 4.4.1 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/ProjectInfo CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  title : Reap
4
4
  name : reap
5
- version : '4.4.1'
6
- #date : '2006-04-01'
5
+ version : '4.5.0'
7
6
  created : '2004-04-01'
8
7
  status : 'beta/stable'
9
8
 
@@ -19,9 +18,9 @@ description: >
19
18
  information, significantly simplifying usage.
20
19
 
21
20
  package:
22
- distribute : [ gem, tar.bz2, deb ] # zip, tar.gz, tbz, tgz, gem, deb
21
+ distribute : [ gem, tar.bz2 ] # zip, tar.gz, tbz, tgz, gem, deb
23
22
  dependencies : [ facets ]
24
- executables : [ reap ]
23
+ executables : [ reap, rubytest ]
25
24
  dir: '../DISTRIBUTION'
26
25
  exclude:
27
26
  - dist
@@ -75,6 +74,6 @@ perm:
75
74
  user: trans
76
75
  group: users
77
76
 
78
- #noop:
79
- # message: Hello Dude!
77
+ noop:
78
+ message: Hello Dude!
80
79
 
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'rake'
4
- require 'reap/rake'
4
+ require 'reap/reap'
5
5
 
6
6
  # Load the project information file from standard location.
7
7
  # (Note that this sets the global variable $PROJECT_INFO.)
File without changes
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if defined?(Rake)
4
+
5
+ require 'reap/rake/adapter'
6
+ require 'reap/task/announce'
7
+
8
+ module Rake
9
+ ReapAnnounce = ::Reap::RakeAdapter( ::Reap::Announce )
10
+ end
11
+
12
+ end
File without changes
File without changes
File without changes
@@ -4,7 +4,5 @@ require 'reap/rake/adapter'
4
4
  require 'reap/task/install'
5
5
 
6
6
  module Rake
7
-
8
7
  ReapInstall = ::Reap::RakeAdapter( ::Reap::Install )
9
-
10
8
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/reap/bin/reap.rb CHANGED
@@ -140,21 +140,20 @@ class ReapCommand < Console::Command
140
140
  puts "Directory already has content. Use -f option to force scaffolding."
141
141
  exit -1
142
142
  end
143
- case type
144
- when 'std', 'standard', nil
145
- type = 'standard'
146
- when 'svn', 'subversion'
147
- type = 'subversion'
148
- else
149
- puts "Unrecognized project type."
150
- exit -1
151
- end
152
- # need to add gems workaround
143
+ type ||= 'standard'
144
+ type = 'standard' if type == 'std'
145
+ type = 'subversion' if type == 'svn'
146
+ # gems workaround
153
147
  if dir = Gem.gempath('reap')
154
- dir = File.join( dir, 'data', 'reap', 'scaffold', 'standard', type )
148
+ dir = File.join( dir, 'data', 'reap', 'scaffold', type )
155
149
  else
156
150
  dir = File.join( ::Config::CONFIG['datadir'], 'reap', 'scaffold', type )
157
151
  end
152
+ #
153
+ unless File.directory?( dir )
154
+ puts "Unrecognized project type."
155
+ exit -1
156
+ end
158
157
  #FileUtils.mkdir_p( name )
159
158
  FileUtils.cp_r( File.join( dir, '.'), '.' )
160
159
  puts "Project ready."
@@ -4,13 +4,31 @@ require 'yaml'
4
4
  require 'facet/hash/traverse'
5
5
  require 'facet/string/tabto'
6
6
  require 'facet/dir/self/ascend'
7
+ require 'facet/kernel/require_all'
7
8
 
8
9
  require 'facet/basicobject'
9
10
 
10
11
 
11
- #--
12
- # NOTE At some point get past the use of the global variable perhaps?
13
- #++
12
+ module Reap
13
+
14
+ def self.register #( alternative_project_file=nil )
15
+ pi = ProjectInfo.load( nil, true )
16
+ pi.require_custom_tasks
17
+ pi
18
+ end
19
+
20
+ def self.projectfile?
21
+ ProjectInfo.instance.info_file
22
+ end
23
+
24
+ end
25
+
26
+
27
+ # Project information, generally read from a file.
28
+ # Simply by calling 'ProjectInfo.load'.
29
+ #
30
+ # ProjectInfo is a Singleton. Access it via the
31
+ # ProjectInfo.instance method.
14
32
 
15
33
  class ProjectInfo
16
34
 
@@ -23,6 +41,14 @@ class ProjectInfo
23
41
 
24
42
  class << self
25
43
 
44
+ # Singelton Pattern.
45
+
46
+ private :new
47
+
48
+ def instance( *args, &block )
49
+ @instance ||= new( *args, &block )
50
+ end
51
+
26
52
  # Load the project information from a file. Generally
27
53
  # no file needs to be specified; the file will be found
28
54
  # by ascending up the current path until a default
@@ -33,7 +59,7 @@ class ProjectInfo
33
59
  new.read( fpath, report )
34
60
  else
35
61
  fpath = find
36
- new.read( fpath, report )
62
+ instance.read( fpath, report )
37
63
  end
38
64
  end
39
65
 
@@ -64,7 +90,7 @@ class ProjectInfo
64
90
 
65
91
  define( &block ) if block_given?
66
92
 
67
- $PROJECT_INFO = self
93
+ #$PROJECT_INFO = self
68
94
  end
69
95
 
70
96
  # Define project information programmatically.
@@ -74,6 +100,8 @@ class ProjectInfo
74
100
 
75
101
  @info = HashBuilder.new( &block ).to_h
76
102
  @info_stream = @info.to_yaml
103
+ @info_dir = Dir.pwd #?
104
+ @info_file = nil
77
105
 
78
106
  #validate
79
107
  defaults
@@ -121,9 +149,9 @@ class ProjectInfo
121
149
 
122
150
  # Project information file exists? (may need to change to info exists?)
123
151
 
124
- def exists?
125
- @info_file
126
- end
152
+ #def exists?
153
+ # @info_file
154
+ #end
127
155
 
128
156
  # Validate project information.
129
157
 
@@ -149,13 +177,32 @@ class ProjectInfo
149
177
  self['homepage'] ||= self['rubyforge'] ? self['rubyforge']['homepage'] : nil
150
178
  end
151
179
 
180
+ # Load custom tasks.
181
+
182
+ def require_custom_tasks
183
+ # Universal custom tasks for all projects.
184
+ dir = File.join( Config::CONFIG['datadir'], 'reap/task' )
185
+ require_all( File.join(dir, '*') ) if File.directory?(dir)
186
+ # Personal tasks for all projects.
187
+ dir = File.expand_path( '~/.share/reap/task' )
188
+ require_all( File.join(dir, '*') ) if File.directory?(dir)
189
+ # Project specific tasks.
190
+ require_all('task/*') if File.directory?('task')
191
+ end
192
+
193
+ # Convert to a CascadinOpenObject.
194
+
195
+ def to_cascading_open_object
196
+ CascadingOpenObject.new( @info )
197
+ end
198
+
152
199
  # Information fetch.
153
200
 
154
201
  def [](name)
155
202
  info[name]
156
203
  end
157
204
 
158
- # Information sore.
205
+ # Information store.
159
206
 
160
207
  def []=(name, x)
161
208
  info[name] = x
@@ -0,0 +1,50 @@
1
+
2
+ require 'facet/hash/keys_to_s'
3
+
4
+
5
+ module Reap
6
+
7
+ # Rake adapter translates a Reap task into a Rake task.
8
+
9
+ def self.RakeAdapter( reapclass )
10
+
11
+ require 'rake/tasklib'
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 # module Reap
data/lib/reap/reap.rb CHANGED
@@ -1,6 +1,15 @@
1
1
 
2
- # Reap support
2
+ module Reap
3
+ Version = "4.5.0"
4
+ end
5
+
6
+ # Reap project information object.
3
7
  require 'reap/projectinfo'
8
+
9
+ # Rake adapter.
10
+ require 'reap/rakeadapter'
11
+
12
+ # Reap task base class.
4
13
  require 'reap/task'
5
14
 
6
15
  # Reap tasks
@@ -16,45 +25,3 @@ require 'reap/task/release'
16
25
  require 'reap/task/doap'
17
26
  require 'reap/task/manifest'
18
27
  require 'reap/task/fileperm' # needs work
19
- #require 'reap/task/noop'
20
-
21
-
22
- module Reap
23
-
24
- Version = "4.3.5"
25
-
26
- # Hash of all possible tasks
27
- # { task name => task class }
28
-
29
- def self.registry
30
- Task.task_list
31
- end
32
-
33
- # Hash of tasks available to this project
34
-
35
- def self.tasks
36
- unless @tasks
37
- @tasks = {}
38
- registry.each do |name, klass|
39
- @tasks[name] = klass if klass.verify?
40
- end
41
- end
42
- @tasks
43
- end
44
-
45
- def self.register #( alternative_project_file=nil )
46
- $PROJECT_INFO = ProjectInfo.load( nil, true )
47
- end
48
-
49
- def self.projectfile?
50
- $PROJECT_INFO #.exists?
51
- end
52
-
53
- # def self.initialize
54
- # @tasks ||= {}
55
- # registry.each do |name, klass|
56
- # @tasks[name] = klass.new
57
- # end
58
- # end
59
-
60
- end
@@ -2,12 +2,14 @@
2
2
  require 'reap/task'
3
3
 
4
4
  require 'net/smtp'
5
+
5
6
  require 'facet/string/margin'
6
7
  require 'facet/string/tab'
7
8
  require 'facet/string/align_center'
8
9
  require 'facet/string/fold'
9
10
  require 'facet/string/word_wrap'
10
11
 
12
+
11
13
  # _ _____ _
12
14
  # /_\ _ _ _ _ ___ _ _ _ _ __ ___ |_ _|_ _ __| |__
13
15
  # / _ \| ' \| ' \/ _ \ || | ' \/ _/ -_) | |/ _` (_-< / /
@@ -228,3 +230,17 @@ private
228
230
  end
229
231
 
230
232
  end
233
+
234
+
235
+ # Rake interface.
236
+
237
+ if defined?(Rake)
238
+
239
+ #require 'reap/rake/adapter'
240
+
241
+ module Rake
242
+ ReapAnnounce = ::Reap::RakeAdapter( ::Reap::Announce )
243
+ end
244
+
245
+ end
246
+
@@ -68,3 +68,16 @@ module Reap
68
68
 
69
69
  end
70
70
 
71
+
72
+ # Rake interface.
73
+
74
+ if defined?(Rake)
75
+
76
+ #require 'reap/rake/adapter'
77
+
78
+ module Rake
79
+ ReapDoap = ::Reap::RakeAdapter( ::Reap::Doap )
80
+ end
81
+
82
+ end
83
+
@@ -145,3 +145,17 @@ private
145
145
 
146
146
  end
147
147
 
148
+
149
+ # Rake interface.
150
+
151
+ if defined?(Rake)
152
+
153
+ #require 'reap/rake/adapter'
154
+
155
+ module Rake
156
+ ReapExTest = ::Reap::RakeAdapter( ::Reap::ExTest )
157
+ end
158
+
159
+ end
160
+
161
+
@@ -96,3 +96,17 @@ class Reap::Perm < Reap::Task
96
96
 
97
97
  end
98
98
 
99
+
100
+ # Rake interface.
101
+
102
+ if defined?(Rake)
103
+
104
+ #require 'reap/rake/adapter'
105
+
106
+ module Rake
107
+ ReapPerm = ::Reap::RakeAdapter( ::Reap::Perm )
108
+ end
109
+
110
+ end
111
+
112
+
@@ -24,7 +24,21 @@ class Reap::Info < Reap::Task
24
24
  }
25
25
 
26
26
  def run
27
- puts $PROJECT_INFO.info_stream
27
+ puts ProjectInfo.instance.info_stream
28
28
  end
29
29
 
30
30
  end
31
+
32
+
33
+ # Rake interface.
34
+
35
+ if defined?(Rake)
36
+
37
+ #require 'reap/rake/adapter'
38
+
39
+ module Rake
40
+ ReapInfo = ::Reap::RakeAdapter( ::Reap::Info )
41
+ end
42
+
43
+ end
44
+
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'reap/task'
4
- require 'reap/setup'
5
4
 
6
5
  # ___ _ _ _ _____ _
7
6
  # |_ _|_ __ ___| |_ __ _| | | |_ _|_ _ ___| | __
@@ -66,3 +65,17 @@ class Reap::Install < Reap::Task
66
65
  end
67
66
 
68
67
  end
68
+
69
+
70
+ # Rake interface.
71
+
72
+ if defined?(Rake)
73
+
74
+ #require 'reap/rake/adapter'
75
+
76
+ module Rake
77
+ ReapInstall = ::Reap::RakeAdapter( ::Reap::Install )
78
+ end
79
+
80
+ end
81
+
@@ -57,3 +57,16 @@ class Reap::Manifest < Reap::Task
57
57
 
58
58
  end
59
59
 
60
+
61
+ # Rake interface.
62
+
63
+ if defined?(Rake)
64
+
65
+ #require 'reap/rake/adapter'
66
+
67
+ module Rake
68
+ ReapManifest = ::Reap::RakeAdapter( ::Reap::Manifest )
69
+ end
70
+
71
+ end
72
+
@@ -7,6 +7,7 @@ rescue LoadError
7
7
  # no rubygems
8
8
  end
9
9
 
10
+
10
11
  # ___ _ _____ _
11
12
  # | _ \__ _ __| |____ _ __ _ ___ |_ _|_ _ __| |__
12
13
  # | _/ _` / _| / / _` / _` / -_) | |/ _` (_-< / /
@@ -431,3 +432,15 @@ private
431
432
  end
432
433
 
433
434
  end
435
+
436
+
437
+ # Rake interface.
438
+
439
+ if defined?(Rake)
440
+
441
+ module Rake
442
+ ReapPackage = ::Reap::RakeAdapter( ::Reap::Package )
443
+ end
444
+
445
+ end
446
+
@@ -157,3 +157,17 @@ private
157
157
  end
158
158
 
159
159
  end
160
+
161
+
162
+ # Rake interface.
163
+
164
+ if defined?(Rake)
165
+
166
+ #require 'reap/rake/adapter'
167
+
168
+ module Rake
169
+ ReapPublish = ::Reap::RakeAdapter( ::Reap::Publish )
170
+ end
171
+
172
+ end
173
+
@@ -116,3 +116,17 @@ class Reap::RDoc < Reap::Task
116
116
  end
117
117
 
118
118
  end
119
+
120
+
121
+ # Rake interface.
122
+
123
+ if defined?(Rake)
124
+
125
+ #require 'reap/rake/adapter'
126
+
127
+ module Rake
128
+ ReapRDoc = ::Reap::RakeAdapter( ::Reap::RDoc )
129
+ end
130
+
131
+ end
132
+
@@ -498,3 +498,17 @@ BEGIN {
498
498
  end
499
499
  }
500
500
 
501
+
502
+ # Rake interface.
503
+
504
+ if defined?(Rake)
505
+
506
+ #require 'reap/rake/adapter'
507
+
508
+ module Rake
509
+ ReapRelease = ::Reap::RakeAdapter( ::Reap::Release )
510
+ end
511
+
512
+ end
513
+
514
+
@@ -266,3 +266,17 @@ private
266
266
  end
267
267
 
268
268
  end
269
+
270
+
271
+ # Rake interface.
272
+
273
+ if defined?(Rake)
274
+
275
+ #require 'reap/rake/adapter'
276
+
277
+ module Rake
278
+ ReapTest = ::Reap::RakeAdapter( ::Reap::Test )
279
+ end
280
+
281
+ end
282
+
data/lib/reap/task.rb CHANGED
@@ -10,6 +10,8 @@ require 'facet/module/attr_setter'
10
10
  require 'facet/filelist' unless defined?( FileList )
11
11
  require 'facet/openobject'
12
12
 
13
+ require 'reap/projectinfo'
14
+
13
15
  # _____ _ ___ ___ _
14
16
  # |_ _|_ _ __| |__ | _ ) __ _ ___ ___ / __| |__ _ ______
15
17
  # | |/ _` (_-< / / | _ \/ _` (_-</ -_) | (__| / _` (_-<_-<
@@ -47,6 +49,27 @@ require 'facet/openobject'
47
49
 
48
50
  module Reap
49
51
 
52
+ # Hash of all possible tasks
53
+ # { task name => task class }
54
+
55
+ def self.registry
56
+ Task.task_list
57
+ end
58
+
59
+ # Hash of tasks available to this project
60
+
61
+ def self.tasks
62
+ unless @tasks
63
+ @tasks = {}
64
+ registry.each do |name, klass|
65
+ @tasks[name] = klass if klass.verify?
66
+ end
67
+ end
68
+ @tasks
69
+ end
70
+
71
+ # Task base class.
72
+
50
73
  class Task
51
74
 
52
75
  #include ::Config
@@ -94,13 +117,14 @@ module Reap
94
117
 
95
118
  def verify?
96
119
  if section_required?
97
- return $PROJECT_INFO.info.key?(task_name)
120
+ return ProjectInfo.instance.info.key?(task_name)
98
121
  end
99
122
  true
100
123
  end
101
124
 
102
125
  def master
103
- @master ||= CascadingOpenObject.new( $PROJECT_INFO )
126
+ @master ||= ProjectInfo.instance.to_cascading_open_object
127
+ #@master ||= CascadingOpenObject.new( $PROJECT_INFO )
104
128
  end
105
129
 
106
130
  # properties not to be looked up in master
File without changes
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: reap
5
5
  version: !ruby/object:Gem::Version
6
- version: 4.4.1
7
- date: 2006-04-21 00:00:00 -04:00
6
+ version: 4.5.0
7
+ date: 2006-04-22 00:00:00 -04:00
8
8
  summary: Tools for Ruby project testing, management and assistance.
9
9
  require_paths:
10
10
  - lib
@@ -32,6 +32,7 @@ files:
32
32
  - Rakefile
33
33
  - doc
34
34
  - data
35
+ - task
35
36
  - lib
36
37
  - test
37
38
  - MANIFEST
@@ -45,6 +46,7 @@ files:
45
46
  - doc/ChangeLog
46
47
  - doc/note
47
48
  - doc/doap.xml
49
+ - doc/rake
48
50
  - doc/LATEST
49
51
  - doc/note/setup.rb
50
52
  - doc/note/license-each.rb
@@ -64,6 +66,18 @@ files:
64
66
  - doc/note/ProjectInfo.rb
65
67
  - doc/note/interface/interface.rb
66
68
  - doc/note/interface/rubyforge.rb
69
+ - doc/rake/info.rb
70
+ - doc/rake/package.rb
71
+ - doc/rake/announce.rb
72
+ - doc/rake/release.rb
73
+ - doc/rake/adapter.rb
74
+ - doc/rake/extest.rb
75
+ - doc/rake/test.rb
76
+ - doc/rake/publish.rb
77
+ - doc/rake/rdoc.rb
78
+ - doc/rake/install.rb
79
+ - doc/rake/doap.rb
80
+ - doc/rake/manifest.rb
67
81
  - data/reap
68
82
  - data/reap/scaffold
69
83
  - data/reap/setup.rb
@@ -103,6 +117,7 @@ files:
103
117
  - data/reap/scaffold/standard/test
104
118
  - data/reap/scaffold/standard/doc/note
105
119
  - data/reap/scaffold/standard/doc/api
120
+ - task/noop.rb
106
121
  - lib/reap
107
122
  - lib/reap/bin
108
123
  - lib/reap/task
@@ -110,8 +125,7 @@ files:
110
125
  - lib/reap/vendor
111
126
  - lib/reap/task.rb
112
127
  - lib/reap/reap.rb
113
- - lib/reap/rake.rb
114
- - lib/reap/rake
128
+ - lib/reap/rakeadapter.rb
115
129
  - lib/reap/bin/reap.rb
116
130
  - lib/reap/bin/rubytest.rb
117
131
  - lib/reap/bin/rubylint.rb
@@ -122,7 +136,6 @@ files:
122
136
  - lib/reap/task/install.rb
123
137
  - lib/reap/task/test.rb
124
138
  - lib/reap/task/extest.rb
125
- - lib/reap/task/noop.rb
126
139
  - lib/reap/task/fileperm.rb
127
140
  - lib/reap/task/package.rb
128
141
  - lib/reap/task/info.rb
@@ -132,18 +145,6 @@ files:
132
145
  - lib/reap/vendor/http-access2.rb
133
146
  - lib/reap/vendor/http-access2/cookie.rb
134
147
  - lib/reap/vendor/http-access2/http.rb
135
- - lib/reap/rake/info.rb
136
- - lib/reap/rake/package.rb
137
- - lib/reap/rake/announce.rb
138
- - lib/reap/rake/release.rb
139
- - lib/reap/rake/adapter.rb
140
- - lib/reap/rake/extest.rb
141
- - lib/reap/rake/test.rb
142
- - lib/reap/rake/publish.rb
143
- - lib/reap/rake/rdoc.rb
144
- - lib/reap/rake/install.rb
145
- - lib/reap/rake/doap.rb
146
- - lib/reap/rake/manifest.rb
147
148
  - test/tc_reap.rb
148
149
  test_files: []
149
150
 
@@ -153,6 +154,7 @@ extra_rdoc_files: []
153
154
 
154
155
  executables:
155
156
  - reap
157
+ - rubytest
156
158
  extensions: []
157
159
 
158
160
  requirements: []
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'reap/rake/adapter'
4
- require 'reap/task/announce'
5
-
6
- module Rake
7
-
8
- ReapAnnounce = ::Reap::RakeAdapter( ::Reap::Announce )
9
-
10
- end
data/lib/reap/rake.rb DELETED
@@ -1,16 +0,0 @@
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'