right_support 2.8.31 → 2.8.32

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: 54dcd26e6d8094ac8b3f8ad42dae62aaf9287a7c
4
- data.tar.gz: aa1a58306c4222a41daa45cc30626723065615a1
3
+ metadata.gz: a2006046eff88bf5bcadd1cbae03279872cada84
4
+ data.tar.gz: 318dac67ca4962d08e4f990b92c6687b7bfa77c0
5
5
  SHA512:
6
- metadata.gz: 97f3b74d83992e636fbc6d09926503db59a427f4907ea1679754dd916be7fee3764d88202be9aead0f484c878efe69d4bf77bfb0d580596a5009e74ad5d76e47
7
- data.tar.gz: 6192c632633ef97f57ac37fc8159fe40b22a1eebe269608efb560615e138e69118c8b81702f853bfb7042819777225ffda197dfe8b93de21320e2789075532b4
6
+ metadata.gz: 7a1c5c26f1e59fba43adb37a272f5d1876a5a7c05704b83aa75c45cf9c5437780974d70f74546923ea32c76d661adb8044ac76a8321f180ffbbb26edf56bf21a
7
+ data.tar.gz: 0b03e8fa439261c5b64e62d673750d4d002fd022e179b846f51c6fcc9c2b732a2beefc7cc5de08737466a409f5dbf13d5594078fd4265aa10e38c8e4b68006e8
data/Gemfile CHANGED
@@ -32,3 +32,10 @@ group :test do
32
32
  # under Ruby 1.8.
33
33
  gem 'nokogiri', '~> 1.5.0'
34
34
  end
35
+
36
+ # Gems that are used for development and not for CI.
37
+ group :development do
38
+ gem 'ruby-debug', :platforms => [:ruby_18]
39
+ gem 'pry', :platforms => [:ruby_19, :ruby_20, :ruby_21]
40
+ gem 'pry-byebug', :platforms => [:ruby_19, :ruby_20, :ruby_21]
41
+ end
data/Gemfile.lock CHANGED
@@ -3,11 +3,17 @@ GEM
3
3
  specs:
4
4
  addressable (2.2.8)
5
5
  builder (3.2.2)
6
+ byebug (2.7.0)
7
+ columnize (~> 0.3)
8
+ debugger-linecache (~> 1.2)
9
+ coderay (1.1.0)
10
+ columnize (0.8.9)
6
11
  cucumber (1.3.2)
7
12
  builder (>= 2.1.2)
8
13
  diff-lcs (>= 1.1.3)
9
14
  gherkin (~> 2.12.0)
10
15
  multi_json (~> 1.3)
16
+ debugger-linecache (1.2.0)
11
17
  diff-lcs (1.2.5)
12
18
  extlib (0.9.16)
13
19
  faraday (0.8.9)
@@ -40,6 +46,7 @@ GEM
40
46
  multi_json (>= 1.5)
41
47
  macaddr (1.6.5)
42
48
  systemu (~> 2.6.2)
49
+ method_source (0.8.2)
43
50
  mime-types (1.25.1)
44
51
  multi_json (1.10.1)
45
52
  multi_xml (0.5.5)
@@ -52,6 +59,13 @@ GEM
52
59
  multi_json (~> 1.3)
53
60
  multi_xml (~> 0.5)
54
61
  rack (~> 1.2)
62
+ pry (0.10.1)
63
+ coderay (~> 1.1.0)
64
+ method_source (~> 0.8.1)
65
+ slop (~> 3.4)
66
+ pry-byebug (1.3.3)
67
+ byebug (~> 2.7)
68
+ pry (~> 0.10)
55
69
  rack (1.5.2)
56
70
  rake (0.9.6)
57
71
  rdoc (4.1.1)
@@ -84,6 +98,7 @@ GEM
84
98
  diff-lcs (>= 1.1.3, < 2.0)
85
99
  rspec-mocks (2.13.1)
86
100
  simple_uuid (0.4.0)
101
+ slop (3.6.0)
87
102
  systemu (2.6.3)
88
103
  trollop (2.0)
89
104
  uuid (2.3.7)
@@ -103,9 +118,12 @@ DEPENDENCIES
103
118
  mime-types (~> 1.0)
104
119
  net-ssh (~> 2.0)
105
120
  nokogiri (~> 1.5.0)
121
+ pry
122
+ pry-byebug
106
123
  rest-client (~> 1.6)
107
124
  right_develop (~> 2.1)
108
125
  rspec (~> 2.13.0)
126
+ ruby-debug
109
127
  simple_uuid (~> 0.2)
110
128
  uuid (~> 2.3)
111
129
  uuidtools (~> 2.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.8.31
1
+ 2.8.32
@@ -31,13 +31,14 @@ Feature: JSON serialization
31
31
  When I serialize a complex random data structure
32
32
  Then the serialized value should round-trip cleanly
33
33
 
34
- Scenario Outline: Ruby string with non UTF-8 characters
35
- When I serialize the Ruby value: <ruby>
36
- Then the serialized value should be: <json>
34
+ Scenario: invalid UTF-8 characters
35
+ When I serialize the Ruby value: "\xC0\xBCscript>\xC0\xBC/script>"
36
+ Then the serialized value should be: "??script>??/script>"
37
37
 
38
- Examples:
39
- | ruby | json |
40
- | "\xC0\xBCscript>\xC0\xBC/script>" | "script>/script>" |
38
+ Scenario: valid UTF-8 characters
39
+ When I serialize the Ruby value: "onê"
40
+ Then the serialized value should be: "onê"
41
+ And the serialized value should round-trip cleanly
41
42
 
42
43
  Scenario Outline: object-escaped Symbol
43
44
  When I serialize the Ruby value: <ruby>
@@ -30,6 +30,14 @@ $:.unshift(File.expand_path('../../../lib', __FILE__)) #ensure we load THIS proj
30
30
  require 'right_support'
31
31
  require 'right_support/ci'
32
32
 
33
+ ['pry', 'ruby-debug'].each do |debugger|
34
+ begin
35
+ require debugger
36
+ rescue LoadError
37
+ # ignore
38
+ end
39
+ end
40
+
33
41
  module RandomValueHelper
34
42
  RANDOM_KEY_CLASSES = [String, Integer, Float, TrueClass, FalseClass]
35
43
  RANDOM_VALUE_CLASSES = RANDOM_KEY_CLASSES + [Array, Hash]
@@ -159,10 +159,17 @@ module RightSupport::Data
159
159
  # @param [String] dirty the string to be scrubbed
160
160
  # @return [String]
161
161
  def scrub_string(dirty)
162
- dirty.dup.force_encoding(Encoding::BINARY).encode(Encoding::UTF_8,
163
- :invalid => :replace,
164
- :undef => :replace,
165
- :replace => '')
162
+ if dirty.encoding == Encoding::UTF_8 && dirty.valid_encoding?
163
+ # Nothing to do
164
+ dirty
165
+ else
166
+ # Some other encoding, or string has invalid characters. Scrub, and possibly lose
167
+ # data in the process
168
+ dirty.dup.encode(Encoding::UTF_8,
169
+ :invalid => :replace,
170
+ :undef => :replace,
171
+ :replace => '?')
172
+ end
166
173
  end
167
174
  else
168
175
  warn "Cannot deal with invalid UTF-8 codepoints; install iconv or upgrade to Ruby > 1.8"
@@ -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_support 2.8.31 ruby lib
5
+ # stub: right_support 2.8.32 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "right_support"
9
- s.version = "2.8.31"
9
+ s.version = "2.8.32"
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", "Sergey Sergyenko", "Ryan Williamson", "Lee Kirchhoff", "Alexey Karpik", "Scott Messier"]
14
- s.date = "2014-09-25"
14
+ s.date = "2014-09-30"
15
15
  s.description = "A toolkit of useful, reusable foundation code created by RightScale."
16
16
  s.email = "support@rightscale.com"
17
17
  s.extra_rdoc_files = [
@@ -145,5 +145,23 @@ Gem::Specification.new do |s|
145
145
  s.licenses = ["MIT"]
146
146
  s.rubygems_version = "2.2.0"
147
147
  s.summary = "Reusable foundation code."
148
+
149
+ if s.respond_to? :specification_version then
150
+ s.specification_version = 4
151
+
152
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
153
+ s.add_development_dependency(%q<ruby-debug>, [">= 0"])
154
+ s.add_development_dependency(%q<pry>, [">= 0"])
155
+ s.add_development_dependency(%q<pry-byebug>, [">= 0"])
156
+ else
157
+ s.add_dependency(%q<ruby-debug>, [">= 0"])
158
+ s.add_dependency(%q<pry>, [">= 0"])
159
+ s.add_dependency(%q<pry-byebug>, [">= 0"])
160
+ end
161
+ else
162
+ s.add_dependency(%q<ruby-debug>, [">= 0"])
163
+ s.add_dependency(%q<pry>, [">= 0"])
164
+ s.add_dependency(%q<pry-byebug>, [">= 0"])
165
+ end
148
166
  end
149
167
 
data/spec/spec_helper.rb CHANGED
@@ -26,6 +26,14 @@ require 'flexmock'
26
26
  $:.unshift(File.expand_path('../../../lib', __FILE__)) #ensure we load THIS project's code, not an installed gem
27
27
  require 'right_support'
28
28
 
29
+ ['pry', 'ruby-debug'].each do |debugger|
30
+ begin
31
+ require debugger
32
+ rescue LoadError
33
+ # ignore
34
+ end
35
+ end
36
+
29
37
  RSpec.configure do |config|
30
38
  config.mock_with :flexmock
31
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.31
4
+ version: 2.8.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Spataro
@@ -13,8 +13,50 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-09-25 00:00:00.000000000 Z
17
- dependencies: []
16
+ date: 2014-09-30 00:00:00.000000000 Z
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ name: ruby-debug
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: '0'
25
+ type: :development
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ - !ruby/object:Gem::Dependency
33
+ name: pry
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ type: :development
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: pry-byebug
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ type: :development
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
18
60
  description: A toolkit of useful, reusable foundation code created by RightScale.
19
61
  email: support@rightscale.com
20
62
  executables: []