right_develop 3.0.3 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7989cf01a6dc582f7974ca8517043149e465d0f3
4
- data.tar.gz: b04cc7da6587497edd4c256d6ba16d74e55be1e2
3
+ metadata.gz: 75595aa0b043470ce941c74a449e02c91b6b3d0e
4
+ data.tar.gz: fabf099b71bf1a935e68fa7ffd7f1b0534c2e4fb
5
5
  SHA512:
6
- metadata.gz: f00e538f03810658bd3cc41c296787f6a0621ce7aabeb26ce3b92f7c612f32d60b328bf0192ecabd9f214eb4c6c21264133e75ef2840b3455144a334d8529dbb
7
- data.tar.gz: 7fce7bf3a7a856e04c7a359e7c01f4d335cb4f2ea6565bf1f360c6209ac2fe3ef275773b45c82a2589886220a5c2374911842c690c7110f91a2c7732cd04784c
6
+ metadata.gz: a7cb8687f1be119ea4599bb9ca094c92647ae529d8b024745417ae42458f48d2cc6a27e8e949bb4b37e3e5e1f44a653e8e71ed47178acb0c57a6ef9a461767e3
7
+ data.tar.gz: e1b224843dd49b113263f090608541ef66cee3b8f7e7bc2122b9dae99820991a0feb4b6bd2c9a8bfc99538c4f87ce70af7f01dc53f15388a93ab90f7482f913d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.3
1
+ 3.1.0
@@ -178,7 +178,7 @@ module RightDevelop::Testing::Client::Rest::Request
178
178
  file_path = nil
179
179
  end
180
180
  if file_path
181
- response_hash = ::Mash.new(::YAML.load_file(file_path))
181
+ response_hash = RightSupport::Data::Mash.new(::YAML.load_file(file_path))
182
182
  if response_hash[:peer_reset_connection]
183
183
  raise PeerResetConnectionError, 'Connection reset by peer'
184
184
  end
@@ -22,7 +22,6 @@
22
22
 
23
23
  # ancestor
24
24
  require 'right_develop/testing/recording'
25
- require 'extlib'
26
25
  require 'json'
27
26
  require 'logger'
28
27
  require 'rack/utils'
@@ -43,7 +42,7 @@ module RightDevelop::Testing::Recording
43
42
  # value would be ambiguous.
44
43
  STOP_TRAVERSAL_KEY = ''.freeze
45
44
 
46
- VALID_MODES = ::Mash.new(
45
+ VALID_MODES = RightSupport::Data::Mash.new(
47
46
  :admin => 'Administrative for changing mode, fixtures, etc. while running.',
48
47
  :echo => 'Echoes request back as response and validates route.',
49
48
  :playback => 'Playback a session for one or more stubbed web services.',
@@ -71,7 +70,7 @@ module RightDevelop::Testing::Recording
71
70
  def initialize(config_hash, options = nil)
72
71
  # defaults.
73
72
  current_dir = ::Dir.pwd
74
- defaults = ::Mash.new(
73
+ defaults = RightSupport::Data::Mash.new(
75
74
  'fixtures_dir' => ::File.expand_path(FIXTURES_DIR_NAME, current_dir),
76
75
  'log_level' => :info,
77
76
  'log_dir' => ::File.expand_path(LOG_DIR_NAME, current_dir),
@@ -89,7 +88,7 @@ module RightDevelop::Testing::Recording
89
88
  # another deep merge of any additional options.
90
89
  ::RightSupport::Data::HashTools.deep_merge!(config_hash, options)
91
90
  end
92
- @config_hash = ::Mash.new
91
+ @config_hash = RightSupport::Data::Mash.new
93
92
  mode(config_hash['mode'])
94
93
  admin(config_hash['admin'])
95
94
  routes(config_hash['routes'])
@@ -178,7 +177,7 @@ module RightDevelop::Testing::Recording
178
177
  # normalize routes for efficient usage but keep them separate from
179
178
  # user's config so that .to_hash returns something understandable and
180
179
  # JSONizable/YAMLable.
181
- @normalized_routes = value.inject(::Mash.new) do |r, (k, v)|
180
+ @normalized_routes = value.inject(RightSupport::Data::Mash.new) do |r, (k, v)|
182
181
  r[normalize_route_prefix(k)] = normalize_route_data(k, v)
183
182
  r
184
183
  end
@@ -252,11 +251,11 @@ module RightDevelop::Testing::Recording
252
251
  if subdir = route_data[:subdir]
253
252
  route_subdir = ::File.expand_path(::File.join(path, '..', subdir))
254
253
  ::Dir[::File.join(route_subdir, "**/*#{extension}")].each do |route_config_path|
255
- route_config_data = ::Mash.new(::YAML.load_file(route_config_path))
254
+ route_config_data = RightSupport::Data::Mash.new(::YAML.load_file(route_config_path))
256
255
  filename = ::File.basename(route_config_path)[0..-(extension.length + 1)]
257
256
  hash_path = ::File.dirname(route_config_path)[(route_subdir.length + 1)..-1].split('/')
258
257
  unless current_route_data = ::RightSupport::Data::HashTools.deep_get(route_data, hash_path)
259
- current_route_data = ::Mash.new
258
+ current_route_data = RightSupport::Data::Mash.new
260
259
  ::RightSupport::Data::HashTools.deep_set!(route_data, hash_path, current_route_data)
261
260
  end
262
261
 
@@ -288,19 +287,7 @@ module RightDevelop::Testing::Recording
288
287
  #
289
288
  # @return [Object] depends on input type
290
289
  def self.deep_mash(any)
291
- case any
292
- when Array
293
- # traverse arrays
294
- any.map { |i| deep_mash(i) }
295
- when Hash
296
- # mash the hash
297
- any.inject(::Mash.new) do |m, (k, v)|
298
- m[k] = deep_mash(v)
299
- m
300
- end
301
- else
302
- any # whatever
303
- end
290
+ RightSupport::Data::HashTools.deep_mash(any)
304
291
  end
305
292
 
306
293
  protected
@@ -449,7 +436,7 @@ module RightDevelop::Testing::Recording
449
436
  # FIX: don't think there is a need for wildcard qualifiers beyond URI
450
437
  # path (i.e. wildcard matchers) so they are not currently supported.
451
438
  qualifiers_to_data = regex_to_data[regex] ||= {}
452
- current_qualifiers = ::Mash.new
439
+ current_qualifiers = RightSupport::Data::Mash.new
453
440
  if k == STOP_TRAVERSAL_KEY
454
441
  # no qualifiers; stopped after URI path
455
442
  qualifiers_to_data[current_qualifiers] = normalize_route_stop_configuration(position, uri_path + [k], v)
@@ -475,8 +462,8 @@ module RightDevelop::Testing::Recording
475
462
  end
476
463
 
477
464
  # could be multiple qualifiers in a CGI-style string.
478
- current_qualifiers = ::Mash.new(current_qualifiers)
479
- more_qualifiers = ::Mash.new
465
+ current_qualifiers = RightSupport::Data::Mash.new(current_qualifiers)
466
+ more_qualifiers = RightSupport::Data::Mash.new
480
467
  ::CGI.unescape(subpath.last).split('&').each do |q|
481
468
  if matched = TYPE_NAME_VALUE_REGEX.match(q)
482
469
  case qualifier_type = matched[1]
@@ -507,13 +494,13 @@ module RightDevelop::Testing::Recording
507
494
  # not case-sensitive so convert the header keys to snake_case to
508
495
  # match normalized headers from request.
509
496
  if qualifier_type == 'header'
510
- qualifier = qualifier.inject(::Mash.new) do |h, (k, v)|
497
+ qualifier = qualifier.inject(RightSupport::Data::Mash.new) do |h, (k, v)|
511
498
  h[normalize_header_key(k)] = v
512
499
  h
513
500
  end
514
501
  end
515
502
  ::RightSupport::Data::HashTools.deep_merge!(
516
- more_qualifiers[qualifier_type] ||= ::Mash.new,
503
+ more_qualifiers[qualifier_type] ||= RightSupport::Data::Mash.new,
517
504
  qualifier)
518
505
  end
519
506
  else
@@ -552,7 +539,7 @@ module RightDevelop::Testing::Recording
552
539
  raise ConfigError, message
553
540
  end
554
541
 
555
- route_stop_config.inject(::Mash.new) do |rst, (rst_k, rst_v)|
542
+ route_stop_config.inject(RightSupport::Data::Mash.new) do |rst, (rst_k, rst_v)|
556
543
 
557
544
  # sanity check.
558
545
  unwanted_keys = rst_v.keys.map(&:to_s) - ALLOWED_CONFIG_ACTIONS
@@ -564,11 +551,11 @@ module RightDevelop::Testing::Recording
564
551
  raise ConfigError, message
565
552
  end
566
553
 
567
- rst[rst_k] = rst_v.inject(::Mash.new) do |kc, (kc_k, kc_v)|
554
+ rst[rst_k] = rst_v.inject(RightSupport::Data::Mash.new) do |kc, (kc_k, kc_v)|
568
555
  case kc_k
569
556
  when METADATA_CLASS::TIMEOUTS_KEY
570
557
  # sanity check.
571
- kc_v = kc_v.inject(::Mash.new) do |h, (k, v)|
558
+ kc_v = kc_v.inject(RightSupport::Data::Mash.new) do |h, (k, v)|
572
559
  h[k] = Integer(v)
573
560
  h
574
561
  end
@@ -601,7 +588,7 @@ module RightDevelop::Testing::Recording
601
588
  end
602
589
  when ::Hash
603
590
  # transform, variables
604
- kc_v[:header] = headers.inject(::Mash.new) do |h, (k, v)|
591
+ kc_v[:header] = headers.inject(RightSupport::Data::Mash.new) do |h, (k, v)|
605
592
  h[normalize_header_key(k)] = v
606
593
  h
607
594
  end
@@ -276,7 +276,7 @@ module RightDevelop::Testing::Recording
276
276
  #
277
277
  # @return [Mash] types to names to values
278
278
  def compute_typenames_to_values
279
- ::Mash.new(
279
+ RightSupport::Data::Mash.new(
280
280
  verb: @verb,
281
281
  query: parse_query_string(@uri.query.to_s),
282
282
  header: @headers,
@@ -409,7 +409,7 @@ module RightDevelop::Testing::Recording
409
409
  #
410
410
  # @return [Hash] effective route configuration
411
411
  def compute_effective_route_config
412
- result = ::Mash.new
412
+ result = RightSupport::Data::Mash.new
413
413
  if configuration_data = @route_data[MATCHERS_KEY]
414
414
  # the top-level keys are expected to be regular expressions used to
415
415
  # match only the URI path.
@@ -768,7 +768,7 @@ module RightDevelop::Testing::Recording
768
768
  {}
769
769
 
770
770
  # verb and (response-only) http_status are always significant.
771
- significant_data = ::Mash.new(verb: @verb)
771
+ significant_data = RightSupport::Data::Mash.new(verb: @verb)
772
772
  significant_data[:http_status] = @http_status if @http_status
773
773
 
774
774
  # headers
@@ -819,7 +819,7 @@ module RightDevelop::Testing::Recording
819
819
  def copy_if_significant(type, significant, significant_data)
820
820
  if significant_type = significant[type]
821
821
  significant_data[type] = recursive_selective_hash_copy(
822
- ::Mash.new, @typenames_to_values[type], significant_type)
822
+ RightSupport::Data::Mash.new, @typenames_to_values[type], significant_type)
823
823
  true
824
824
  else
825
825
  false
@@ -34,8 +34,8 @@ module RightDevelop::Testing::Server::MightApi
34
34
 
35
35
  # Rack (and Skeletor) apps and some known AWS apps only accept dash and
36
36
  # not underscore so ensure the default settings reflect the 80-20 rule.
37
- DEFAULT_PROXY_SETTINGS = ::Mash.new(
38
- header: ::Mash.new(
37
+ DEFAULT_PROXY_SETTINGS = RightSupport::Data::Mash.new(
38
+ header: RightSupport::Data::Mash.new(
39
39
  case: :capitalize,
40
40
  separator: :dash
41
41
  ).freeze
@@ -322,7 +322,7 @@ module RightDevelop::Testing::Server::MightApi
322
322
  if header_data = proxy_data[:header]
323
323
  to_separator = (header_data[:separator] == :underscore) ? '_' : '-'
324
324
  from_separator = (to_separator == '-') ? '_' : '-'
325
- proxied = headers.inject(::Mash.new) do |h, (k, v)|
325
+ proxied = headers.inject(RightSupport::Data::Mash.new) do |h, (k, v)|
326
326
  k = k.to_s
327
327
  case header_data[:case]
328
328
  when nil
@@ -342,7 +342,7 @@ module RightDevelop::Testing::Server::MightApi
342
342
  end
343
343
  end
344
344
  end
345
- proxied || ::Mash.new(headers)
345
+ proxied || RightSupport::Data::Mash.new(headers)
346
346
  end
347
347
 
348
348
  # rack has a convention of newline-delimited header multi-values.
@@ -140,8 +140,8 @@ module RightDevelop::Testing::Server::MightApi
140
140
  # load request/response pair to validate.
141
141
  request_file_path = ::File.join(requests_dir, path)
142
142
  response_file_path = ::File.join(responses_dir, path)
143
- request_data = ::Mash.new(::YAML.load_file(request_file_path))
144
- response_data = ::Mash.new(::YAML.load_file(response_file_path))
143
+ request_data = RightSupport::Data::Mash.new(::YAML.load_file(request_file_path))
144
+ response_data = RightSupport::Data::Mash.new(::YAML.load_file(response_file_path))
145
145
 
146
146
  # if confing contains unreachable (i.e. no available route) files
147
147
  # then that is ignorable.
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: right_develop 3.0.3 ruby lib
5
+ # stub: right_develop 3.1.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "right_develop"
9
- s.version = "3.0.3"
9
+ s.version = "3.1.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Tony Spataro"]
14
- s.date = "2014-09-03"
14
+ s.date = "2014-09-25"
15
15
  s.description = "A toolkit of development tools created by RightScale."
16
16
  s.email = "support@rightscale.com"
17
17
  s.executables = ["right_develop"]
@@ -78,19 +78,18 @@ Gem::Specification.new do |s|
78
78
  ]
79
79
  s.homepage = "https://github.com/rightscale/right_develop"
80
80
  s.licenses = ["MIT"]
81
- s.rubygems_version = "2.2.2"
81
+ s.rubygems_version = "2.2.0"
82
82
  s.summary = "Reusable dev & test code."
83
83
 
84
84
  if s.respond_to? :specification_version then
85
85
  s.specification_version = 4
86
86
 
87
87
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
88
- s.add_runtime_dependency(%q<right_support>, [">= 2.8.10"])
88
+ s.add_runtime_dependency(%q<right_support>, ["< 3.0.0", ">= 2.8.31"])
89
89
  s.add_runtime_dependency(%q<builder>, ["~> 3.0"])
90
90
  s.add_runtime_dependency(%q<trollop>, ["< 3.0", ">= 1.0"])
91
91
  s.add_runtime_dependency(%q<right_git>, [">= 1.0"])
92
92
  s.add_runtime_dependency(%q<right_aws>, [">= 2.1.0"])
93
- s.add_runtime_dependency(%q<extlib>, [">= 0"])
94
93
  s.add_runtime_dependency(%q<rack>, [">= 0"])
95
94
  s.add_development_dependency(%q<rake>, [">= 0.8.7"])
96
95
  s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
@@ -99,12 +98,11 @@ Gem::Specification.new do |s|
99
98
  s.add_development_dependency(%q<pry>, [">= 0"])
100
99
  s.add_development_dependency(%q<pry-byebug>, [">= 0"])
101
100
  else
102
- s.add_dependency(%q<right_support>, [">= 2.8.10"])
101
+ s.add_dependency(%q<right_support>, ["< 3.0.0", ">= 2.8.31"])
103
102
  s.add_dependency(%q<builder>, ["~> 3.0"])
104
103
  s.add_dependency(%q<trollop>, ["< 3.0", ">= 1.0"])
105
104
  s.add_dependency(%q<right_git>, [">= 1.0"])
106
105
  s.add_dependency(%q<right_aws>, [">= 2.1.0"])
107
- s.add_dependency(%q<extlib>, [">= 0"])
108
106
  s.add_dependency(%q<rack>, [">= 0"])
109
107
  s.add_dependency(%q<rake>, [">= 0.8.7"])
110
108
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
@@ -114,12 +112,11 @@ Gem::Specification.new do |s|
114
112
  s.add_dependency(%q<pry-byebug>, [">= 0"])
115
113
  end
116
114
  else
117
- s.add_dependency(%q<right_support>, [">= 2.8.10"])
115
+ s.add_dependency(%q<right_support>, ["< 3.0.0", ">= 2.8.31"])
118
116
  s.add_dependency(%q<builder>, ["~> 3.0"])
119
117
  s.add_dependency(%q<trollop>, ["< 3.0", ">= 1.0"])
120
118
  s.add_dependency(%q<right_git>, [">= 1.0"])
121
119
  s.add_dependency(%q<right_aws>, [">= 2.1.0"])
122
- s.add_dependency(%q<extlib>, [">= 0"])
123
120
  s.add_dependency(%q<rack>, [">= 0"])
124
121
  s.add_dependency(%q<rake>, [">= 0.8.7"])
125
122
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_develop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Spataro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-16 00:00:00.000000000 Z
11
+ date: 2014-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: right_support
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "<"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: 2.8.10
22
+ version: 2.8.31
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "<"
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.0
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: 2.8.10
32
+ version: 2.8.31
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: builder
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -86,20 +92,6 @@ dependencies:
86
92
  - - ">="
87
93
  - !ruby/object:Gem::Version
88
94
  version: 2.1.0
89
- - !ruby/object:Gem::Dependency
90
- name: extlib
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '0'
96
- type: :runtime
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
95
  - !ruby/object:Gem::Dependency
104
96
  name: rack
105
97
  requirement: !ruby/object:Gem::Requirement
@@ -282,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
274
  version: '0'
283
275
  requirements: []
284
276
  rubyforge_project:
285
- rubygems_version: 2.2.2
277
+ rubygems_version: 2.2.0
286
278
  signing_key:
287
279
  specification_version: 4
288
280
  summary: Reusable dev & test code.