ruby_ex 0.3.0 → 0.4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +324 -0
- data/NEWS +17 -0
- data/README +1 -1
- data/SPEC.yml +9 -9
- data/lib/abstract.rb +3 -38
- data/lib/abstract_node.rb +2 -4
- data/lib/algorithms/simulated_annealing.rb +26 -3
- data/lib/attributed_class.rb +2 -2
- data/lib/auto_object.rb +2 -6
- data/lib/blank_slate.rb +1 -1
- data/lib/cache.rb +4 -4
- data/lib/choose.rb +3 -5
- data/lib/commands/command.rb +53 -27
- data/lib/commands/datas/composite.rb +2 -4
- data/lib/commands/datas/data.rb +13 -16
- data/lib/commands/datas/factory.rb +2 -4
- data/lib/commands/datas/pipe.rb +52 -0
- data/lib/commands/datas/temp.rb +2 -2
- data/lib/commands/datas.rb +1 -6
- data/lib/commands/factory.rb +1 -3
- data/lib/commands/helpers.rb +6 -11
- data/lib/commands/pipe.rb +4 -6
- data/lib/commands/runners/exec.rb +2 -6
- data/lib/commands/runners/fork.rb +3 -20
- data/lib/commands/runners/mockable.rb +4 -7
- data/lib/commands/runners/no_run.rb +44 -0
- data/lib/commands/runners/popen.rb +49 -0
- data/lib/commands/runners/runner.rb +29 -6
- data/lib/commands/runners/system.rb +1 -4
- data/lib/commands/runners.rb +1 -6
- data/lib/commands/seq.rb +1 -3
- data/lib/commands.rb +3 -13
- data/lib/concrete.rb +38 -0
- data/lib/config_file.rb +2 -3
- data/lib/const_regexp.rb +1 -1
- data/lib/d_logger.rb +1 -1
- data/lib/daemon.rb +2 -3
- data/lib/diff.rb +1 -1
- data/lib/diff_tools.rb +1 -3
- data/lib/drb/drb_observable.rb +1 -1
- data/lib/drb/drb_observable_pool.rb +1 -1
- data/lib/drb/drb_service.rb +1 -1
- data/lib/drb/drb_undumped_attributes.rb +1 -1
- data/lib/drb/drb_undumped_indexed_object.rb +1 -1
- data/lib/drb/insecure_protected_methods.rb +1 -1
- data/lib/drb_ex.rb +1 -1
- data/lib/file_type.rb +2 -2
- data/lib/generate_id.rb +1 -1
- data/lib/genpasswd.rb +1 -1
- data/lib/hash_eval.rb +1 -1
- data/lib/histogram.rb +1 -1
- data/lib/hookable.rb +1 -4
- data/lib/hooker.rb +1 -1
- data/lib/html_encode.rb +1 -1
- data/lib/indexed_node.rb +0 -3
- data/lib/io_marshal.rb +1 -1
- data/lib/ioo.rb +1 -1
- data/lib/kill_all.rb +2 -2
- data/lib/labeled_node.rb +0 -3
- data/lib/logger_observer.rb +1 -1
- data/lib/md5sum.rb +1 -1
- data/lib/meta_factory.rb +1 -1
- data/lib/method_call.rb +1 -1
- data/lib/mocks/assertions.rb +1 -1
- data/lib/mocks/method_logger.rb +1 -3
- data/lib/mocks/mock.rb +2 -4
- data/lib/mocks/object.rb +1 -4
- data/lib/mocks/observer.rb +1 -3
- data/lib/mocks.rb +1 -6
- data/lib/module/autoload_tree.rb +1 -1
- data/lib/module/hierarchy.rb +1 -1
- data/lib/module/instance_method_visibility.rb +17 -16
- data/lib/object_monitor.rb +1 -1
- data/lib/object_monitor_activity.rb +1 -1
- data/lib/observable.rb +1 -1
- data/lib/observable_pool.rb +1 -1
- data/lib/ordered_hash.rb +1 -1
- data/lib/r_path.rb +44 -23
- data/lib/random_generators/random_generator.rb +1 -1
- data/lib/random_generators/ruby.rb +1 -5
- data/lib/random_generators.rb +20 -5
- data/lib/regex_list.rb +2 -5
- data/lib/regex_path.rb +64 -23
- data/lib/ruby_ex.rb +11 -2
- data/lib/safe_eval.rb +6 -15
- data/lib/sendmail.rb +41 -17
- data/lib/service_manager.rb +1 -1
- data/lib/shuffle.rb +3 -1
- data/lib/spring.rb +1 -1
- data/lib/spring_set.rb +1 -1
- data/lib/sym_tbl.rb +14 -8
- data/lib/sym_tbl_gsub.rb +88 -23
- data/lib/text.rb +1 -1
- data/lib/timeout_ex.rb +1 -1
- data/lib/trace.rb +1 -1
- data/lib/uri/druby.rb +3 -6
- data/lib/uri/file.rb +32 -18
- data/lib/uri/ftp_ex.rb +8 -3
- data/lib/uri/generic_ex.rb +158 -0
- data/lib/uri/http_ex.rb +9 -4
- data/lib/uri/mysql.rb +7 -15
- data/lib/uri/pgsql.rb +6 -14
- data/lib/uri/rsync.rb +77 -0
- data/lib/uri/ssh.rb +55 -27
- data/lib/uri/svn.rb +22 -76
- data/lib/verbose_object.rb +1 -5
- data/lib/yaml/transform.rb +1 -1
- data/lib/yaml/yregexpath.rb +1 -1
- data/test/algorithms/simulated_annealing_test.rb +79 -80
- data/test/unit-suite.yml +5 -3
- metadata +179 -172
- data/SPEC.dyn.yml +0 -10
- data/SPEC.gemspec +0 -14
- data/lib/uri_ex.rb +0 -110
- data/test/test-unit-setup.rb +0 -10
data/lib/uri_ex.rb
DELETED
@@ -1,110 +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: uri_ex.rb 363 2005-09-24 17:15:50Z ertai $
|
5
|
-
|
6
|
-
require 'uri'
|
7
|
-
|
8
|
-
module UriEx
|
9
|
-
end # module UriEx
|
10
|
-
|
11
|
-
module URI
|
12
|
-
|
13
|
-
class CheckoutError < Exception
|
14
|
-
end
|
15
|
-
|
16
|
-
class CommitError < Exception
|
17
|
-
end
|
18
|
-
|
19
|
-
class SaveError < Exception
|
20
|
-
end
|
21
|
-
|
22
|
-
class Generic
|
23
|
-
have YamlExtension, :uri, :url
|
24
|
-
|
25
|
-
#
|
26
|
-
# To make all uris command verbose you can change or modify the global
|
27
|
-
# command runner: URI::Generic.runner.make_verbose!
|
28
|
-
#
|
29
|
-
class_inheritable_accessor :runner
|
30
|
-
|
31
|
-
self.runner = Commands::Runners::System.new.raise_on_failures
|
32
|
-
self.runner.command_data_factory.command_data_class = Commands::Datas::Temp
|
33
|
-
|
34
|
-
def pathname
|
35
|
-
Pathname.new(path)
|
36
|
-
end
|
37
|
-
|
38
|
-
def pathname= ( path )
|
39
|
-
self.path = path.to_s
|
40
|
-
end
|
41
|
-
|
42
|
-
def to_yaml_string
|
43
|
-
to_s
|
44
|
-
end
|
45
|
-
|
46
|
-
def checkout
|
47
|
-
raise CheckoutError, "Can't checkout a #{self.class}"
|
48
|
-
end
|
49
|
-
|
50
|
-
def commit
|
51
|
-
raise CommitError, "Can't commit a #{self.class}"
|
52
|
-
end
|
53
|
-
|
54
|
-
def save
|
55
|
-
raise SaveError, "Can't save a #{self.class}"
|
56
|
-
end
|
57
|
-
|
58
|
-
def add_query ( arg )
|
59
|
-
if query.nil?
|
60
|
-
self.query = arg
|
61
|
-
else
|
62
|
-
self.query += ',' + arg
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
|
67
|
-
def mk_custom_opts
|
68
|
-
opts = []
|
69
|
-
return opts if @query.nil?
|
70
|
-
@query.split(/,/).map do |x|
|
71
|
-
k, v = x.split(/=/)
|
72
|
-
if k.size == 1
|
73
|
-
opts << "-#{k}"
|
74
|
-
else
|
75
|
-
opts << "--#{k}"
|
76
|
-
end
|
77
|
-
opts << v unless v.nil?
|
78
|
-
end
|
79
|
-
opts
|
80
|
-
end
|
81
|
-
|
82
|
-
|
83
|
-
end # module Generic
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
test_section __FILE__ do
|
88
|
-
class GenericTest < Test::Unit::TestCase
|
89
|
-
|
90
|
-
def setup
|
91
|
-
assert_nothing_raised { @foo = URI.parse('http://foo/qux/bar') }
|
92
|
-
assert_nothing_raised do
|
93
|
-
@cmplx = URI.parse('http://foo@bar/qux/bob?a=b,c,d=e,f,ghi,jkl=mno')
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def test_mk_custom_opts
|
98
|
-
assert_equal([], @foo.mk_custom_opts)
|
99
|
-
assert_equal(%w[-a b -c -d e -f --ghi --jkl mno], @cmplx.mk_custom_opts)
|
100
|
-
end
|
101
|
-
|
102
|
-
end # class GenericTest
|
103
|
-
end
|
104
|
-
|
105
|
-
PathList[__FILE__.to_path.dirname + 'uri/**/*.rb'].each do |path|
|
106
|
-
require path.to_s
|
107
|
-
end
|
108
|
-
|
109
|
-
end # module URI
|
110
|
-
|
data/test/test-unit-setup.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'pathname'
|
3
|
-
$: << Pathname.new(__FILE__).dirname.parent + 'lib'
|
4
|
-
require 'ruby_ex'
|
5
|
-
Test::Unit::UI::Yaml::TestRunner.import!
|
6
|
-
args = ARGV.inject(nil) { |accu, x| (accu)? accu << x : ((x == '--')? [] : accu) } || ARGV
|
7
|
-
path = Pathname.new(args[0]).expand_path.cleanpath
|
8
|
-
embedded_test_mode Regexp.new(path)
|
9
|
-
require path.to_s
|
10
|
-
run_embedded_test_sections
|