right_support 2.6.17 → 2.7.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 (83) hide show
  1. data/.rspec +4 -0
  2. data/CHANGELOG.rdoc +37 -0
  3. data/Gemfile +29 -0
  4. data/Gemfile.lock +111 -0
  5. data/README.rdoc +2 -0
  6. data/Rakefile +62 -0
  7. data/VERSION +1 -0
  8. data/features/balancer_error_handling.feature +34 -0
  9. data/features/balancer_health_check.feature +33 -0
  10. data/features/continuous_integration.feature +51 -0
  11. data/features/continuous_integration_cucumber.feature +28 -0
  12. data/features/continuous_integration_rspec1.feature +28 -0
  13. data/features/continuous_integration_rspec2.feature +28 -0
  14. data/features/http_client_timeout.feature +19 -0
  15. data/features/serialization.feature +95 -0
  16. data/features/step_definitions/http_client_steps.rb +27 -0
  17. data/features/step_definitions/request_balancer_steps.rb +93 -0
  18. data/features/step_definitions/ruby_steps.rb +176 -0
  19. data/features/step_definitions/serialization_steps.rb +96 -0
  20. data/features/step_definitions/server_steps.rb +134 -0
  21. data/features/support/env.rb +138 -0
  22. data/features/support/file_utils_bundler_mixin.rb +45 -0
  23. data/lib/right_support/ci/java_cucumber_formatter.rb +22 -8
  24. data/lib/right_support/ci/java_spec_formatter.rb +26 -8
  25. data/lib/right_support/ci/rake_task.rb +3 -0
  26. data/lib/right_support/ci.rb +24 -0
  27. data/lib/right_support/crypto/signed_hash.rb +22 -0
  28. data/lib/right_support/data/serializer.rb +24 -2
  29. data/lib/right_support/net/address_helper.rb +20 -8
  30. data/lib/right_support/net/dns.rb +20 -8
  31. data/lib/right_support/net/http_client.rb +22 -0
  32. data/lib/right_support/net/request_balancer.rb +27 -21
  33. data/lib/right_support/net/s3_helper.rb +20 -8
  34. data/lib/right_support/net/ssl/open_ssl_patch.rb +22 -0
  35. data/lib/right_support/net/ssl.rb +20 -8
  36. data/lib/right_support/ruby/easy_singleton.rb +22 -0
  37. data/lib/right_support/ruby/object_extensions.rb +22 -0
  38. data/lib/right_support/ruby/string_extensions.rb +1 -1
  39. data/lib/right_support.rb +13 -10
  40. data/right_support.gemspec +180 -18
  41. data/right_support.rconf +8 -0
  42. data/spec/config/feature_set_spec.rb +83 -0
  43. data/spec/crypto/signed_hash_spec.rb +60 -0
  44. data/spec/data/hash_tools_spec.rb +471 -0
  45. data/spec/data/uuid_spec.rb +45 -0
  46. data/spec/db/cassandra_model_part1_spec.rb +84 -0
  47. data/spec/db/cassandra_model_part2_spec.rb +73 -0
  48. data/spec/db/cassandra_model_spec.rb +359 -0
  49. data/spec/fixtures/encrypted_priv_rsa.pem +30 -0
  50. data/spec/fixtures/good_priv_dsa.pem +12 -0
  51. data/spec/fixtures/good_priv_rsa.pem +15 -0
  52. data/spec/fixtures/good_pub_dsa.ssh +1 -0
  53. data/spec/fixtures/good_pub_rsa.pem +5 -0
  54. data/spec/fixtures/good_pub_rsa.ssh +1 -0
  55. data/spec/log/exception_logger_spec.rb +76 -0
  56. data/spec/log/filter_logger_spec.rb +8 -0
  57. data/spec/log/mixin_spec.rb +62 -0
  58. data/spec/log/multiplexer_spec.rb +54 -0
  59. data/spec/log/null_logger_spec.rb +36 -0
  60. data/spec/log/system_logger_spec.rb +92 -0
  61. data/spec/net/address_helper_spec.rb +57 -0
  62. data/spec/net/balancing/health_check_spec.rb +382 -0
  63. data/spec/net/balancing/round_robin_spec.rb +15 -0
  64. data/spec/net/balancing/sticky_policy_spec.rb +92 -0
  65. data/spec/net/dns_spec.rb +152 -0
  66. data/spec/net/http_client_spec.rb +171 -0
  67. data/spec/net/request_balancer_spec.rb +579 -0
  68. data/spec/net/s3_helper_spec.rb +160 -0
  69. data/spec/net/ssl_spec.rb +42 -0
  70. data/spec/net/string_encoder_spec.rb +58 -0
  71. data/spec/rack/log_setter_spec.rb +5 -0
  72. data/spec/rack/request_logger_spec.rb +68 -0
  73. data/spec/rack/request_tracker_spec.rb +5 -0
  74. data/spec/ruby/easy_singleton_spec.rb +72 -0
  75. data/spec/ruby/object_extensions_spec.rb +27 -0
  76. data/spec/ruby/string_extensions_spec.rb +98 -0
  77. data/spec/spec_helper.rb +181 -0
  78. data/spec/stats/activity_spec.rb +193 -0
  79. data/spec/stats/exceptions_spec.rb +123 -0
  80. data/spec/stats/helpers_spec.rb +603 -0
  81. data/spec/validation/openssl_spec.rb +37 -0
  82. data/spec/validation/ssh_spec.rb +39 -0
  83. metadata +218 -19
@@ -1,12 +1,24 @@
1
- # Copyright (c) 2012- RightScale, Inc, All Rights Reserved Worldwide.
2
1
  #
3
- # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
- # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
- # reproduction, modification, or disclosure of this program is
6
- # strictly prohibited. Any use of this program by an authorized
7
- # licensee is strictly subject to the terms and conditions,
8
- # including confidentiality obligations, set forth in the applicable
9
- # License Agreement between RightScale.com, Inc. and the licensee.
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
22
 
11
23
  # Cucumber naïvely requires JUST this file without necessarily requiring
12
24
  # RightSupport's main file. Make up for Cucumber's shortcomings.
@@ -14,6 +26,8 @@ require 'right_support'
14
26
 
15
27
  module RightSupport::CI
16
28
  if require_succeeds?('cucumber/formatter/junit')
29
+ # @deprecated Please do not use this class
30
+ # @see RightDevelop::CI::JavaCucumberFormatter
17
31
  class JavaCucumberFormatter < Cucumber::Formatter::Junit
18
32
  private
19
33
 
@@ -1,18 +1,33 @@
1
- # Copyright (c) 2012- RightScale, Inc, All Rights Reserved Worldwide.
2
1
  #
3
- # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
- # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
- # reproduction, modification, or disclosure of this program is
6
- # strictly prohibited. Any use of this program by an authorized
7
- # licensee is strictly subject to the terms and conditions,
8
- # including confidentiality obligations, set forth in the applicable
9
- # License Agreement between RightScale.com, Inc. and the licensee.
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
22
 
11
23
  require 'time'
12
24
 
13
25
  module RightSupport::CI
14
26
  if require_succeeds?('spec/runner/formatter/base_text_formatter')
15
27
  # RSpec 1.x
28
+ #
29
+ # @deprecated Please do not use this class
30
+ # @see RightDevelop::CI::JavaSpecFormatter
16
31
  class JavaSpecFormatter < Spec::Runner::Formatter::BaseTextFormatter
17
32
  def initialize(*args)
18
33
  begin
@@ -108,6 +123,9 @@ module RightSupport::CI
108
123
  end
109
124
  elsif require_succeeds?('rspec/core/formatters/base_formatter')
110
125
  # RSpec 2.x
126
+ #
127
+ # @deprecated Please do not use this class
128
+ # @see RightDevelop::CI::JavaSpecFormatter
111
129
  class JavaSpecFormatter < RSpec::Core::Formatters::BaseFormatter
112
130
  def initialize(*args)
113
131
  begin
@@ -28,6 +28,9 @@ require 'right_support'
28
28
  module RightSupport::CI
29
29
  # A Rake task definition that creates a CI namespace with appropriate
30
30
  # tests.
31
+ #
32
+ # @deprecated Please do not use this class
33
+ # @see RightDevelop::CI::RakeTask
31
34
  class RakeTask < ::Rake::TaskLib
32
35
  include ::Rake::DSL if defined?(::Rake::DSL)
33
36
 
@@ -1,4 +1,28 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  module RightSupport
24
+ # @deprecated Please do not use the contents of this module
25
+ # @see RightDevelop::CI
2
26
  module CI
3
27
  end
4
28
  end
@@ -1,3 +1,25 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  require 'digest/sha1'
2
24
 
3
25
  module RightSupport::Crypto
@@ -1,3 +1,25 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  require 'time'
2
24
  require 'date'
3
25
 
@@ -132,7 +154,7 @@ module RightSupport::Data
132
154
  else
133
155
  object
134
156
  end
135
- when Fixnum, Float, TrueClass, FalseClass, NilClass
157
+ when Numeric, TrueClass, FalseClass, NilClass
136
158
  object
137
159
  when Hash
138
160
  object.inject({}) do |result, (k, v)|
@@ -181,7 +203,7 @@ module RightSupport::Data
181
203
  # Normal String
182
204
  jsonish
183
205
  end
184
- when Fixnum, Float, TrueClass, FalseClass, NilClass
206
+ when Numeric, TrueClass, FalseClass, NilClass
185
207
  jsonish
186
208
  when Hash
187
209
  if jsonish.key?(@marker) # We have a serialized Ruby object!
@@ -1,12 +1,24 @@
1
- # Copyright (c) 2009-2011 RightScale, Inc, All Rights Reserved Worldwide.
2
1
  #
3
- # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
- # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
- # reproduction, modification, or disclosure of this program is
6
- # strictly prohibited. Any use of this program by an authorized
7
- # licensee is strictly subject to the terms and conditions,
8
- # including confidentiality obligations, set forth in the applicable
9
- # License Agreement between RightScale.com, Inc. and the licensee.
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
22
 
11
23
  require 'socket'
12
24
 
@@ -1,12 +1,24 @@
1
- # Copyright (c) 2009-2011 RightScale, Inc, All Rights Reserved Worldwide.
2
1
  #
3
- # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
- # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
- # reproduction, modification, or disclosure of this program is
6
- # strictly prohibited. Any use of this program by an authorized
7
- # licensee is strictly subject to the terms and conditions,
8
- # including confidentiality obligations, set forth in the applicable
9
- # License Agreement between RightScale.com, Inc. and the licensee.
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
22
 
11
23
  require 'socket'
12
24
  require 'uri'
@@ -1,3 +1,25 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  module RightSupport::Net
2
24
  if require_succeeds?('right_http_connection')
3
25
  #nothing, nothing at all! just need to make sure
@@ -1,3 +1,25 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  module RightSupport::Net
2
24
  # Raised to indicate the (uncommon) error condition where a RequestBalancer rotated
3
25
  # through EVERY URL in a list without getting a non-nil, non-timeout response.
@@ -38,6 +60,7 @@ module RightSupport::Net
38
60
  class RequestBalancer
39
61
  include RightSupport::Log::Mixin
40
62
 
63
+ # @deprecated please do not refer to this constant; it will be removed in RightSupport 3.0
41
64
  DEFAULT_RETRY_PROC = lambda do |ep, n|
42
65
  n < ep.size
43
66
  end
@@ -49,6 +72,7 @@ module RightSupport::Net
49
72
  #
50
73
  # A good example of this phenomenon is the rest-client gem, whose base exception
51
74
  # class is derived from RuntimeError!!
75
+ # @deprecated please do not refer to this constant; it will be removed in RightSupport 3.0
52
76
  FATAL_RUBY_EXCEPTIONS = [
53
77
  # Exceptions that indicate something is seriously wrong with the Ruby VM.
54
78
  NoMemoryError, SystemStackError, SignalException, SystemExit,
@@ -60,34 +84,16 @@ module RightSupport::Net
60
84
  RegexpError, ThreadError, TypeError, ZeroDivisionError
61
85
  ]
62
86
 
63
- spec_namespaces = []
64
-
65
- if require_succeeds?('rspec')
66
- # RSpec 2.x
67
- spec_namespaces += [::RSpec::Mocks, ::RSpec::Expectations]
68
- elsif require_succeeds?('spec')
69
- # RSpec 1.x
70
- spec_namespaces += [::Spec::Expectations]
71
- end
72
-
73
- # As a kindness to unit test authors, count test-framework exceptions as fatal.
87
+ # @deprecated please do not refer to this constant; it will be removed in RightSupport 3.0
74
88
  FATAL_TEST_EXCEPTIONS = []
75
89
 
76
- # Use some reflection to locate all RSpec and Test::Unit exceptions
77
- spec_namespaces.each do |namespace|
78
- namespace.constants.each do |konst|
79
- konst = namespace.const_get(konst)
80
- if konst.is_a?(Class) && konst.ancestors.include?(Exception)
81
- FATAL_TEST_EXCEPTIONS << konst
82
- end
83
- end
84
- end
85
-
86
90
  # Well-considered exceptions that should count as fatal (non-retryable) by the balancer.
87
91
  # Used by default, and if you provide a :fatal option to the balancer, you should probably
88
92
  # consult this list in your overridden fatal determination!
93
+ # @deprecated please do not refer to this constant; it will be removed in RightSupport 3.0
89
94
  DEFAULT_FATAL_EXCEPTIONS = FATAL_RUBY_EXCEPTIONS + FATAL_TEST_EXCEPTIONS
90
95
 
96
+ # @deprecated please do not refer to this constant; it will be removed in RightSupport 3.0
91
97
  DEFAULT_FATAL_PROC = lambda do |e|
92
98
  if DEFAULT_FATAL_EXCEPTIONS.any? { |c| e.is_a?(c) }
93
99
  #Some Ruby builtin exceptions indicate program errors
@@ -1,12 +1,24 @@
1
- # Copyright (c) 2009-2011 RightScale, Inc, All Rights Reserved Worldwide.
2
1
  #
3
- # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
- # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
- # reproduction, modification, or disclosure of this program is
6
- # strictly prohibited. Any use of this program by an authorized
7
- # licensee is strictly subject to the terms and conditions,
8
- # including confidentiality obligations, set forth in the applicable
9
- # License Agreement between RightScale.com, Inc. and the licensee.
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
22
 
11
23
  module RightSupport::Net
12
24
  # Class that provides S3 functionality.
@@ -1,3 +1,25 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  require 'openssl'
2
24
  # Under Ruby 1.8 the OpenSSL bindings have a stuttering problem
3
25
  require 'openssl/ssl' if RUBY_VERSION < '1.9'
@@ -1,12 +1,24 @@
1
- # Copyright (c) 2009-2011 RightScale, Inc, All Rights Reserved Worldwide.
2
1
  #
3
- # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
- # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
- # reproduction, modification, or disclosure of this program is
6
- # strictly prohibited. Any use of this program by an authorized
7
- # licensee is strictly subject to the terms and conditions,
8
- # including confidentiality obligations, set forth in the applicable
9
- # License Agreement between RightScale.com, Inc. and the licensee.
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
22
 
11
23
  require 'right_support/net/ssl/open_ssl_patch'
12
24
 
@@ -1,3 +1,25 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  require 'singleton'
2
24
 
3
25
  module RightSupport::Ruby
@@ -1,3 +1,25 @@
1
+ #
2
+ # Copyright (c) 2009-2011 RightScale Inc
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
1
23
  module RightSupport::Ruby
2
24
  module ObjectExtensions
3
25
  # Attempt to require one or more source files.
@@ -24,7 +24,7 @@ require 'rbconfig'
24
24
 
25
25
  module RightSupport::Ruby
26
26
  module StringExtensions
27
- if require_succeeds?('active_support')
27
+ if require_succeeds?('active_support/core_ext')
28
28
  ACTIVE_SUPPORT_WORKALIKES = false
29
29
  else
30
30
  ACTIVE_SUPPORT_WORKALIKES = true
data/lib/right_support.rb CHANGED
@@ -2,13 +2,16 @@
2
2
  require 'thread'
3
3
 
4
4
  require 'right_support/ruby'
5
- require 'right_support/log'
6
- require 'right_support/data'
7
- require 'right_support/validation'
8
- require 'right_support/crypto'
9
- require 'right_support/rack'
10
- require 'right_support/db'
11
- require 'right_support/net'
12
- require 'right_support/config'
13
- require 'right_support/stats'
14
- require 'right_support/ci'
5
+
6
+ module RightSupport
7
+ autoload :Log, 'right_support/log'
8
+ autoload :Data, 'right_support/data'
9
+ autoload :Validation, 'right_support/validation'
10
+ autoload :Crypto, 'right_support/crypto'
11
+ autoload :Rack, 'right_support/rack'
12
+ autoload :DB, 'right_support/db'
13
+ autoload :Net, 'right_support/net'
14
+ autoload :Config, 'right_support/config'
15
+ autoload :Stats, 'right_support/stats'
16
+ autoload :CI, 'right_support/ci'
17
+ end