vcs 0.2.148 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/AUTHORS +6 -0
  2. data/NEWS +9 -0
  3. data/README +82 -0
  4. data/Rakefile +7 -72
  5. data/SPEC.dyn.yml +10 -0
  6. data/SPEC.gemspec +14 -0
  7. data/SPEC.yml +39 -0
  8. data/bin/vcs +18 -16
  9. data/lib/vcs/changelog.rb +164 -0
  10. data/lib/vcs/conflict.rb +21 -0
  11. data/{src → lib/vcs}/cvs.rb +1 -1
  12. data/{src → lib/vcs}/diff.rb +2 -2
  13. data/lib/vcs/diffstat.rb +28 -0
  14. data/lib/vcs/edit.rb +16 -0
  15. data/{src → lib/vcs}/last_changed_date.rb +3 -5
  16. data/{src → lib/vcs}/mail.rb +4 -4
  17. data/lib/vcs/message.rb +79 -0
  18. data/{src → lib/vcs}/mycommit.rb +15 -15
  19. data/{src → lib/vcs}/news.rb +6 -6
  20. data/{src → lib/vcs}/prcs.rb +1 -1
  21. data/{src → lib/vcs}/revision.rb +3 -4
  22. data/lib/vcs/script.rb +19 -0
  23. data/{src → lib/vcs}/status.rb +1 -1
  24. data/{src → lib/vcs}/svn.rb +3 -5
  25. data/lib/vcs/url.rb +16 -0
  26. data/lib/vcs/vcs.rb +279 -0
  27. metadata +52 -150
  28. data/TODO +0 -19
  29. data/doc/jamis.rb +0 -564
  30. data/ruby_ex/abstract.rb +0 -254
  31. data/ruby_ex/abstract_node.rb +0 -85
  32. data/ruby_ex/algorithms/simulated_annealing.rb +0 -140
  33. data/ruby_ex/array_each_pair.rb +0 -18
  34. data/ruby_ex/ask.rb +0 -101
  35. data/ruby_ex/attributed_class.rb +0 -302
  36. data/ruby_ex/cache.rb +0 -373
  37. data/ruby_ex/checkout.rb +0 -12
  38. data/ruby_ex/choose.rb +0 -271
  39. data/ruby_ex/commands.rb +0 -18
  40. data/ruby_ex/commands/command.rb +0 -401
  41. data/ruby_ex/commands/datas.rb +0 -16
  42. data/ruby_ex/commands/datas/data.rb +0 -33
  43. data/ruby_ex/commands/datas/factory.rb +0 -66
  44. data/ruby_ex/commands/factory.rb +0 -66
  45. data/ruby_ex/commands/helpers.rb +0 -67
  46. data/ruby_ex/commands/pipe.rb +0 -64
  47. data/ruby_ex/commands/runners.rb +0 -17
  48. data/ruby_ex/commands/runners/exec.rb +0 -49
  49. data/ruby_ex/commands/runners/fork.rb +0 -97
  50. data/ruby_ex/commands/runners/runner.rb +0 -107
  51. data/ruby_ex/commands/seq.rb +0 -27
  52. data/ruby_ex/config_file.rb +0 -96
  53. data/ruby_ex/const_regexp.rb +0 -59
  54. data/ruby_ex/daemon.rb +0 -134
  55. data/ruby_ex/diff.rb +0 -667
  56. data/ruby_ex/dlogger.rb +0 -62
  57. data/ruby_ex/drb/dispatcher.rb +0 -252
  58. data/ruby_ex/drb/dispatcher_server_test.rb +0 -29
  59. data/ruby_ex/drb/drb_observable.rb +0 -97
  60. data/ruby_ex/drb/drb_observable_pool.rb +0 -27
  61. data/ruby_ex/drb/drb_service.rb +0 -43
  62. data/ruby_ex/drb/drb_undumped_attributes.rb +0 -55
  63. data/ruby_ex/drb/drb_undumped_indexed_object.rb +0 -54
  64. data/ruby_ex/drb/insecure_protected_methods.rb +0 -103
  65. data/ruby_ex/drb/session_client_test.rb +0 -40
  66. data/ruby_ex/drb/session_manager.rb +0 -246
  67. data/ruby_ex/drb/session_server.rb +0 -53
  68. data/ruby_ex/dtime.rb +0 -143
  69. data/ruby_ex/dumpable_proc.rb +0 -63
  70. data/ruby_ex/exception.rb +0 -32
  71. data/ruby_ex/filetype.rb +0 -229
  72. data/ruby_ex/fileutils_ex.rb +0 -44
  73. data/ruby_ex/fold.rb +0 -58
  74. data/ruby_ex/generate_id.rb +0 -44
  75. data/ruby_ex/hookable.rb +0 -262
  76. data/ruby_ex/hooker.rb +0 -54
  77. data/ruby_ex/inactive_timeout.rb +0 -137
  78. data/ruby_ex/indexed_node.rb +0 -66
  79. data/ruby_ex/io_marshal.rb +0 -100
  80. data/ruby_ex/ioo.rb +0 -194
  81. data/ruby_ex/labeled_node.rb +0 -63
  82. data/ruby_ex/logger_observer.rb +0 -23
  83. data/ruby_ex/md5sum.rb +0 -66
  84. data/ruby_ex/mktemp.rb +0 -208
  85. data/ruby_ex/module/attr_once.rb +0 -36
  86. data/ruby_ex/module/autoload_tree.rb +0 -75
  87. data/ruby_ex/module/hierarchy.rb +0 -335
  88. data/ruby_ex/module/instance_method_visibility.rb +0 -73
  89. data/ruby_ex/module_ex.rb +0 -11
  90. data/ruby_ex/node.rb +0 -80
  91. data/ruby_ex/object_monitor.rb +0 -145
  92. data/ruby_ex/object_monitor_activity.rb +0 -33
  93. data/ruby_ex/observable.rb +0 -140
  94. data/ruby_ex/observable_pool.rb +0 -293
  95. data/ruby_ex/orderedhash.rb +0 -252
  96. data/ruby_ex/pathname_ex.rb +0 -152
  97. data/ruby_ex/pp_hierarchy.rb +0 -29
  98. data/ruby_ex/pseudo_cache.rb +0 -190
  99. data/ruby_ex/queue.rb +0 -56
  100. data/ruby_ex/random_generators.rb +0 -25
  101. data/ruby_ex/random_generators/random_generator.rb +0 -31
  102. data/ruby_ex/random_generators/ruby.rb +0 -23
  103. data/ruby_ex/safe_eval.rb +0 -348
  104. data/ruby_ex/sendmail.rb +0 -215
  105. data/ruby_ex/service_manager.rb +0 -121
  106. data/ruby_ex/session/administrable.rb +0 -120
  107. data/ruby_ex/session/client.rb +0 -153
  108. data/ruby_ex/session/const.rb +0 -18
  109. data/ruby_ex/session/dispatcher.rb +0 -184
  110. data/ruby_ex/session/error.rb +0 -21
  111. data/ruby_ex/session/fetchable.rb +0 -57
  112. data/ruby_ex/session/fetcher.rb +0 -62
  113. data/ruby_ex/session/hookable.rb +0 -26
  114. data/ruby_ex/session/profile.rb +0 -110
  115. data/ruby_ex/session/server.rb +0 -582
  116. data/ruby_ex/session/test/administrable_test.rb +0 -337
  117. data/ruby_ex/session/test/basic_test.rb +0 -523
  118. data/ruby_ex/session/test/dispatcher_test.rb +0 -409
  119. data/ruby_ex/session/test/fetchable_test.rb +0 -119
  120. data/ruby_ex/session/test/sub_server_test.rb +0 -188
  121. data/ruby_ex/shuffle.rb +0 -30
  122. data/ruby_ex/spring.rb +0 -136
  123. data/ruby_ex/spring_set.rb +0 -137
  124. data/ruby_ex/string_ex.rb +0 -28
  125. data/ruby_ex/symtbl.rb +0 -106
  126. data/ruby_ex/synflow.rb +0 -474
  127. data/ruby_ex/test/unit/ui/yaml/testrunner.rb +0 -164
  128. data/ruby_ex/thread_mutex.rb +0 -10
  129. data/ruby_ex/timeout_ex.rb +0 -81
  130. data/ruby_ex/top_down.rb +0 -73
  131. data/ruby_ex/trace.rb +0 -26
  132. data/ruby_ex/uri/druby.rb +0 -81
  133. data/ruby_ex/uri/file.rb +0 -65
  134. data/ruby_ex/uri/ftp_ex.rb +0 -37
  135. data/ruby_ex/uri/http_ex.rb +0 -43
  136. data/ruby_ex/uri/ssh.rb +0 -92
  137. data/ruby_ex/uri/svn.rb +0 -118
  138. data/ruby_ex/uri_ex.rb +0 -45
  139. data/ruby_ex/verbose_object.rb +0 -30
  140. data/ruby_ex/version.rb +0 -66
  141. data/ruby_ex/yaml/basenode_ext.rb +0 -63
  142. data/ruby_ex/yaml/chop_header.rb +0 -23
  143. data/ruby_ex/yaml/transform.rb +0 -449
  144. data/ruby_ex/yaml/yregexpath.rb +0 -76
  145. data/src/ask.rb +0 -101
  146. data/src/changelog.rb +0 -117
  147. data/src/conflict.rb +0 -20
  148. data/src/diffstat.rb +0 -42
  149. data/src/message.rb +0 -64
  150. data/src/reply-mail.rb +0 -14
  151. data/src/tools.rb +0 -22
  152. data/src/vcs.rb +0 -176
@@ -1,44 +0,0 @@
1
- # Copyright: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
- # Author: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
- # License: Gnu General Public License.
4
-
5
- # $LastChangedBy: polrop $
6
- # $Id: fileutils_ex.rb 159 2005-02-18 12:07:23Z polrop $
7
-
8
- require 'fileutils'
9
-
10
- module FileUtils
11
-
12
- alias remove_dir_without_chmod remove_dir
13
-
14
- def remove_dir (dir, force = false) #:nodoc:
15
- dir = dir.sub(%r</\z>, '')
16
- first_time_p = true
17
- begin
18
- Dir.foreach(dir) do |file|
19
- next if /\A\.\.?\z/ =~ file
20
- path = "#{dir}/#{file.untaint}"
21
- if File.symlink?(path)
22
- remove_file path, force
23
- elsif File.directory?(path)
24
- remove_dir path, force
25
- else
26
- remove_file path, force
27
- end
28
- end
29
- begin
30
- Dir.rmdir dir
31
- rescue Errno::ENOENT
32
- raise unless force
33
- end
34
- rescue
35
- if first_time_p
36
- first_time_p = false
37
- File.chmod 0777, dir
38
- retry
39
- end
40
- raise
41
- end
42
- end
43
-
44
- end
@@ -1,58 +0,0 @@
1
- # Copyright: Copyright (c) 2004 Nicolas Pouillard. All rights reserved.
2
- # Author: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
- # License: Gnu General Public License.
4
-
5
- # $LastChangedBy: ertai $
6
- # $Id: fold.rb 186 2005-04-03 00:07:45Z ertai $
7
-
8
-
9
- class Object
10
-
11
- def rec_fold
12
- if respond_to?(:fold)
13
- return fold({}) do |k1, v1, acc1|
14
- yield(k1, v1.rec_fold { |k2, v2, acc2| yield(k2, v2, acc2) }, acc1)
15
- end
16
- else
17
- return self
18
- end
19
- end
20
-
21
- end # class Object
22
-
23
-
24
- class Hash
25
-
26
- def fold(init, &block)
27
- acc = init
28
- self.each do |k,v|
29
- acc = block[k, v, acc]
30
- end
31
- acc
32
- end
33
-
34
- end # class Hash
35
-
36
-
37
- class Array
38
-
39
- def fold(init, &block)
40
- acc = init
41
- self.each do |elt|
42
- acc = block[elt, self[elt], acc]
43
- end
44
- acc
45
- end
46
-
47
- def reverse_fold(init, &block)
48
- acc = init
49
- self.reverse_each do |elt|
50
- acc = block[elt, self[elt], acc]
51
- end
52
- acc
53
- end
54
-
55
- end # class Array
56
-
57
-
58
-
@@ -1,44 +0,0 @@
1
- # Copyright:: Copyright (c) 2004 Nicolas Despres. All rights reserved.
2
- # Author:: Nicolas Despres <polrop@lrde.epita.fr>.
3
- # License:: Gnu General Public License.
4
- # Revision:: $Id: generate_id.rb 214 2005-05-06 13:12:41Z ertai $
5
-
6
-
7
- require 'md5'
8
-
9
- module Kernel
10
-
11
- def generate_id(&already_exist)
12
- md5 = Digest::MD5::new
13
- id = ''
14
- begin
15
- md5.update(id)
16
- md5.update(Time.now.to_s)
17
- md5.update(rand.to_s)
18
- md5.update($$.to_s)
19
- md5.update($0)
20
- id = md5.hexdigest[0,16]
21
- end while block_given? and already_exist[id]
22
- id
23
- end
24
-
25
- end # module Kernel
26
-
27
-
28
-
29
- if $0 == __FILE__
30
- require 'test/unit'
31
- class GenerateIdTest < Test::Unit::TestCase
32
- def test_simple
33
- tab = []
34
- 100.times { tab << generate_id }
35
- assert_equal(tab.size, tab.uniq.size)
36
- end
37
- def test_simple
38
- tab = []
39
- bool = true
40
- 100.times { tab << generate_id { bool = !bool ; bool } }
41
- assert_equal(tab.size, tab.uniq.size)
42
- end
43
- end
44
- end
@@ -1,262 +0,0 @@
1
- # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
- # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
- # License:: Gnu General Public License.
4
- # Revision:: $Id: hookable.rb 216 2005-05-08 11:04:46Z ertai $
5
-
6
- require 'rubygems'
7
- require_gem 'activesupport'
8
- require 'active_support/class_inheritable_attributes'
9
-
10
-
11
-
12
- module Hookable
13
-
14
- def self.included ( aClass )
15
- super
16
-
17
- aClass.module_eval do
18
-
19
- def self.inheritable_attributes
20
- if @inheritable_attributes.nil? or @inheritable_attributes.empty?
21
- @inheritable_attributes = HashWithRecursiveCloneDup.new
22
- end
23
- @inheritable_attributes
24
- end
25
-
26
-
27
- class_inheritable_array :hooks
28
- class_inheritable_array :hookers
29
- inheritable_attributes[:hookers] = []
30
- inheritable_attributes[:hooks] = []
31
-
32
-
33
- def hook_trigger ( name, *args )
34
- self.class.hook_trigger(name, *args)
35
- return unless defined? @hookers
36
- @hookers.each do |hooker|
37
- @@hook_trigger_internal[hooker, name, *args]
38
- end
39
- end
40
-
41
-
42
- def self.hook_trigger ( name, *args )
43
- raise ArgumentError, "Unknown hook #{name}" unless hooks.include? name
44
- hookers.each do |hooker|
45
- @@hook_trigger_internal[hooker, name, *args]
46
- end
47
- end
48
-
49
-
50
- def self.hooker_subscribe ( hooker )
51
- hookers << hooker
52
- end
53
-
54
-
55
- def hooker_subscribe ( hooker )
56
- @hookers ||= []
57
- @hookers << hooker
58
- end
59
-
60
-
61
- def self.hook_declare ( name, *groups )
62
- hooks << name
63
- end
64
-
65
-
66
- @@hook_trigger_internal = lambda do |hooker, name, *args|
67
- if hooker.respond_to?(name)
68
- hooker.send(name, *args)
69
- else
70
- if hooker.respond_to? :default_hook and not hooker.default_hook.nil?
71
- hooker.send(hooker.default_hook, name, *args)
72
- elsif hooker.respond_to?(:method_missing)
73
- hooker.send(name, *args)
74
- end
75
- end
76
- end
77
-
78
- end
79
-
80
- end
81
-
82
-
83
- class HashWithRecursiveCloneDup < Hash
84
-
85
- def initialize_copy ( aHash )
86
- aHash.each { |k, v| self[k] = v.dup }
87
- end
88
-
89
- end # class HashWithRecursiveCloneDup
90
-
91
- end # module Hookable
92
-
93
-
94
-
95
- if $0 == __FILE__
96
-
97
- require 'test/unit'
98
- require 'hooker'
99
-
100
- class HookableHookerTest < Test::Unit::TestCase
101
-
102
- class HookerTest
103
- include Hooker
104
-
105
- attr_reader :stack
106
-
107
- def log ( *args )
108
- @stack ||= []
109
- @stack << args
110
- end
111
-
112
- def method_missing ( *a )
113
- log(:method_missing, *a)
114
- end
115
-
116
- def hook1 ( *a )
117
- log(:hook1, *a)
118
- end
119
-
120
- def reset
121
- @stack.clear if @stack
122
- end
123
- end
124
-
125
-
126
- STATIC_HOOKER_TEST = HookerTest.new
127
-
128
-
129
- class HookableTest
130
- include Hookable
131
-
132
- hook_declare :hook1
133
-
134
- hook_declare :hook2, :group1
135
-
136
- def run
137
- run1
138
- run2
139
- end
140
-
141
- def run1
142
- hook_trigger :hook1
143
- end
144
-
145
- def run2
146
- hook_trigger :hook2, 42
147
- hook_trigger :hook3 rescue nil
148
- end
149
-
150
- def << ( hooker )
151
- hooker_subscribe hooker
152
- end
153
-
154
- hooker_subscribe STATIC_HOOKER_TEST
155
-
156
- def self.ref
157
- [
158
- [[:hook1], [:method_missing, :hook2, 42]],
159
- [[:hook1], [:default, :hook2, 42]],
160
- [[:hook_1_and_2], [:hook_1_and_2, 42]],
161
- [[:hook1], [:method_missing, :default_by_method_missing, :hook2, 42]],
162
- [[:hook1], [:hook2, 42]],
163
- [[:hook1], [:method_missing, :hook2_by_dynamic_hook_method, 42]]
164
- ]
165
- end
166
-
167
- end
168
-
169
-
170
-
171
- class SubHookableTest < HookableTest
172
- hook_declare :hook3
173
-
174
- def self.ref
175
- [
176
- [[:hook1], [:method_missing, :hook2, 42], [:method_missing, :hook3]],
177
- [[:hook1], [:default, :hook2, 42], [:default, :hook3]],
178
- [[:hook_1_and_2], [:hook_1_and_2, 42], [:method_missing, :hook3]],
179
- [[:hook1], [:method_missing, :default_by_method_missing, :hook2, 42],
180
- [:method_missing, :default_by_method_missing, :hook3]],
181
- [[:hook1], [:hook2, 42], [:default, :hook3]],
182
- [[:hook1], [:method_missing, :hook2_by_dynamic_hook_method, 42],
183
- [:method_missing, :hook3]]
184
- ]
185
- end
186
-
187
- end
188
-
189
-
190
-
191
- class HookerTest1 < HookerTest
192
- def default ( *a )
193
- log(:default, *a)
194
- end
195
- hook_default_method :default
196
- end
197
-
198
-
199
-
200
- class HookerTest2 < HookerTest
201
- def hook_1_and_2 ( *a )
202
- log(:hook_1_and_2, *a)
203
- end
204
- hook_method :hook_1_and_2, :hook1, :hook2
205
- end
206
-
207
-
208
-
209
- class HookerTest3 < HookerTest
210
- hook_default_method :default_by_method_missing
211
- end
212
-
213
-
214
-
215
- class HookerTest4 < HookerTest
216
- end
217
-
218
-
219
-
220
- class HookerTest21 < HookerTest1
221
- def hook2 ( *a )
222
- log(:hook2, *a)
223
- end
224
- end
225
-
226
-
227
-
228
- def test_hookable
229
- hookable_checker HookableTest.new
230
- end
231
-
232
-
233
-
234
- def test_sub_hookable
235
- hookable_checker SubHookableTest.new
236
- end
237
-
238
-
239
-
240
- def hookable_checker ( support )
241
- hookers = []
242
- hookers << HookerTest1.new
243
- hookers << HookerTest2.new
244
- hookers << HookerTest3.new
245
- hookers << HookerTest21.new
246
- hooker4 = HookerTest4.new
247
- hookers << hooker4
248
- hookers.each do |hooker|
249
- support << hooker
250
- end
251
- STATIC_HOOKER_TEST.reset
252
- hookers.unshift STATIC_HOOKER_TEST
253
- hooker4.hook_method(:hook2_by_dynamic_hook_method, :hook2)
254
- support.run
255
- hookers.zip(support.class.ref).each do |hooker, ref|
256
- assert_equal(ref, hooker.stack)
257
- end
258
- end
259
-
260
- end
261
-
262
- end
@@ -1,54 +0,0 @@
1
- # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
- # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
- # License:: Gnu General Public License.
4
- # Revision:: $Id: hooker.rb 208 2005-05-05 19:53:50Z ertai $
5
-
6
- require 'rubygems'
7
- require_gem 'activesupport'
8
- require 'active_support/class_inheritable_attributes'
9
-
10
-
11
-
12
- module Hooker
13
-
14
- def self.included ( aClass )
15
- super
16
-
17
- aClass.module_eval do
18
-
19
- class_inheritable_accessor :default_hook
20
-
21
-
22
- def self.hook_default_method ( method )
23
- raise unless method.is_a? Symbol
24
- self.default_hook = method
25
- end
26
-
27
-
28
- def hook_method ( *a )
29
- @@generic_hook_method[method(:instance_eval), *a]
30
- end
31
-
32
-
33
- def self.hook_method ( *a )
34
- @@generic_hook_method[method(:module_eval), *a]
35
- end
36
-
37
-
38
- @@generic_hook_method = lambda do |eval_meth, method, *hook_names|
39
- raise unless method.is_a? Symbol
40
- hook_names.each do |hook_name|
41
- raise unless hook_name.is_a? Symbol
42
- eval_meth[%Q{
43
- def #{hook_name} ( *a, &b )
44
- #{method}(*a, &b)
45
- end
46
- }]
47
- end
48
- end
49
-
50
- end
51
-
52
- end
53
-
54
- end # module Hooker