reap 4.0 → 4.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/ProjectInfo +18 -6
  2. data/lib/reap/bin/reap.rb +47 -16
  3. data/lib/reap/interface/interface.rb +0 -0
  4. data/lib/reap/interface/rubyforge.rb +247 -0
  5. data/lib/reap/lint.rb +1 -0
  6. data/lib/reap/projectinfo.rb +47 -18
  7. data/lib/reap/reap.rb +0 -0
  8. data/lib/reap/task/announce.rb +11 -13
  9. data/lib/reap/task/fileperm.rb +2 -5
  10. data/lib/reap/task/info.rb +2 -4
  11. data/lib/reap/task/install.rb +1 -3
  12. data/lib/reap/task/noop.rb +1 -3
  13. data/lib/reap/task/package.rb +163 -65
  14. data/lib/reap/task/publish.rb +2 -4
  15. data/lib/reap/task/rdoc.rb +1 -3
  16. data/lib/reap/task/release.rb +273 -0
  17. data/lib/reap/task/test.rb +19 -5
  18. data/lib/reap/task/testext.rb +5 -5
  19. data/lib/reap/task.rb +94 -69
  20. metadata +70 -256
  21. data/dev/Rakefile +0 -60
  22. data/dev/composite_task.rb +0 -27
  23. data/dev/compositepublisher.rb +0 -24
  24. data/dev/ftptools.rb +0 -139
  25. data/dev/license-each.rb +0 -85
  26. data/dev/publisher.rb +0 -75
  27. data/dev/rubyforgepublisher.rb +0 -18
  28. data/dev/sshpublisher.rb +0 -47
  29. data/dev/suby-cvs.rb +0 -46
  30. data/dev/template.rb +0 -72
  31. data/lib/reap/readymade.rb +0 -21
  32. data/lib/reap/task/webpublish.rb +0 -43
  33. data/lib/reap/tasks.rb +0 -13
  34. data/lib/reap/test.rb +0 -138
  35. data/web/ProjectInfo +0 -57
  36. data/web/images/appleboy.jpg +0 -0
  37. data/web/images/grape.jpg +0 -0
  38. data/web/index.html +0 -124
  39. data/web/rdoc/classes/Object.html +0 -121
  40. data/web/rdoc/classes/ProjectInfo.html +0 -207
  41. data/web/rdoc/classes/ProjectInfo.src/M000094.html +0 -18
  42. data/web/rdoc/classes/ProjectInfo.src/M000095.html +0 -24
  43. data/web/rdoc/classes/ProjectInfo.src/M000096.html +0 -22
  44. data/web/rdoc/classes/ProjectInfo.src/M000097.html +0 -21
  45. data/web/rdoc/classes/ProjectInfo.src/M000098.html +0 -18
  46. data/web/rdoc/classes/Reap/Announce.html +0 -262
  47. data/web/rdoc/classes/Reap/Announce.src/M000030.html +0 -18
  48. data/web/rdoc/classes/Reap/Announce.src/M000031.html +0 -114
  49. data/web/rdoc/classes/Reap/Announce.src/M000032.html +0 -46
  50. data/web/rdoc/classes/Reap/Info.html +0 -176
  51. data/web/rdoc/classes/Reap/Info.src/M000033.html +0 -18
  52. data/web/rdoc/classes/Reap/Info.src/M000034.html +0 -17
  53. data/web/rdoc/classes/Reap/Info.src/M000035.html +0 -18
  54. data/web/rdoc/classes/Reap/Install.html +0 -193
  55. data/web/rdoc/classes/Reap/Install.src/M000036.html +0 -18
  56. data/web/rdoc/classes/Reap/Install.src/M000037.html +0 -20
  57. data/web/rdoc/classes/Reap/Install.src/M000038.html +0 -26
  58. data/web/rdoc/classes/Reap/Noop.html +0 -192
  59. data/web/rdoc/classes/Reap/Noop.src/M000027.html +0 -18
  60. data/web/rdoc/classes/Reap/Noop.src/M000028.html +0 -17
  61. data/web/rdoc/classes/Reap/Noop.src/M000029.html +0 -18
  62. data/web/rdoc/classes/Reap/Package.html +0 -310
  63. data/web/rdoc/classes/Reap/Package.src/M000055.html +0 -18
  64. data/web/rdoc/classes/Reap/Package.src/M000056.html +0 -68
  65. data/web/rdoc/classes/Reap/Package.src/M000057.html +0 -84
  66. data/web/rdoc/classes/Reap/Package.src/M000058.html +0 -61
  67. data/web/rdoc/classes/Reap/Perm.html +0 -236
  68. data/web/rdoc/classes/Reap/Perm.src/M000078.html +0 -18
  69. data/web/rdoc/classes/Reap/Perm.src/M000079.html +0 -21
  70. data/web/rdoc/classes/Reap/Perm.src/M000080.html +0 -42
  71. data/web/rdoc/classes/Reap/Perm.src/M000081.html +0 -26
  72. data/web/rdoc/classes/Reap/Perm.src/M000082.html +0 -18
  73. data/web/rdoc/classes/Reap/Publish.html +0 -213
  74. data/web/rdoc/classes/Reap/Publish.src/M000070.html +0 -18
  75. data/web/rdoc/classes/Reap/Publish.src/M000071.html +0 -22
  76. data/web/rdoc/classes/Reap/Publish.src/M000072.html +0 -37
  77. data/web/rdoc/classes/Reap/RDoc.html +0 -218
  78. data/web/rdoc/classes/Reap/RDoc.src/M000059.html +0 -18
  79. data/web/rdoc/classes/Reap/RDoc.src/M000060.html +0 -24
  80. data/web/rdoc/classes/Reap/RDoc.src/M000061.html +0 -70
  81. data/web/rdoc/classes/Reap/Task.html +0 -396
  82. data/web/rdoc/classes/Reap/Task.src/M000039.html +0 -18
  83. data/web/rdoc/classes/Reap/Task.src/M000040.html +0 -16
  84. data/web/rdoc/classes/Reap/Task.src/M000041.html +0 -16
  85. data/web/rdoc/classes/Reap/Task.src/M000042.html +0 -16
  86. data/web/rdoc/classes/Reap/Task.src/M000043.html +0 -16
  87. data/web/rdoc/classes/Reap/Task.src/M000044.html +0 -22
  88. data/web/rdoc/classes/Reap/Task.src/M000045.html +0 -16
  89. data/web/rdoc/classes/Reap/Task.src/M000046.html +0 -16
  90. data/web/rdoc/classes/Reap/Task.src/M000047.html +0 -16
  91. data/web/rdoc/classes/Reap/Task.src/M000048.html +0 -16
  92. data/web/rdoc/classes/Reap/Task.src/M000049.html +0 -16
  93. data/web/rdoc/classes/Reap/Task.src/M000050.html +0 -27
  94. data/web/rdoc/classes/Reap/Task.src/M000051.html +0 -19
  95. data/web/rdoc/classes/Reap/Task.src/M000052.html +0 -18
  96. data/web/rdoc/classes/Reap/Task.src/M000053.html +0 -18
  97. data/web/rdoc/classes/Reap/Task.src/M000054.html +0 -19
  98. data/web/rdoc/classes/Reap/Test/TestResults.html +0 -205
  99. data/web/rdoc/classes/Reap/Test/TestResults.src/M000067.html +0 -21
  100. data/web/rdoc/classes/Reap/Test/TestResults.src/M000068.html +0 -21
  101. data/web/rdoc/classes/Reap/Test/TestResults.src/M000069.html +0 -23
  102. data/web/rdoc/classes/Reap/Test.html +0 -253
  103. data/web/rdoc/classes/Reap/Test.src/M000062.html +0 -18
  104. data/web/rdoc/classes/Reap/Test.src/M000063.html +0 -26
  105. data/web/rdoc/classes/Reap/Test.src/M000064.html +0 -77
  106. data/web/rdoc/classes/Reap/Test.src/M000065.html +0 -27
  107. data/web/rdoc/classes/Reap/Test.src/M000066.html +0 -50
  108. data/web/rdoc/classes/Reap/TestExt.html +0 -234
  109. data/web/rdoc/classes/Reap/TestExt.src/M000073.html +0 -18
  110. data/web/rdoc/classes/Reap/TestExt.src/M000074.html +0 -20
  111. data/web/rdoc/classes/Reap/TestExt.src/M000075.html +0 -49
  112. data/web/rdoc/classes/Reap/TestExt.src/M000076.html +0 -34
  113. data/web/rdoc/classes/Reap/TestExt.src/M000077.html +0 -27
  114. data/web/rdoc/classes/Reap/WebPublish.html +0 -213
  115. data/web/rdoc/classes/Reap/WebPublish.src/M000083.html +0 -18
  116. data/web/rdoc/classes/Reap/WebPublish.src/M000084.html +0 -21
  117. data/web/rdoc/classes/Reap/WebPublish.src/M000085.html +0 -32
  118. data/web/rdoc/classes/Reap.html +0 -248
  119. data/web/rdoc/classes/Reap.src/M000023.html +0 -16
  120. data/web/rdoc/classes/Reap.src/M000024.html +0 -21
  121. data/web/rdoc/classes/Reap.src/M000025.html +0 -16
  122. data/web/rdoc/classes/Reap.src/M000026.html +0 -21
  123. data/web/rdoc/classes/ReapCommand.html +0 -425
  124. data/web/rdoc/classes/ReapCommand.src/M000001.html +0 -16
  125. data/web/rdoc/classes/ReapCommand.src/M000003.html +0 -16
  126. data/web/rdoc/classes/ReapCommand.src/M000005.html +0 -16
  127. data/web/rdoc/classes/ReapCommand.src/M000007.html +0 -16
  128. data/web/rdoc/classes/ReapCommand.src/M000009.html +0 -16
  129. data/web/rdoc/classes/ReapCommand.src/M000011.html +0 -16
  130. data/web/rdoc/classes/ReapCommand.src/M000013.html +0 -18
  131. data/web/rdoc/classes/ReapCommand.src/M000014.html +0 -19
  132. data/web/rdoc/classes/ReapCommand.src/M000015.html +0 -19
  133. data/web/rdoc/classes/ReapCommand.src/M000016.html +0 -24
  134. data/web/rdoc/classes/ReapCommand.src/M000018.html +0 -29
  135. data/web/rdoc/classes/Scaffold.html +0 -211
  136. data/web/rdoc/classes/Scaffold.src/M000086.html +0 -16
  137. data/web/rdoc/classes/Scaffold.src/M000087.html +0 -28
  138. data/web/rdoc/classes/Scaffold.src/M000088.html +0 -32
  139. data/web/rdoc/classes/Scaffold.src/M000089.html +0 -18
  140. data/web/rdoc/classes/UnitTestKernel.html +0 -176
  141. data/web/rdoc/classes/UnitTestKernel.src/M000019.html +0 -18
  142. data/web/rdoc/classes/UnitTestKernel.src/M000020.html +0 -18
  143. data/web/rdoc/classes/UnitTestKernel.src/M000021.html +0 -22
  144. data/web/rdoc/classes/UnitTestKernel.src/M000022.html +0 -22
  145. data/web/rdoc/classes/UnitTesting/Failure.html +0 -156
  146. data/web/rdoc/classes/UnitTesting/Failure.src/M000092.html +0 -18
  147. data/web/rdoc/classes/UnitTesting/Failure.src/M000093.html +0 -21
  148. data/web/rdoc/classes/UnitTesting.html +0 -165
  149. data/web/rdoc/classes/UnitTesting.src/M000090.html +0 -34
  150. data/web/rdoc/classes/UnitTesting.src/M000091.html +0 -18
  151. data/web/rdoc/created.rid +0 -1
  152. data/web/rdoc/files/ANN.html +0 -107
  153. data/web/rdoc/files/COPYING.html +0 -119
  154. data/web/rdoc/files/ChangeLog.html +0 -144
  155. data/web/rdoc/files/ProjectInfo.html +0 -190
  156. data/web/rdoc/files/README.html +0 -274
  157. data/web/rdoc/files/Rakefile.html +0 -101
  158. data/web/rdoc/files/lib/reap/bin/reap_rb.html +0 -129
  159. data/web/rdoc/files/lib/reap/lint_rb.html +0 -101
  160. data/web/rdoc/files/lib/reap/projectinfo_rb.html +0 -110
  161. data/web/rdoc/files/lib/reap/readymade_rb.html +0 -123
  162. data/web/rdoc/files/lib/reap/task/announce_rb.html +0 -114
  163. data/web/rdoc/files/lib/reap/task/fileperm_rb.html +0 -108
  164. data/web/rdoc/files/lib/reap/task/info_rb.html +0 -108
  165. data/web/rdoc/files/lib/reap/task/install_rb.html +0 -108
  166. data/web/rdoc/files/lib/reap/task/noop_rb.html +0 -108
  167. data/web/rdoc/files/lib/reap/task/package_rb.html +0 -109
  168. data/web/rdoc/files/lib/reap/task/publish_rb.html +0 -108
  169. data/web/rdoc/files/lib/reap/task/rdoc_rb.html +0 -108
  170. data/web/rdoc/files/lib/reap/task/scaffold_rb.html +0 -107
  171. data/web/rdoc/files/lib/reap/task/test_rb.html +0 -110
  172. data/web/rdoc/files/lib/reap/task/testext_rb.html +0 -109
  173. data/web/rdoc/files/lib/reap/task/webpublish_rb.html +0 -108
  174. data/web/rdoc/files/lib/reap/task_rb.html +0 -120
  175. data/web/rdoc/files/lib/reap/tasks_rb.html +0 -116
  176. data/web/rdoc/files/lib/reap/test_rb.html +0 -109
  177. data/web/rdoc/fr_class_index.html +0 -47
  178. data/web/rdoc/fr_file_index.html +0 -51
  179. data/web/rdoc/fr_method_index.html +0 -124
  180. data/web/rdoc/index.html +0 -24
  181. data/web/rdoc/rdoc-style.css +0 -208
data/ProjectInfo CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  TITLE : Reap
4
4
  NAME : reap
5
- DATE : '2005-10-06'
6
- SERIES : '4.0'
5
+ VERSION : '4.3.1'
6
+ DATE : '2006-02-01'
7
7
  STATUS : 'beta/stable'
8
8
 
9
9
  AUTHOR : Thomas Sawyer
@@ -17,13 +17,25 @@ DESCRIPTION: >
17
17
  Reap utilizes a YAML configuration file to harvest project
18
18
  information, significantly simplifying usage.
19
19
 
20
- DISTRIBUTE : [ gem, tar.bz2, zip ] # tar.gz, tbz, tgz
20
+ DISTRIBUTE : [ tar.bz2, gem ] # zip, tar.gz, tbz, tgz, deb
21
21
  DEPENDENCIES : [ facets ]
22
22
  EXECUTABLES : [ reap ]
23
23
 
24
+ PACKAGE:
25
+ dir: '../DISTRIBUTION'
26
+ exclude:
27
+ - dist
28
+ - dev
29
+ - scrap
30
+ - web
31
+
24
32
  RUBYFORGE:
25
- PROJECT: reap
26
- USERNAME: transami
33
+ project : reap
34
+ username : transami
35
+
36
+ RELEASE:
37
+ host : rubyforge.org # only one supported currently
38
+ project_id :
27
39
 
28
40
  PUBLISH:
29
41
  type : web
@@ -32,7 +44,7 @@ PUBLISH:
32
44
  dir : web
33
45
 
34
46
  RDOC:
35
- dir: 'web/rdoc'
47
+ dir: 'web/doc/api'
36
48
  include:
37
49
  - 'A-Z*'
38
50
  - 'lib/**/*'
data/lib/reap/bin/reap.rb CHANGED
@@ -1,18 +1,37 @@
1
1
 
2
- require 'facets'
2
+ # Support libraries
3
3
  require 'rbconfig'
4
- require 'carat/shellcommand'
5
- require 'reap/tasks'
6
-
7
- INFO_FILES = [ 'ProjectInfo', 'Reapfile', 'projectinfo', 'reapfile' ]
4
+ require 'facets'
5
+ require 'calibre/consoleapp'
6
+
7
+ # Reap support
8
+ require 'reap/projectinfo'
9
+
10
+ # Reap tasks
11
+ require 'reap/task/fileperm'
12
+ require 'reap/task/test'
13
+ require 'reap/task/testext'
14
+ require 'reap/task/rdoc'
15
+ require 'reap/task/announce'
16
+ require 'reap/task/package'
17
+ require 'reap/task/publish'
18
+ require 'reap/task/info'
19
+ require 'reap/task/install'
20
+ require 'reap/task/noop'
21
+ #require 'reap/task/webpublish'
8
22
 
9
23
  Reap.register
10
24
 
11
25
  module Reap
12
- Version = "2005-10-06"
26
+ Version = "1.2.0"
13
27
  end
14
28
 
15
- class ReapCommand < ShellCommand
29
+ class ReapCommand < Console::Application
30
+
31
+ # to do first for exvery task
32
+ #def application_setup
33
+ # $PROJECT_INFO = ProjectInfo.new( $PROJECT_FILE )
34
+ #end
16
35
 
17
36
  # Options
18
37
 
@@ -40,6 +59,12 @@ class ReapCommand < ShellCommand
40
59
  def __tasks; tasks ; end
41
60
  alias_method :_t, :__tasks
42
61
 
62
+ #option for build version (only for package task)
63
+ def _b ; $BUILD_VERSION = true ; end
64
+
65
+ #def _f( pif ) ; $PROJECT_FILE = pif ; end
66
+ #alias_method :_f, :__file
67
+
43
68
  # option for require
44
69
  #def __require(r); @require = r ; end
45
70
  #alias_method :_r, :__require
@@ -65,10 +90,10 @@ class ReapCommand < ShellCommand
65
90
 
66
91
  # list available tasks
67
92
  def tasks
68
- Reap.initialize #_all
93
+ #Reap.initialize #_all
69
94
  puts
70
- Reap.tasks.each do |name,task|
71
- puts " #{name}".ljust(20) + "#{task.task_desc}"
95
+ Reap.tasks.each do |name,task_class|
96
+ puts " #{name}".ljust(20) + "#{task_class.task_desc}"
72
97
  end
73
98
  puts
74
99
  exit 0
@@ -91,9 +116,9 @@ class ReapCommand < ShellCommand
91
116
  exit 0
92
117
  end
93
118
 
94
- Reap.registry.each do |sym,taskclass|
119
+ Reap.tasks.each do |sym,taskclass|
95
120
  define_method(sym) do |*args|
96
- taskclass.new.run(*args)
121
+ taskclass.new(*args)
97
122
  end
98
123
  end
99
124
 
@@ -108,11 +133,14 @@ HELP = <<-HERE
108
133
 
109
134
  COMMANDS:
110
135
 
111
- scaffold
136
+ template
112
137
  Copies a ProjectInfo template into the current
113
- directory, if it doesn't already exist. If it does
114
- exist will build the project directory based on it.
115
- This will not destroy any structure already in place!
138
+ directory, if it doesn't already exist.
139
+
140
+ scaffold
141
+ Builds a project directory based on settings of
142
+ project information file. This will not destroy
143
+ any structure already in place!
116
144
 
117
145
  help
118
146
  Displays this help information.
@@ -128,6 +156,9 @@ HELP = <<-HERE
128
156
  -D --debug
129
157
  Provides extra verbose processing information.
130
158
 
159
+ -f --file
160
+ Specify alternate project file.
161
+
131
162
  -h --help
132
163
  Display this help information.
133
164
 
File without changes
@@ -0,0 +1,247 @@
1
+
2
+ require "enumerator"
3
+ require "http-access2"
4
+
5
+ require 'reap/iface/interface.rb'
6
+
7
+
8
+ class RubyForgeInterface < Interface
9
+
10
+ attr_accessor :username, :password, :cookie_jar
11
+
12
+ def initialize( master, section )
13
+
14
+ @name = master['name']
15
+
16
+ @username = master['rubyforge']['username'] || section['username']
17
+
18
+ @packge_id = section['package_id']
19
+ @lockfile_id = section['lockfile_id']
20
+
21
+ @group_id = section['group_id'] || 1024 # this is codeforpeople. it's just a default...
22
+ @private = section['private'] ? 0 : 1
23
+
24
+ # internal use
25
+ @uri = "http://rubyforge.org"
26
+ @cookie_jar = File::join(File::expand_path("~"), ".rubyforge.cookie_jar")
27
+
28
+ end
29
+
30
+
31
+ # config = {
32
+ # "username" => "username", # this must be your username
33
+ # "password" => "password", # this must be your password
34
+ #
35
+ # "group_id" => 1024, # this is codeforpeople. it's just a default...
36
+ #
37
+ # "package_ids" => { # configure shortcuts for your packages here
38
+ # "traits" => 1241,
39
+ # "lockfile" => 1242,
40
+ # },
41
+ #
42
+ # "uri" => "http://rubyforge.org",
43
+ # "cookie_jar" => File::join(File::expand_path("~"), ".rubyforge.cookie_jar"),
44
+ # }
45
+ #
46
+ # opts =
47
+ # GetoptLong::new(
48
+ # [ "--username" , "-u" , GetoptLong::REQUIRED_ARGUMENT ] ,
49
+ # [ "--password" , "-p" , GetoptLong::REQUIRED_ARGUMENT ] ,
50
+ # [ "--cookie_jar" , "-c" , GetoptLong::REQUIRED_ARGUMENT ]
51
+ # ).enum_for.inject({}){|h,kv| h.update Hash[*kv]}
52
+ #
53
+ # username = opts['username'] || config['username']
54
+ # password = opts['password'] || config['password']
55
+ # cookie_jar = opts["cookie_jar"] || config['cookie_jar']
56
+ #
57
+ # setup
58
+ #
59
+ # mode = ARGV.shift
60
+ # abort "#{ $0 } [login|create_package (package_name)|add_package (package_id release_name release.ext)]" unless mode
61
+
62
+ def setup
63
+
64
+ page, form, method = nil
65
+ extheader = {}
66
+
67
+ case mode
68
+
69
+ when %r/login/
70
+ page = "/account/login.php"
71
+ method = "post_content"
72
+
73
+ form = {
74
+ "return_to" => "",
75
+ "form_loginname" => username,
76
+ "form_pw" => password,
77
+ "login" => "Login"
78
+ }
79
+
80
+ when %r/create_package/
81
+ page = "/frs/admin/index.php"
82
+ method = "post_content"
83
+
84
+ opts =
85
+ GetoptLong::new(
86
+ [ "--group_id" , "-g" , GetoptLong::REQUIRED_ARGUMENT ] ,
87
+ [ "--is_private" , "-P" , GetoptLong::REQUIRED_ARGUMENT ]
88
+ ).enum_for.inject({}){|h,kv| h.update Hash[*kv]}
89
+
90
+ package_name = ARGV.shift
91
+ abort "#{ $0 } package_name" unless package_name
92
+
93
+ group_id = opts["group_id"] || config["group_id"]
94
+ is_public = opts["is_private"] ? 0 : 1
95
+
96
+ form = {
97
+ "group_id" => group_id,
98
+ "package_name" => package_name,
99
+ "func" => "add_package",
100
+ "is_public" => is_public,
101
+ "submit" => "Create This Package",
102
+ }
103
+
104
+ when %r/add_release/
105
+ page = "/frs/admin/qrs.php"
106
+ method = "post_content"
107
+
108
+ opts =
109
+ GetoptLong::new(
110
+ [ "--group_id" , "-g" , GetoptLong::REQUIRED_ARGUMENT ] ,
111
+ [ "--release_date" , "-r" , GetoptLong::REQUIRED_ARGUMENT ] ,
112
+ [ "--type_id" , "-t" , GetoptLong::REQUIRED_ARGUMENT ] ,
113
+ [ "--processor_id" , "-P" , GetoptLong::REQUIRED_ARGUMENT ] ,
114
+ [ "--release_nots" , "-n" , GetoptLong::REQUIRED_ARGUMENT ] ,
115
+ [ "--release_changes" , "-a" , GetoptLong::REQUIRED_ARGUMENT ]
116
+ ).enum_for.inject({}){|h,kv| h.update Hash[*kv]}
117
+
118
+ package_id, release_name, userfile, ignored = ARGV
119
+ abort "#{ $0 } package_name" unless
120
+ package_id and release_name and userfile
121
+
122
+ package_id = config["package_ids"][package_id] unless
123
+ package_id =~ %r/^\d+$/
124
+
125
+ group_id = opts["group_id"] || config["group_id"]
126
+ release_date = opts["release_date"] || Time::now.strftime('%Y-%m-%d %H:%M')
127
+
128
+ type_id = opts['type_id'] || userfile[%r|\.[^\./]+$|]
129
+ type_id = {
130
+ ".deb" => 1000,
131
+ ".rpm" => 2000,
132
+ ".zip" => 3000,
133
+ ".bz2" => 3100,
134
+ ".gz" => 3110,
135
+ ".src.zip" => 5000,
136
+ ".src.bz2" => 5010,
137
+ ".src.gz" => 5020,
138
+ ".src.rpm" => 5100,
139
+ ".src" => 5900,
140
+ ".jpg" => 8000,
141
+ ".txt" => 8100,
142
+ ".text" => 8100,
143
+ ".htm" => 8200,
144
+ ".html" => 8200,
145
+ ".pdf" => 8300,
146
+ ".oth" => 9999,
147
+ ".ebuild" => 1300,
148
+ ".exe" => 1100,
149
+ ".dmg" => 1200,
150
+ ".tar.gz" => 5000,
151
+ ".tgz" => 5000,
152
+ ".gem" => 1400,
153
+ ".pgp" => 8150,
154
+ ".sig" => 8150,
155
+ }[type_id]
156
+
157
+ processor_id = opts['processor_id'] || 'Any'
158
+ processor_id = {
159
+ "i386" => 1000,
160
+ "IA64" => 6000,
161
+ "Alpha" => 7000,
162
+ "Any" => 8000,
163
+ "PPC" => 2000,
164
+ "MIPS" => 3000,
165
+ "Sparc" => 4000,
166
+ "UltraSparc" => 5000,
167
+ "Other" => 9999,
168
+ }[processor_id]
169
+
170
+ release_notes = opts['release_notes'] || nil
171
+ release_notes = open(release_notes) if release_notes
172
+
173
+ release_changes = opts['release_changes'] || nil
174
+ release_changes = open(release_changes) if release_changes
175
+
176
+ userfile = open(userfile)
177
+
178
+ preformatted = '1'
179
+
180
+ form = {
181
+ "group_id" => group_id,
182
+ "package_id" => package_id,
183
+ "release_name" => release_name,
184
+ "release_date" => release_date,
185
+ "type_id" => type_id,
186
+ "processor_id" => processor_id,
187
+ "preformatted" => preformatted,
188
+ "userfile" => userfile,
189
+ "submit" => "Release File"
190
+ }
191
+
192
+ boundary = Array::new(8){ "%2.2d" % rand(42) }.join('__')
193
+ extheader['content-type'] = "multipart/form-data; boundary=___#{ boundary }___"
194
+
195
+ else
196
+ abort "#{ $0 } login create_package add_release"
197
+
198
+ end
199
+ #
200
+ # http transaction
201
+ #
202
+ client = HTTPAccess2::Client::new ENV['HTTP_PROXY']
203
+ client.debug_dev = STDERR if ENV['DEBUG']
204
+
205
+ client.set_cookie_store cookie_jar
206
+
207
+ # fixes http-access2 bug
208
+ client.redirect_uri_callback = lambda do |res|
209
+ page = res.header['location'].first
210
+ page = page =~ %r/http/ ? page : "#{ config['uri'] }/#{ page }"
211
+ page
212
+ end
213
+
214
+ response = client.send "#{ method }", "#{ config['uri'] }/#{ page }", form, extheader
215
+
216
+ client.save_cookie_store
217
+
218
+ # fixes http-access2 bug
219
+ BEGIN {
220
+ require "http-access2"
221
+ module WebAgent::CookieUtils
222
+ def domain_match(host, domain)
223
+ case domain
224
+ when /\d+\.\d+\.\d+\.\d+/
225
+ return (host == domain)
226
+ when '.'
227
+ return true
228
+ when /^\./
229
+ #return tail_match?(domain, host)
230
+ return tail_match?(host, domain)
231
+ else
232
+ return (host == domain)
233
+ end
234
+ end
235
+ end
236
+
237
+ }
238
+
239
+
240
+
241
+
242
+
243
+
244
+ end
245
+
246
+
247
+
data/lib/reap/lint.rb CHANGED
@@ -0,0 +1 @@
1
+ # TODO
@@ -1,42 +1,70 @@
1
1
 
2
2
  require 'yaml'
3
+
3
4
  require 'facet/hash/traverse'
4
5
  require 'facet/string/tabto'
5
6
  require 'facet/dir/self/ascend'
6
7
 
7
- module ProjectInfo
8
- extend self
8
+
9
+ class ProjectInfo
9
10
 
10
11
  INFO_FILES = [ 'ProjectInfo', 'ReapFile', 'projectinfo', 'reapfile' ]
11
12
 
12
- def add_info_file( f )
13
+ def self.add_info_file( f )
13
14
  INFO_FILES.unshift( f )
14
15
  end
15
16
 
16
- def info_stream
17
- dir = Dir.pwd
18
- unless @info_stream
17
+ #def self.[](name)
18
+ # @self ||= self.new
19
+ # @self[name]
20
+ #end
21
+
22
+ attr_reader :info, :info_stream
23
+
24
+ def initialize( info_file=nil )
25
+ unless info_file
19
26
  Dir.ascend(Dir.pwd) do |d|
20
27
  Dir.chdir(d)
21
28
  info_file = INFO_FILES.find{ |f| File.file?( f ) }
22
- if info_file
23
- @info_stream = File.read( info_file )
24
- puts "(in #{d})" unless dir == Dir.pwd
25
- break
26
- end
29
+ break if info_file
27
30
  end
28
31
  end
29
- @info_stream
30
- end
31
-
32
- def info
33
- if info_stream
34
- @info ||= YAML::load(info_stream).traverse{ |k,v| [k.downcase, v] }
32
+ if info_file
33
+ @info_stream = File.read( info_file )
34
+ @info = YAML::load( @info_stream ).traverse{ |k,v| [k.downcase, v] }
35
+ puts "(in #{Dir.pwd})" #unless dir == Dir.pwd
35
36
  else
36
- {}
37
+ @info_stream = ""
38
+ @info = {}
39
+ puts "(without a project information file)"
37
40
  end
38
41
  end
39
42
 
43
+ # def info_stream
44
+ # dir = Dir.pwd
45
+ # unless @info_stream
46
+ # Dir.ascend(Dir.pwd) do |d|
47
+ # Dir.chdir(d)
48
+ # info_file = INFO_FILES.find{ |f| File.file?( f ) }
49
+ # if info_file
50
+ # @info_stream = File.read( info_file )
51
+ # puts "(in #{d})" unless dir == Dir.pwd
52
+ # break
53
+ # end
54
+ # end
55
+ # end
56
+ # @info_stream
57
+ # end
58
+
59
+ # def info
60
+ # @info
61
+ # #if info_stream
62
+ # # @info ||= YAML::load(info_stream).traverse{ |k,v| [k.downcase, v] }
63
+ # #else
64
+ # # {}
65
+ # #end
66
+ # end
67
+
40
68
  # not using at the moment
41
69
  def validate
42
70
  # required main parameters
@@ -48,4 +76,5 @@ module ProjectInfo
48
76
  def [](name)
49
77
  info[name]
50
78
  end
79
+
51
80
  end
data/lib/reap/reap.rb ADDED
File without changes
@@ -10,11 +10,9 @@ require 'facet/string/word_wrap'
10
10
 
11
11
  class Reap::Announce < Reap::Task
12
12
 
13
- section_required true
13
+ task_desc "Send announcement email to ruby-talk or other address."
14
14
 
15
- def task_desc
16
- "Send announcement email to ruby-talk or other address."
17
- end
15
+ section_required true
18
16
 
19
17
  attr_accessor :title, :version, :summary, :description, :subject
20
18
  attr_accessor :to, :from, :server, :port, :domain, :account
@@ -35,7 +33,7 @@ class Reap::Announce < Reap::Task
35
33
  raise "account is a require announce field" if @account.empty?
36
34
 
37
35
  @title ||= master['title']
38
- @version ||= master['version']
36
+ @version ||= master['version'] || master['date']
39
37
  @summary ||= master['summary']
40
38
  @description ||= master['description']
41
39
  @links ||= []
@@ -60,7 +58,7 @@ class Reap::Announce < Reap::Task
60
58
  abstract = ''
61
59
  if @description
62
60
  abstract << "\n\n"
63
- abstract << "ABSTRACT: #{@description}".word_wrap(72)
61
+ abstract << "ABSTRACT: #{@description}"
64
62
  abstract << "\n"
65
63
  end
66
64
 
@@ -86,28 +84,28 @@ class Reap::Announce < Reap::Task
86
84
  memo = ''
87
85
  if @memo
88
86
  memo = ''
89
- memo << "\n" << ('-' * 72) << "\n"
87
+ memo << "\n---\n" #<< ('-' * 72) << "\n"
90
88
  memo << "(Memo)\n\n"
91
- memo << @memo.fold.word_wrap(72)
89
+ memo << @memo.fold(true) #.word_wrap(67)
92
90
  #memo << "\n"
93
91
  end
94
92
 
95
93
  # msg file
96
94
  msg = ''
97
95
  if @file and File.file?( @file )
98
- msg << "\n" << ("-" * 72) << "\n"
96
+ msg << "\n---\n" #<< ("-" * 68) << "\n"
99
97
  msg << "(from #{@file})\n\n"
100
98
  mg = ''
101
99
  File.open( @file ) { |f| mg << f.gets(nil) }
102
- msg << mg.fold.word_wrap(72)
100
+ msg << mg.fold(true) #.word_wrap(67)
103
101
  end
104
102
 
105
103
  # stamp
106
104
  stamp = ''
107
- stamp << "\n" << ("-" * 72) << "\n"
105
+ stamp << "\n---\n" #<< ("-" * 68) << "\n"
108
106
  stamp << %Q{
109
- |Generated by Reap, a Rake-based Ruby Project Assistant.
110
- |Do you Ruby? (http://www.ruby-lang.org)
107
+ |Generated by REAP, the Ruby Project Assistant
108
+ |http://www.ruby-lang.org -- Do you Ruby?
111
109
  }.margin
112
110
  stamp << "\n\n"
113
111
 
@@ -6,13 +6,10 @@ require 'reap/task'
6
6
  #
7
7
  class Reap::Perm < Reap::Task
8
8
 
9
- attr_accessor :user, :group, :filemod, :dirmod
10
-
9
+ task_desc "Normalize ownership and permissions of package files."
11
10
  section_required true
12
11
 
13
- def task_desc
14
- "Normalize ownership and permissions of package files."
15
- end
12
+ attr_accessor :user, :group, :filemod, :dirmod
16
13
 
17
14
  def init
18
15
  @user = section['user']
@@ -6,15 +6,13 @@ require 'reap/task'
6
6
  #
7
7
  class Reap::Info < Reap::Task
8
8
 
9
- def task_desc
10
- "Display ProjectInfo file."
11
- end
9
+ task_desc "Display ProjectInfo file."
12
10
 
13
11
  def init
14
12
  end
15
13
 
16
14
  def run
17
- puts ProjectInfo.info_stream
15
+ puts $PROJECT_INFO.info_stream
18
16
  end
19
17
 
20
18
  end
@@ -6,9 +6,7 @@ require 'reap/task'
6
6
  #
7
7
  class Reap::Install < Reap::Task
8
8
 
9
- def task_desc
10
- "Locally install package using setup.rb or install.rb."
11
- end
9
+ task_desc "Locally install package using setup.rb or install.rb."
12
10
 
13
11
  attr_accessor :options, :quiet #, :sudo
14
12
 
@@ -10,9 +10,7 @@ require 'reap/task'
10
10
  #
11
11
  class Reap::Noop < Reap::Task
12
12
 
13
- def task_desc
14
- "A no-op task to help debug reap itself."
15
- end
13
+ task_desc "A no-op task to help debug reap itself."
16
14
 
17
15
  attr_accessor :message
18
16