vcs 0.1 → 0.2.148

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. data/Rakefile +17 -3
  2. data/bin/vcs +57 -34
  3. data/doc/jamis.rb +564 -0
  4. data/ruby_ex/abstract.rb +254 -0
  5. data/ruby_ex/abstract_node.rb +85 -0
  6. data/ruby_ex/algorithms/simulated_annealing.rb +140 -0
  7. data/ruby_ex/array_each_pair.rb +18 -0
  8. data/ruby_ex/ask.rb +101 -0
  9. data/ruby_ex/attributed_class.rb +302 -0
  10. data/ruby_ex/cache.rb +373 -0
  11. data/ruby_ex/checkout.rb +12 -0
  12. data/ruby_ex/choose.rb +271 -0
  13. data/ruby_ex/commands.rb +18 -0
  14. data/ruby_ex/commands/command.rb +401 -0
  15. data/ruby_ex/commands/datas.rb +16 -0
  16. data/ruby_ex/commands/datas/data.rb +33 -0
  17. data/ruby_ex/commands/datas/factory.rb +66 -0
  18. data/ruby_ex/commands/factory.rb +66 -0
  19. data/ruby_ex/commands/helpers.rb +67 -0
  20. data/ruby_ex/commands/pipe.rb +64 -0
  21. data/ruby_ex/commands/runners.rb +17 -0
  22. data/ruby_ex/commands/runners/exec.rb +49 -0
  23. data/ruby_ex/commands/runners/fork.rb +97 -0
  24. data/ruby_ex/commands/runners/runner.rb +107 -0
  25. data/ruby_ex/commands/seq.rb +27 -0
  26. data/ruby_ex/config_file.rb +96 -0
  27. data/ruby_ex/const_regexp.rb +59 -0
  28. data/ruby_ex/daemon.rb +134 -0
  29. data/ruby_ex/diff.rb +667 -0
  30. data/ruby_ex/dlogger.rb +62 -0
  31. data/ruby_ex/drb/dispatcher.rb +252 -0
  32. data/ruby_ex/drb/dispatcher_server_test.rb +29 -0
  33. data/ruby_ex/drb/drb_observable.rb +97 -0
  34. data/ruby_ex/drb/drb_observable_pool.rb +27 -0
  35. data/ruby_ex/drb/drb_service.rb +43 -0
  36. data/ruby_ex/drb/drb_undumped_attributes.rb +55 -0
  37. data/ruby_ex/drb/drb_undumped_indexed_object.rb +54 -0
  38. data/ruby_ex/drb/insecure_protected_methods.rb +103 -0
  39. data/ruby_ex/drb/session_client_test.rb +40 -0
  40. data/ruby_ex/drb/session_manager.rb +246 -0
  41. data/ruby_ex/drb/session_server.rb +53 -0
  42. data/ruby_ex/dtime.rb +143 -0
  43. data/ruby_ex/dumpable_proc.rb +63 -0
  44. data/ruby_ex/exception.rb +32 -0
  45. data/ruby_ex/filetype.rb +229 -0
  46. data/ruby_ex/fileutils_ex.rb +44 -0
  47. data/ruby_ex/fold.rb +58 -0
  48. data/ruby_ex/generate_id.rb +44 -0
  49. data/ruby_ex/hookable.rb +262 -0
  50. data/ruby_ex/hooker.rb +54 -0
  51. data/ruby_ex/inactive_timeout.rb +137 -0
  52. data/ruby_ex/indexed_node.rb +66 -0
  53. data/ruby_ex/io_marshal.rb +100 -0
  54. data/ruby_ex/ioo.rb +194 -0
  55. data/ruby_ex/labeled_node.rb +63 -0
  56. data/ruby_ex/logger_observer.rb +23 -0
  57. data/ruby_ex/md5sum.rb +66 -0
  58. data/ruby_ex/mktemp.rb +208 -0
  59. data/ruby_ex/module/attr_once.rb +36 -0
  60. data/ruby_ex/module/autoload_tree.rb +75 -0
  61. data/ruby_ex/module/hierarchy.rb +335 -0
  62. data/ruby_ex/module/instance_method_visibility.rb +73 -0
  63. data/ruby_ex/module_ex.rb +11 -0
  64. data/ruby_ex/node.rb +80 -0
  65. data/ruby_ex/object_monitor.rb +145 -0
  66. data/ruby_ex/object_monitor_activity.rb +33 -0
  67. data/ruby_ex/observable.rb +140 -0
  68. data/ruby_ex/observable_pool.rb +293 -0
  69. data/ruby_ex/orderedhash.rb +252 -0
  70. data/ruby_ex/pathname_ex.rb +152 -0
  71. data/ruby_ex/pp_hierarchy.rb +29 -0
  72. data/ruby_ex/pseudo_cache.rb +190 -0
  73. data/ruby_ex/queue.rb +56 -0
  74. data/ruby_ex/random_generators.rb +25 -0
  75. data/ruby_ex/random_generators/random_generator.rb +31 -0
  76. data/ruby_ex/random_generators/ruby.rb +23 -0
  77. data/ruby_ex/safe_eval.rb +348 -0
  78. data/ruby_ex/sendmail.rb +215 -0
  79. data/ruby_ex/service_manager.rb +121 -0
  80. data/ruby_ex/session/administrable.rb +120 -0
  81. data/ruby_ex/session/client.rb +153 -0
  82. data/ruby_ex/session/const.rb +18 -0
  83. data/ruby_ex/session/dispatcher.rb +184 -0
  84. data/ruby_ex/session/error.rb +21 -0
  85. data/ruby_ex/session/fetchable.rb +57 -0
  86. data/ruby_ex/session/fetcher.rb +62 -0
  87. data/ruby_ex/session/hookable.rb +26 -0
  88. data/ruby_ex/session/profile.rb +110 -0
  89. data/ruby_ex/session/server.rb +582 -0
  90. data/ruby_ex/session/test/administrable_test.rb +337 -0
  91. data/ruby_ex/session/test/basic_test.rb +523 -0
  92. data/ruby_ex/session/test/dispatcher_test.rb +409 -0
  93. data/ruby_ex/session/test/fetchable_test.rb +119 -0
  94. data/ruby_ex/session/test/sub_server_test.rb +188 -0
  95. data/ruby_ex/shuffle.rb +30 -0
  96. data/ruby_ex/spring.rb +136 -0
  97. data/ruby_ex/spring_set.rb +137 -0
  98. data/ruby_ex/string_ex.rb +28 -0
  99. data/ruby_ex/symtbl.rb +106 -0
  100. data/ruby_ex/synflow.rb +474 -0
  101. data/ruby_ex/test/unit/ui/yaml/testrunner.rb +164 -0
  102. data/ruby_ex/thread_mutex.rb +10 -0
  103. data/ruby_ex/timeout_ex.rb +81 -0
  104. data/ruby_ex/top_down.rb +73 -0
  105. data/ruby_ex/trace.rb +26 -0
  106. data/ruby_ex/uri/druby.rb +81 -0
  107. data/ruby_ex/uri/file.rb +65 -0
  108. data/ruby_ex/uri/ftp_ex.rb +37 -0
  109. data/ruby_ex/uri/http_ex.rb +43 -0
  110. data/ruby_ex/uri/ssh.rb +92 -0
  111. data/ruby_ex/uri/svn.rb +118 -0
  112. data/ruby_ex/uri_ex.rb +45 -0
  113. data/ruby_ex/verbose_object.rb +30 -0
  114. data/ruby_ex/version.rb +66 -0
  115. data/ruby_ex/yaml/basenode_ext.rb +63 -0
  116. data/ruby_ex/yaml/chop_header.rb +23 -0
  117. data/ruby_ex/yaml/transform.rb +449 -0
  118. data/ruby_ex/yaml/yregexpath.rb +76 -0
  119. data/src/changelog.rb +28 -18
  120. data/src/conflict.rb +20 -0
  121. data/src/diff.rb +18 -0
  122. data/src/diffstat.rb +9 -3
  123. data/src/last_changed_date.rb +18 -0
  124. data/src/mail.rb +33 -65
  125. data/src/message.rb +15 -9
  126. data/src/mycommit.rb +29 -14
  127. data/src/news.rb +24 -3
  128. data/src/status.rb +17 -0
  129. data/src/svn.rb +2 -2
  130. data/src/vcs.rb +24 -3
  131. metadata +124 -5
  132. data/lrdetools.rb +0 -12
@@ -32,7 +32,7 @@ class Vcs
32
32
  result[:server] = aString
33
33
  end
34
34
  opts.on('-S', '--subject NAME', 'Choose your news subject') do |aString|
35
- result[:subject] = aString
35
+ result[:subject] = aString.sub(/\.?$/, '.')
36
36
  end
37
37
  opts.on_tail('-h', '--help', 'Show this message') do
38
38
  puts opts
@@ -60,12 +60,16 @@ class Vcs
60
60
  # Post the news.
61
61
  #
62
62
  def news ( *args )
63
+ error_handling :news_failed
64
+
63
65
  print_body(NEWS, parse_news_options(*args)) unless NEWS.exist?
64
66
 
65
67
  @news_status = 'Sent.'
66
68
  NEWS.open('r') do |file|
67
69
  opt = YAML::chop_header(file)
68
- LOG.info('news') { "Nntp Server: #{opt[:server]}" }
70
+ server, port = opt[:server].split(/:/)
71
+ port ||= 119
72
+ LOG.info('news') { "Nntp Server: #{server}:#{port}" }
69
73
  if ask("Post a news, with this subject: #{opt[:subject]}\n" +
70
74
  " to #{opt[:groups].join(', ')}\n from #{opt[:from]}\n" +
71
75
  'Are you sure?', :y) == :n
@@ -73,7 +77,7 @@ class Vcs
73
77
  exit
74
78
  end
75
79
  require 'socket'
76
- TCPSocket.open(opt[:server], 119) do |f|
80
+ TCPSocket.open(server, port) do |f|
77
81
  check_line(f, /^200/)
78
82
  f.puts 'post'
79
83
  check_line(f, /^340/)
@@ -94,4 +98,21 @@ class Vcs
94
98
  StringIO.new(@news_status)
95
99
  end
96
100
 
101
+ def news_failed
102
+ if defined? NEWS and NEWS.exist?
103
+ LOG.info "#{NEWS}: Contains the generated news" +
104
+ "(generated from #{@@message})"
105
+ end
106
+ end
107
+
108
+ def news_conf_checker
109
+ %w[ NNTPSERVER ].each do |var|
110
+ if ENV[var].nil? or ENV[var].empty?
111
+ LOG.error "environment variable `#{var}' not set"
112
+ end
113
+ end
114
+ end
115
+
116
+ add_conf_checker :news_conf_checker
117
+
97
118
  end # class Vcs
@@ -0,0 +1,17 @@
1
+ # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
2
+ # Copyright:: Copyright (c) 2004 LRDE. All rights reserved.
3
+ # License:: GNU General Public License (GPL).
4
+ # Revision:: $Id$
5
+
6
+ class Svn
7
+
8
+ def from_status ( *args, &block )
9
+ status(*args).each do |line|
10
+ next unless line =~ /^.{5} /
11
+ m = /^(.)(.).(.).\s*(.*)$/.match(line)
12
+ block[*m.to_a]
13
+ end
14
+ end
15
+ protected :from_status
16
+
17
+ end # class Svn
data/src/svn.rb CHANGED
@@ -21,8 +21,8 @@ class Svn < Vcs
21
21
  super
22
22
  end
23
23
 
24
- %w[ blame copy list move switch revert info
25
- propdel propget proplist propset mkdir ].each do |m|
24
+ %w[ blame cat cleanup copy export import list log merge mkdir move
25
+ switch resolved revert info propdel propget proplist propset ].each do |m|
26
26
  add_basic_method(m)
27
27
  end
28
28
 
data/src/vcs.rb CHANGED
@@ -5,6 +5,8 @@
5
5
  # $LastChangedBy: ertai $
6
6
  # $Id: header 98 2004-09-29 12:07:43Z ertai $
7
7
 
8
+ require 'set'
9
+
8
10
  class Class # :nodoc:
9
11
 
10
12
  def add_basic_method ( meth )
@@ -66,11 +68,14 @@ class Vcs
66
68
 
67
69
  def initialize ( aCmd )
68
70
  @cmd = aCmd
71
+ @handlers = Set.new
69
72
  end
70
73
 
74
+ @@checkers = Set.new
75
+
71
76
  def common_run ( args )
72
77
  cmd = @cmd + ' "' + args.join('" "') + '"'
73
- LOG.debug "running: #{cmd}" if $debug > 1
78
+ LOG.debug { "running: #{cmd}" }
74
79
  cmd
75
80
  end
76
81
  private :common_run
@@ -97,11 +102,11 @@ class Vcs
97
102
  puts line
98
103
  end
99
104
  else
100
- LOG.warn "unknown method #{meth}"
105
+ LOG.warn { "unknown method #{meth}" }
101
106
  run!($1.sub(/_$/, ''), *args)
102
107
  end
103
108
  else
104
- LOG.warn "unknown method #{meth}"
109
+ LOG.warn { "unknown method #{meth}" }
105
110
  run(meth.sub(/_$/, ''), *args)
106
111
  end
107
112
  end
@@ -151,5 +156,21 @@ class Vcs
151
156
  alias_command :checkin, :commit
152
157
  alias_command :populate, :add
153
158
 
159
+ def error_handling ( meth )
160
+ @handlers << meth
161
+ end
162
+
163
+ def call_handlers
164
+ @handlers.each { |meth| send(meth) }
165
+ end
166
+
167
+ def self.add_conf_checker ( meth )
168
+ @@checkers << meth
169
+ end
170
+
171
+ def call_conf_checkers
172
+ @@checkers.each { |meth| send(meth) }
173
+ end
174
+
154
175
  end # class Vcs
155
176
 
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.4
2
+ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: vcs
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.1"
7
- date: 2005-02-08
6
+ version: 0.2.148
7
+ date: 2005-05-09
8
8
  summary: A wrapper over any version control system
9
9
  require_paths:
10
10
  - src
@@ -18,7 +18,7 @@ description: "Version control systems (Subversion, CVS, PRCS...), however useful
18
18
  autorequire: vcs
19
19
  default_executable: vcs
20
20
  bindir: bin
21
- has_rdoc: false
21
+ has_rdoc: true
22
22
  required_ruby_version: !ruby/object:Gem::Version::Requirement
23
23
  requirements:
24
24
  -
@@ -32,8 +32,11 @@ authors:
32
32
  files:
33
33
  - src/ask.rb
34
34
  - src/changelog.rb
35
+ - src/conflict.rb
35
36
  - src/cvs.rb
37
+ - src/diff.rb
36
38
  - src/diffstat.rb
39
+ - src/last_changed_date.rb
37
40
  - src/mail.rb
38
41
  - src/message.rb
39
42
  - src/mycommit.rb
@@ -41,14 +44,130 @@ files:
41
44
  - src/prcs.rb
42
45
  - src/reply-mail.rb
43
46
  - src/revision.rb
47
+ - src/status.rb
44
48
  - src/svn.rb
45
49
  - src/tools.rb
46
50
  - src/vcs.rb
51
+ - ruby_ex/abstract.rb
52
+ - ruby_ex/abstract_node.rb
53
+ - ruby_ex/array_each_pair.rb
54
+ - ruby_ex/ask.rb
55
+ - ruby_ex/attributed_class.rb
56
+ - ruby_ex/cache.rb
57
+ - ruby_ex/checkout.rb
58
+ - ruby_ex/choose.rb
59
+ - ruby_ex/commands.rb
60
+ - ruby_ex/config_file.rb
61
+ - ruby_ex/const_regexp.rb
62
+ - ruby_ex/daemon.rb
63
+ - ruby_ex/diff.rb
64
+ - ruby_ex/dlogger.rb
65
+ - ruby_ex/dtime.rb
66
+ - ruby_ex/dumpable_proc.rb
67
+ - ruby_ex/exception.rb
68
+ - ruby_ex/filetype.rb
69
+ - ruby_ex/fileutils_ex.rb
70
+ - ruby_ex/fold.rb
71
+ - ruby_ex/generate_id.rb
72
+ - ruby_ex/hookable.rb
73
+ - ruby_ex/hooker.rb
74
+ - ruby_ex/inactive_timeout.rb
75
+ - ruby_ex/indexed_node.rb
76
+ - ruby_ex/io_marshal.rb
77
+ - ruby_ex/ioo.rb
78
+ - ruby_ex/labeled_node.rb
79
+ - ruby_ex/logger_observer.rb
80
+ - ruby_ex/md5sum.rb
81
+ - ruby_ex/mktemp.rb
82
+ - ruby_ex/module_ex.rb
83
+ - ruby_ex/node.rb
84
+ - ruby_ex/object_monitor.rb
85
+ - ruby_ex/object_monitor_activity.rb
86
+ - ruby_ex/observable.rb
87
+ - ruby_ex/observable_pool.rb
88
+ - ruby_ex/orderedhash.rb
89
+ - ruby_ex/pathname_ex.rb
90
+ - ruby_ex/pp_hierarchy.rb
91
+ - ruby_ex/pseudo_cache.rb
92
+ - ruby_ex/queue.rb
93
+ - ruby_ex/random_generators.rb
94
+ - ruby_ex/safe_eval.rb
95
+ - ruby_ex/sendmail.rb
96
+ - ruby_ex/service_manager.rb
97
+ - ruby_ex/shuffle.rb
98
+ - ruby_ex/spring.rb
99
+ - ruby_ex/spring_set.rb
100
+ - ruby_ex/string_ex.rb
101
+ - ruby_ex/symtbl.rb
102
+ - ruby_ex/synflow.rb
103
+ - ruby_ex/thread_mutex.rb
104
+ - ruby_ex/timeout_ex.rb
105
+ - ruby_ex/top_down.rb
106
+ - ruby_ex/trace.rb
107
+ - ruby_ex/uri_ex.rb
108
+ - ruby_ex/verbose_object.rb
109
+ - ruby_ex/version.rb
110
+ - ruby_ex/algorithms/simulated_annealing.rb
111
+ - ruby_ex/commands/command.rb
112
+ - ruby_ex/commands/datas.rb
113
+ - ruby_ex/commands/factory.rb
114
+ - ruby_ex/commands/helpers.rb
115
+ - ruby_ex/commands/pipe.rb
116
+ - ruby_ex/commands/runners.rb
117
+ - ruby_ex/commands/seq.rb
118
+ - ruby_ex/commands/datas/data.rb
119
+ - ruby_ex/commands/datas/factory.rb
120
+ - ruby_ex/commands/runners/exec.rb
121
+ - ruby_ex/commands/runners/fork.rb
122
+ - ruby_ex/commands/runners/runner.rb
123
+ - ruby_ex/drb/dispatcher.rb
124
+ - ruby_ex/drb/dispatcher_server_test.rb
125
+ - ruby_ex/drb/drb_observable.rb
126
+ - ruby_ex/drb/drb_observable_pool.rb
127
+ - ruby_ex/drb/drb_service.rb
128
+ - ruby_ex/drb/drb_undumped_attributes.rb
129
+ - ruby_ex/drb/drb_undumped_indexed_object.rb
130
+ - ruby_ex/drb/insecure_protected_methods.rb
131
+ - ruby_ex/drb/session_client_test.rb
132
+ - ruby_ex/drb/session_manager.rb
133
+ - ruby_ex/drb/session_server.rb
134
+ - ruby_ex/module/attr_once.rb
135
+ - ruby_ex/module/autoload_tree.rb
136
+ - ruby_ex/module/hierarchy.rb
137
+ - ruby_ex/module/instance_method_visibility.rb
138
+ - ruby_ex/random_generators/random_generator.rb
139
+ - ruby_ex/random_generators/ruby.rb
140
+ - ruby_ex/session/administrable.rb
141
+ - ruby_ex/session/client.rb
142
+ - ruby_ex/session/const.rb
143
+ - ruby_ex/session/dispatcher.rb
144
+ - ruby_ex/session/error.rb
145
+ - ruby_ex/session/fetchable.rb
146
+ - ruby_ex/session/fetcher.rb
147
+ - ruby_ex/session/hookable.rb
148
+ - ruby_ex/session/profile.rb
149
+ - ruby_ex/session/server.rb
150
+ - ruby_ex/session/test/administrable_test.rb
151
+ - ruby_ex/session/test/basic_test.rb
152
+ - ruby_ex/session/test/dispatcher_test.rb
153
+ - ruby_ex/session/test/fetchable_test.rb
154
+ - ruby_ex/session/test/sub_server_test.rb
155
+ - ruby_ex/test/unit/ui/yaml/testrunner.rb
156
+ - ruby_ex/uri/druby.rb
157
+ - ruby_ex/uri/file.rb
158
+ - ruby_ex/uri/ftp_ex.rb
159
+ - ruby_ex/uri/http_ex.rb
160
+ - ruby_ex/uri/ssh.rb
161
+ - ruby_ex/uri/svn.rb
162
+ - ruby_ex/yaml/basenode_ext.rb
163
+ - ruby_ex/yaml/chop_header.rb
164
+ - ruby_ex/yaml/transform.rb
165
+ - ruby_ex/yaml/yregexpath.rb
47
166
  - bin/vcs
48
167
  - bin/vcs-cvs
49
168
  - bin/vcs-prcs
50
169
  - bin/vcs-svn
51
- - lrdetools.rb
170
+ - doc/jamis.rb
52
171
  - HOWTO
53
172
  - Rakefile
54
173
  - TODO
@@ -1,12 +0,0 @@
1
- class Vcs
2
-
3
- def lrdetools_commit! ( s, *args )
4
-
5
- common_commit!(*args) do |rev|
6
- news!(:groups => ['lrde.proj'], :subject => "LT #{rev}: #{s}")
7
- end
8
-
9
- end
10
- alias_command :ltci, :lrdetools_commit
11
-
12
- end # class Vcs