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.
Files changed (115) hide show
  1. data/ChangeLog +324 -0
  2. data/NEWS +17 -0
  3. data/README +1 -1
  4. data/SPEC.yml +9 -9
  5. data/lib/abstract.rb +3 -38
  6. data/lib/abstract_node.rb +2 -4
  7. data/lib/algorithms/simulated_annealing.rb +26 -3
  8. data/lib/attributed_class.rb +2 -2
  9. data/lib/auto_object.rb +2 -6
  10. data/lib/blank_slate.rb +1 -1
  11. data/lib/cache.rb +4 -4
  12. data/lib/choose.rb +3 -5
  13. data/lib/commands/command.rb +53 -27
  14. data/lib/commands/datas/composite.rb +2 -4
  15. data/lib/commands/datas/data.rb +13 -16
  16. data/lib/commands/datas/factory.rb +2 -4
  17. data/lib/commands/datas/pipe.rb +52 -0
  18. data/lib/commands/datas/temp.rb +2 -2
  19. data/lib/commands/datas.rb +1 -6
  20. data/lib/commands/factory.rb +1 -3
  21. data/lib/commands/helpers.rb +6 -11
  22. data/lib/commands/pipe.rb +4 -6
  23. data/lib/commands/runners/exec.rb +2 -6
  24. data/lib/commands/runners/fork.rb +3 -20
  25. data/lib/commands/runners/mockable.rb +4 -7
  26. data/lib/commands/runners/no_run.rb +44 -0
  27. data/lib/commands/runners/popen.rb +49 -0
  28. data/lib/commands/runners/runner.rb +29 -6
  29. data/lib/commands/runners/system.rb +1 -4
  30. data/lib/commands/runners.rb +1 -6
  31. data/lib/commands/seq.rb +1 -3
  32. data/lib/commands.rb +3 -13
  33. data/lib/concrete.rb +38 -0
  34. data/lib/config_file.rb +2 -3
  35. data/lib/const_regexp.rb +1 -1
  36. data/lib/d_logger.rb +1 -1
  37. data/lib/daemon.rb +2 -3
  38. data/lib/diff.rb +1 -1
  39. data/lib/diff_tools.rb +1 -3
  40. data/lib/drb/drb_observable.rb +1 -1
  41. data/lib/drb/drb_observable_pool.rb +1 -1
  42. data/lib/drb/drb_service.rb +1 -1
  43. data/lib/drb/drb_undumped_attributes.rb +1 -1
  44. data/lib/drb/drb_undumped_indexed_object.rb +1 -1
  45. data/lib/drb/insecure_protected_methods.rb +1 -1
  46. data/lib/drb_ex.rb +1 -1
  47. data/lib/file_type.rb +2 -2
  48. data/lib/generate_id.rb +1 -1
  49. data/lib/genpasswd.rb +1 -1
  50. data/lib/hash_eval.rb +1 -1
  51. data/lib/histogram.rb +1 -1
  52. data/lib/hookable.rb +1 -4
  53. data/lib/hooker.rb +1 -1
  54. data/lib/html_encode.rb +1 -1
  55. data/lib/indexed_node.rb +0 -3
  56. data/lib/io_marshal.rb +1 -1
  57. data/lib/ioo.rb +1 -1
  58. data/lib/kill_all.rb +2 -2
  59. data/lib/labeled_node.rb +0 -3
  60. data/lib/logger_observer.rb +1 -1
  61. data/lib/md5sum.rb +1 -1
  62. data/lib/meta_factory.rb +1 -1
  63. data/lib/method_call.rb +1 -1
  64. data/lib/mocks/assertions.rb +1 -1
  65. data/lib/mocks/method_logger.rb +1 -3
  66. data/lib/mocks/mock.rb +2 -4
  67. data/lib/mocks/object.rb +1 -4
  68. data/lib/mocks/observer.rb +1 -3
  69. data/lib/mocks.rb +1 -6
  70. data/lib/module/autoload_tree.rb +1 -1
  71. data/lib/module/hierarchy.rb +1 -1
  72. data/lib/module/instance_method_visibility.rb +17 -16
  73. data/lib/object_monitor.rb +1 -1
  74. data/lib/object_monitor_activity.rb +1 -1
  75. data/lib/observable.rb +1 -1
  76. data/lib/observable_pool.rb +1 -1
  77. data/lib/ordered_hash.rb +1 -1
  78. data/lib/r_path.rb +44 -23
  79. data/lib/random_generators/random_generator.rb +1 -1
  80. data/lib/random_generators/ruby.rb +1 -5
  81. data/lib/random_generators.rb +20 -5
  82. data/lib/regex_list.rb +2 -5
  83. data/lib/regex_path.rb +64 -23
  84. data/lib/ruby_ex.rb +11 -2
  85. data/lib/safe_eval.rb +6 -15
  86. data/lib/sendmail.rb +41 -17
  87. data/lib/service_manager.rb +1 -1
  88. data/lib/shuffle.rb +3 -1
  89. data/lib/spring.rb +1 -1
  90. data/lib/spring_set.rb +1 -1
  91. data/lib/sym_tbl.rb +14 -8
  92. data/lib/sym_tbl_gsub.rb +88 -23
  93. data/lib/text.rb +1 -1
  94. data/lib/timeout_ex.rb +1 -1
  95. data/lib/trace.rb +1 -1
  96. data/lib/uri/druby.rb +3 -6
  97. data/lib/uri/file.rb +32 -18
  98. data/lib/uri/ftp_ex.rb +8 -3
  99. data/lib/uri/generic_ex.rb +158 -0
  100. data/lib/uri/http_ex.rb +9 -4
  101. data/lib/uri/mysql.rb +7 -15
  102. data/lib/uri/pgsql.rb +6 -14
  103. data/lib/uri/rsync.rb +77 -0
  104. data/lib/uri/ssh.rb +55 -27
  105. data/lib/uri/svn.rb +22 -76
  106. data/lib/verbose_object.rb +1 -5
  107. data/lib/yaml/transform.rb +1 -1
  108. data/lib/yaml/yregexpath.rb +1 -1
  109. data/test/algorithms/simulated_annealing_test.rb +79 -80
  110. data/test/unit-suite.yml +5 -3
  111. metadata +179 -172
  112. data/SPEC.dyn.yml +0 -10
  113. data/SPEC.gemspec +0 -14
  114. data/lib/uri_ex.rb +0 -110
  115. 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
-
@@ -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