ruby_ex 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. data/ChangeLog +177 -0
  2. data/NEWS +20 -11
  3. data/SPEC.dyn.yml +4 -4
  4. data/SPEC.gemspec +4 -4
  5. data/SPEC.yml +4 -1
  6. data/lib/cache.rb +2 -2
  7. data/lib/commands.rb +19 -1
  8. data/lib/commands/command.rb +5 -5
  9. data/lib/commands/datas/composite.rb +26 -4
  10. data/lib/commands/datas/data.rb +6 -5
  11. data/lib/commands/pipe.rb +55 -14
  12. data/lib/commands/runners/fork.rb +6 -2
  13. data/lib/commands/runners/{mock.rb → mockable.rb} +21 -22
  14. data/lib/commands/runners/runner.rb +13 -1
  15. data/lib/d_logger.rb +11 -5
  16. data/lib/diff_tools.rb +141 -0
  17. data/lib/drb/insecure_protected_methods.rb +2 -2
  18. data/lib/file_type.rb +29 -21
  19. data/lib/hookable.rb +17 -2
  20. data/lib/md5sum.rb +2 -2
  21. data/lib/module/autoload_tree.rb +2 -2
  22. data/lib/ordered_hash.rb +28 -1
  23. data/lib/regex_list.rb +192 -0
  24. data/lib/ruby_ex.rb +8 -5
  25. data/lib/sendmail.rb +8 -1
  26. data/lib/sym_tbl_gsub.rb +44 -18
  27. data/lib/uri/file.rb +2 -2
  28. data/lib/uri/ftp_ex.rb +2 -2
  29. data/lib/uri/http_ex.rb +2 -2
  30. data/lib/uri/ssh.rb +1 -1
  31. data/lib/uri/svn.rb +2 -2
  32. data/lib/uri_ex.rb +4 -7
  33. data/lib/yaml/chop_header.rb +1 -1
  34. data/test/check-pkg-ruby_ex.yml +5 -7
  35. data/test/check-ruby_ex.yml +6 -10
  36. data/test/{resources → fixtures}/autoload_tree/A.rb +0 -0
  37. data/test/{resources → fixtures}/autoload_tree/B.rb +0 -0
  38. data/test/{resources → fixtures}/autoload_tree/foo/C.rb +0 -0
  39. data/test/fixtures/foo.bz2 +0 -0
  40. data/test/fixtures/foo.gz.zip +0 -0
  41. data/test/fixtures/foo.rb.gz +0 -0
  42. data/test/fixtures/foo.tar +0 -0
  43. data/test/fixtures/foo.tar.bz2 +0 -0
  44. data/test/{resources → fixtures}/foo.tar.gz +0 -0
  45. data/test/{resources → fixtures}/foo.txt +0 -0
  46. data/test/fixtures/my_diff.patch +164 -0
  47. data/test/{resources → fixtures}/tar.gz.log +0 -0
  48. data/test/sanity/multiple-requires.yml +1 -1
  49. data/test/sanity/single-requires.yml +1 -1
  50. metadata +23 -16
@@ -3,7 +3,7 @@
3
3
  # License: Gnu General Public License.
4
4
 
5
5
  # $LastChangedBy: ertai $
6
- # $Id: file.rb 258 2005-06-01 00:22:51Z ertai $
6
+ # $Id: file.rb 385 2005-10-02 17:05:35Z ertai $
7
7
 
8
8
  require 'uri_ex'
9
9
 
@@ -53,7 +53,7 @@ module URI
53
53
  cmd = GZIP['-c', p] > out
54
54
  end
55
55
  cmd.run(self.runner)
56
- out
56
+ [out, nil]
57
57
  end
58
58
 
59
59
  end # class File
@@ -3,7 +3,7 @@
3
3
  # License: Gnu General Public License.
4
4
 
5
5
  # $LastChangedBy: ertai $
6
- # $Id: ftp_ex.rb 258 2005-06-01 00:22:51Z ertai $
6
+ # $Id: ftp_ex.rb 385 2005-10-02 17:05:35Z ertai $
7
7
 
8
8
  require 'uri_ex'
9
9
  require 'uri/ftp'
@@ -28,7 +28,7 @@ module URI
28
28
  raise CheckoutError, "Cannot checkout #{to_s} (error: #{ex.short_pp})"
29
29
  end
30
30
 
31
- tmp
31
+ [tmp, nil]
32
32
  end
33
33
 
34
34
  end # class FTP
@@ -3,7 +3,7 @@
3
3
  # License: Gnu General Public License.
4
4
 
5
5
  # $LastChangedBy: ertai $
6
- # $Id: http_ex.rb 258 2005-06-01 00:22:51Z ertai $
6
+ # $Id: http_ex.rb 385 2005-10-02 17:05:35Z ertai $
7
7
 
8
8
  require 'uri_ex'
9
9
  require 'uri/http'
@@ -33,7 +33,7 @@ module URI
33
33
  raise CheckoutError, "Cannot checkout #{to_s} (error: #{ex.short_pp})"
34
34
  end
35
35
 
36
- tmp
36
+ [tmp, nil]
37
37
  end
38
38
 
39
39
  end # class HTTP
@@ -51,7 +51,7 @@ module URI
51
51
 
52
52
  def checkout
53
53
  out = TempPath.new('checkout', pathname.basename.to_s)
54
- SCP[mk_opts, mk_arg, out].run(self.runner)
54
+ [out, SCP[mk_opts, mk_arg, out].run(self.runner)]
55
55
  end
56
56
 
57
57
  def save
@@ -3,7 +3,7 @@
3
3
  # License: Gnu General Public License.
4
4
 
5
5
  # $LastChangedBy: ertai $
6
- # $Id: svn.rb 339 2005-09-06 23:27:27Z ertai $
6
+ # $Id: svn.rb 363 2005-09-24 17:15:50Z ertai $
7
7
 
8
8
  require 'uri_ex'
9
9
 
@@ -32,7 +32,7 @@ module URI
32
32
  tmp.mkpath
33
33
  target = to_s.sub(/^svn\./, '')
34
34
  tmp += pathname.basename
35
- SVN['checkout', target, tmp].run(self.runner)
35
+ [tmp, SVN['checkout', target, tmp].run(self.runner)]
36
36
  end
37
37
 
38
38
  def save
@@ -1,7 +1,7 @@
1
1
  # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
2
  # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
3
  # License:: Gnu General Public License.
4
- # Revision:: $Id: uri_ex.rb 339 2005-09-06 23:27:27Z ertai $
4
+ # Revision:: $Id: uri_ex.rb 363 2005-09-24 17:15:50Z ertai $
5
5
 
6
6
  require 'uri'
7
7
 
@@ -20,6 +20,7 @@ module URI
20
20
  end
21
21
 
22
22
  class Generic
23
+ have YamlExtension, :uri, :url
23
24
 
24
25
  #
25
26
  # To make all uris command verbose you can change or modify the global
@@ -38,12 +39,8 @@ module URI
38
39
  self.path = path.to_s
39
40
  end
40
41
 
41
- def to_yaml_type
42
- '!uri'
43
- end
44
-
45
- def to_yaml ( opts={} )
46
- "!uri #{to_s}"
42
+ def to_yaml_string
43
+ to_s
47
44
  end
48
45
 
49
46
  def checkout
@@ -11,7 +11,7 @@ module Yaml
11
11
  aStr = io.gets
12
12
  unless aStr =~ /^---/
13
13
  io.rewind
14
- raise Exception, "First line is not valid: `#{aLine}'"
14
+ raise Exception, "First line is not valid: `#{aStr}'"
15
15
  end
16
16
  io.each do |aLine|
17
17
  break if aLine =~ /^---/
@@ -1,15 +1,13 @@
1
1
  ---
2
2
 
3
- # Run this suite with -S 'url: scheme://the/url/to/the/ttk/package'
4
- RubyEx Package Test Suite:
5
- strategy: Suite
3
+ # Run this suite with -S 'url: scheme://the/url/to/the/ruby_ex/package'
4
+ RubyEx Package Test Suite: !S::Suite
6
5
  contents:
7
6
 
8
- - Checkout:
9
- strategy: Checkout
7
+ - Checkout: !S::Checkout
10
8
  url: <<url>>
11
9
  fatal: true
10
+ weight: 0
12
11
 
13
- - Check the package:
14
- strategy: Import
12
+ - Check the package: !S::Import
15
13
  import: <<checkout_dir>>/test/check-ruby_ex.yml
@@ -1,12 +1,8 @@
1
1
  ---
2
2
 
3
- RubyEx Main Test Suite:
4
-
5
- strategy: Glob
6
- glob : <<pwd>>/*-suite.yml
7
- regexp : !re ([^/]*)\.yml$
8
-
9
- test:
10
- <<match>>:
11
- strategy: Import
12
- import : <<path>>
3
+ RubyEx Main Test Suite: !S::Iterate
4
+ over: !pathlist <<pwd>>/(*-suite).yml
5
+ iter: [it_path, it_name]
6
+ test:
7
+ <<it_name>>: !S::Import
8
+ import: <<it_path>>
Binary file
Binary file
Binary file
Binary file
Binary file
File without changes
File without changes
@@ -0,0 +1,164 @@
1
+ Index: core_ex/lib/core_ex.rb
2
+ ===================================================================
3
+ --- core_ex/lib/core_ex.rb (revision 361)
4
+ +++ core_ex/lib/core_ex.rb (working copy)
5
+ @@ -3,6 +3,17 @@
6
+ # License:: Gnu General Public License.
7
+ # Revision:: $Id$
8
+
9
+ +min_release = "1.8.2 (2004-12-25)"
10
+ +ruby_release = "#{RUBY_VERSION} (#{RUBY_RELEASE_DATE})"
11
+ +if ruby_release < min_release
12
+ + abort <<-end_message
13
+ +
14
+ + CoreEx requires Ruby version #{min_release} or later.
15
+ + You're running #{ruby_release}; please upgrade to continue.
16
+ +
17
+ + end_message
18
+ +end
19
+ +
20
+ unless defined? CORE_EX_LOADED and CORE_EX_LOADED
21
+ CORE_EX_LOADED = true
22
+ $LOADED_FEATURES << 'core_ex.rb' unless $LOADED_FEATURES.include? 'core_ex.rb'
23
+ Index: core_ex/NEWS
24
+ ===================================================================
25
+ --- core_ex/NEWS (revision 361)
26
+ +++ core_ex/NEWS (working copy)
27
+ @@ -53,8 +53,8 @@
28
+ = New in 0.1, 2005-05-31:
29
+
30
+ CoreEx is designed to provides a simple but quite useful extension of the
31
+ - standard library of Ruby. So some classes and modules like Pathname, Time,
32
+ - Enumerable, Exception, FileUtils, String, and YAML are extended. There is
33
+ + standard library of Ruby. Thus some classes and modules like Pathname, Time,
34
+ + Enumerable, Exception, FileUtils, String, and YAML are extended. There are
35
+ also some new features like attr_once, DTime, TempPath, Version,
36
+ embedded_tests, filelist (almost from rake), a common Rakefile, and an
37
+ extension of the require system.
38
+ Index: core_ex/README
39
+ ===================================================================
40
+ --- core_ex/README (revision 361)
41
+ +++ core_ex/README (working copy)
42
+ @@ -1,7 +1,7 @@
43
+ CoreEx is designed to provides a simple but quite useful extension of the
44
+ -standard library of Ruby. So some classes and modules like Pathname,
45
+ +standard library of Ruby. Thus some classes and modules like Pathname,
46
+ Enumerable, Exception, FileUtils, String, YAML, Module, Class and Object are
47
+ -extended. There is also some new features like DTime, TempPath, Version,
48
+ -embedded_tests, FileList (almost from rake), a common Rakefile.
49
+ +extended. There are also some new features like DTime, TempPath, Version,
50
+ +embedded_tests, FileList (almost from rake), and a common Rakefile.
51
+
52
+ Coming Soon.
53
+ Index: lib/commands.rb
54
+ ===================================================================
55
+ --- lib/commands.rb (revision 361)
56
+ +++ lib/commands.rb (working copy)
57
+ @@ -12,6 +12,24 @@
58
+ require 'commands/runners'
59
+
60
+
61
+ +# Provides an object oriented way to manage, combine and run your commands.
62
+ +#
63
+ +# Example:
64
+ +# require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex'
65
+ +# Commands.import!
66
+ +# ls, wc, out = 'ls'.to_cmd, 'wc'.to_cmd, 'out'.to_path
67
+ +#
68
+ +# data = ls.system # other runners exist (exec, fork, sh...)
69
+ +#
70
+ +# p data.status
71
+ +# puts data.output.read
72
+ +#
73
+ +# (ls > STDOUT).system
74
+ +#
75
+ +# cmd = ls['*.rb'] | wc['-l'] > out
76
+ +# cmd.system
77
+ +#
78
+ +# puts out.read
79
+ module Commands
80
+
81
+ autoloaded_module(__FILE__, false)
82
+ Index: lib/ruby_ex.rb
83
+ ===================================================================
84
+ --- lib/ruby_ex.rb (revision 361)
85
+ +++ lib/ruby_ex.rb (working copy)
86
+ @@ -35,7 +35,7 @@
87
+
88
+
89
+ unless defined? CoreEx
90
+ - file = Pathname.glob("#{dir}/../{core_ex/lib/core_ex,vendor/core_ex*/core_ex}").first
91
+ + file = Pathname.glob("#{dir}/../{core_ex/lib/core_ex,vendor/core_ex*/lib/core_ex}").first
92
+ if file.nil?
93
+ require 'rubygems'
94
+ require_gem 'core_ex'
95
+ Index: NEWS
96
+ ===================================================================
97
+ --- NEWS (revision 361)
98
+ +++ NEWS (working copy)
99
+ @@ -1,14 +1,12 @@
100
+ = New in 0.2, 2005-09-16:
101
+
102
+ - * Many many changes and new things for RubyEx.
103
+ -
104
+ - * Remove many requires which are now useless, many are not yet
105
+ + * Remove many requires which are now useless; many are not yet
106
+ suppressed.
107
+
108
+ - * Renaming to follow the camelize/underscore convention.
109
+ + * Rename classes and modules to follow the camelize/underscore convention.
110
+
111
+ * Commands:
112
+ - Provides a object oriented way to manage, combine and run your commands.
113
+ + Provides an object oriented way to manage, combine and run your commands.
114
+
115
+ Example:
116
+ require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex'
117
+ @@ -21,13 +19,13 @@
118
+ puts data.output.read
119
+
120
+ (ls > STDOUT).system
121
+ -
122
+ +
123
+ cmd = ls['*.rb'] | wc['-l'] > out
124
+ cmd.system
125
+
126
+ puts out.read
127
+
128
+ - * RPath: Add RPath, a basic (but powerful) way to search your ruby data.
129
+ + * RPath: Add RPath, a simple way to search your ruby data.
130
+
131
+ * BlankSlate, Mocks, VerboseObject, and AutoObject:
132
+
133
+ @@ -40,7 +38,7 @@
134
+ - VerboseObject: Proxies that display received method calls and verbosify
135
+ objects recursivly.
136
+ - AutoObject: It's like a verbose object without a real object inside.
137
+ -
138
+ +
139
+ * Text:
140
+ A little text manipulation class.
141
+ Transformation available are:
142
+ @@ -57,19 +55,19 @@
143
+ - Add many unit tests.
144
+ - Add gem filetype support (with the install method).
145
+
146
+ - * MetaFactory: A class that help to produce objects that
147
+ + * MetaFactory: A class that help to produce objects which
148
+ share the same initializion step.
149
+
150
+ * Html encode: Support accent encoding for the iso latin1 charset.
151
+
152
+ - * URI: Support for Mysql and Pgsql.
153
+ + * URI: Support for MySQL and PgSQL.
154
+
155
+ * HashEval:
156
+ Provides a block in which methods name are keys and arguments/blocks
157
+ are values.
158
+
159
+ * SymTbl (Symbol Table):
160
+ - Add symtbl_gsub methods to provide a global substitution sheme over any
161
+ + Add symtbl_gsub methods which provide a global substitution sheme over any
162
+ objects.
163
+
164
+ = New in 0.1, 2005-05-31:
File without changes
@@ -1,7 +1,7 @@
1
1
  ---
2
2
 
3
3
  RubyEx Sanity Multiple Requires Test Suite: !S::Cmd
4
- command: ruby
4
+ command: <<ruby>>
5
5
  exit: 0
6
6
  error: ""
7
7
  output: !re 0 failures, 0 errors$
@@ -7,7 +7,7 @@ RubyEx Sanity Single Requires Test Suite: !S::Iterate
7
7
  test:
8
8
  <<it_name>>: !S::Suite
9
9
  attributes: !S::Cmd
10
- command: ruby
10
+ command: <<ruby>>
11
11
  exit: 0
12
12
  error: ""
13
13
  output: !re 0 failures, 0 errors$
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: ruby_ex
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2005-09-16 00:00:00 +02:00
6
+ version: 0.3.0
7
+ date: 2005-10-03
8
8
  summary: RubyEx contains general purpose Ruby extensions.
9
9
  require_paths:
10
10
  - lib
@@ -26,8 +26,6 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
26
26
  version: 0.0.0
27
27
  version:
28
28
  platform: ruby
29
- signing_key:
30
- cert_chain:
31
29
  authors:
32
30
  - Nicolas Despr�s
33
31
  - Nicolas Pouillard
@@ -45,6 +43,7 @@ files:
45
43
  - lib/d_logger.rb
46
44
  - lib/daemon.rb
47
45
  - lib/diff.rb
46
+ - lib/diff_tools.rb
48
47
  - lib/drb_ex.rb
49
48
  - lib/file_type.rb
50
49
  - lib/generate_id.rb
@@ -73,6 +72,7 @@ files:
73
72
  - lib/pp_hierarchy.rb
74
73
  - lib/r_path.rb
75
74
  - lib/random_generators.rb
75
+ - lib/regex_list.rb
76
76
  - lib/regex_path.rb
77
77
  - lib/ruby_ex.rb
78
78
  - lib/safe_eval.rb
@@ -103,7 +103,7 @@ files:
103
103
  - lib/commands/datas/temp.rb
104
104
  - lib/commands/runners/exec.rb
105
105
  - lib/commands/runners/fork.rb
106
- - lib/commands/runners/mock.rb
106
+ - lib/commands/runners/mockable.rb
107
107
  - lib/commands/runners/runner.rb
108
108
  - lib/commands/runners/system.rb
109
109
  - lib/drb/drb_observable.rb
@@ -136,21 +136,28 @@ files:
136
136
  - test/algorithms
137
137
  - test/check-pkg-ruby_ex.yml
138
138
  - test/check-ruby_ex.yml
139
- - test/resources
139
+ - test/fixtures
140
+ - test/functional
140
141
  - test/sanity
141
142
  - test/sanity-suite.yml
142
143
  - test/stress-tests
143
144
  - test/test-unit-setup.rb
144
145
  - test/unit-suite.yml
145
146
  - test/algorithms/simulated_annealing_test.rb
146
- - test/resources/autoload_tree
147
- - test/resources/foo.tar.gz
148
- - test/resources/foo.txt
149
- - test/resources/tar.gz.log
150
- - test/resources/autoload_tree/A.rb
151
- - test/resources/autoload_tree/B.rb
152
- - test/resources/autoload_tree/foo
153
- - test/resources/autoload_tree/foo/C.rb
147
+ - test/fixtures/autoload_tree
148
+ - test/fixtures/foo.bz2
149
+ - test/fixtures/foo.gz.zip
150
+ - test/fixtures/foo.rb.gz
151
+ - test/fixtures/foo.tar
152
+ - test/fixtures/foo.tar.bz2
153
+ - test/fixtures/foo.tar.gz
154
+ - test/fixtures/foo.txt
155
+ - test/fixtures/my_diff.patch
156
+ - test/fixtures/tar.gz.log
157
+ - test/fixtures/autoload_tree/A.rb
158
+ - test/fixtures/autoload_tree/B.rb
159
+ - test/fixtures/autoload_tree/foo
160
+ - test/fixtures/autoload_tree/foo/C.rb
154
161
  - test/sanity/multiple-requires.yml
155
162
  - test/sanity/single-requires.yml
156
163
  - test/stress-tests/threads_and_exceptions.yml
@@ -187,5 +194,5 @@ dependencies:
187
194
  -
188
195
  - "~>"
189
196
  - !ruby/object:Gem::Version
190
- version: 0.3.1
197
+ version: 0.4.0
191
198
  version: