fog-json 1.0.0 → 1.0.1

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: 5e124040466b4421e3122ba4f1677223dec35fe8
4
- data.tar.gz: e32250b78befa011a70da8f6863f6a5408309717
3
+ metadata.gz: 1d35ab21038993c3c479f37b885344ad0fa16fda
4
+ data.tar.gz: 597d5c1f78ae19d8e3fea18181eeb79dd7a0c647
5
5
  SHA512:
6
- metadata.gz: 684744519501cccbdf33f8b7e25b357d859b4c86ce75dcdb8a72eba3bec4e55aa5427f9a8f33aa5f86bd9efeb2ac31fe0980489f68ff66896e4adb4cba49f6af
7
- data.tar.gz: c962308b5ff5d20d3c50fc1cf72a1138085a6eb0bf8dd1e598782610f80f031b97dcbeec7a3620e46d5ea6a5f0277cae7ba6c7a7572019fbc42cc605de33be85
6
+ metadata.gz: 39262a6ae97e1bde2ae710d4ab686ace46ffe00114591a034bda82f25daa4bbdbd02cb8c65244c3855f18dc331de1eed3e7ae17505cd0d8ab3bed0461f72f161
7
+ data.tar.gz: 29644989cea0912295ef7d8ad219f504156a46d51ee598d5afe1b4d0e4dffd08234ad1d8ad5845e71f694febb648c1cb2d65826617ce1f52eab076723d818e75
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  .config
5
5
  .yardoc
6
6
  Gemfile.lock
7
+ gemfiles/*.lock
7
8
  InstalledFiles
8
9
  _yardoc
9
10
  coverage
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ language: ruby
2
+
3
+ matrix:
4
+ include:
5
+ - rvm: 1.8.7
6
+ gemfile: gemfiles/Gemfile-1.8.7
7
+ - rvm: jruby-18mode
8
+ gemfile: gemfiles/Gemfile-1.8.7
9
+ - rvm: 1.9.3
10
+ gemfile: Gemfile
11
+ - rvm: jruby-19mode
12
+ gemfile: Gemfile
13
+ - rvm: 2.0.0
14
+ gemfile: Gemfile
15
+ - rvm: 2.1.0
16
+ gemfile: Gemfile
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ v1.0.1
2
+
3
+ Changes:
4
+
5
+ * Use a relative require path
6
+
7
+ v1.0.0
8
+
9
+ Initial release.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,18 @@
1
+ ## Getting Involved
2
+
3
+ New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
4
+
5
+ ### Coding
6
+
7
+ * Pick a task:
8
+ * Offer feedback on open [pull requests](https://github.com/fog/fog-json/pulls).
9
+ * Review open [issues](https://github.com/fog/fog-json/issues) for things to help on.
10
+ * [Create an issue](https://github.com/fog/fog-json/issues/new) to start a discussion on additions or features.
11
+ * Fork the project, add your changes and tests to cover them in a topic branch.
12
+ * Commit your changes and rebase against `fog/fog-json` to ensure everything is up to date.
13
+ * [Submit a pull request](https://github.com/fog/fog-json/compare/).
14
+
15
+ ### Non-Coding
16
+
17
+ * Offer feedback on open [issues](https://github.com/fog/fog-json/issues).
18
+ * Organize or volunteer at events.
data/CONTRIBUTORS.md ADDED
@@ -0,0 +1 @@
1
+ * Wesley Beary <geemus+github@gmail.com>
data/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 [CONTRIBUTORS.md](https://github.com/fog/fog/blob/master/CONTRIBUTORS.md)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/fog-json.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.add_dependency "fog-core", "~> 1.0"
22
23
  spec.add_dependency "multi_json", "~> 1.0"
23
24
 
24
25
  spec.add_development_dependency "bundler", "~> 1.5"
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rake", "~> 10.1.0"
4
+ gem "mime-types", "~>1.16"
5
+ gemspec :path => ".."
data/lib/fog/json.rb CHANGED
@@ -1,6 +1,6 @@
1
- require "fog/json/version"
2
1
  require "fog/core"
3
2
  require "multi_json"
3
+ require File.expand_path("../json/version", __FILE__)
4
4
 
5
5
  module Fog
6
6
  # The {JSON} module includes functionality that is common between APIs using JSON to send and
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Json
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -2,12 +2,15 @@ require "minitest/autorun"
2
2
  require "fog/json"
3
3
 
4
4
  class TestJSONDecoding < Minitest::Test
5
- def test_decode_with_valid_string
6
- @json = %q{{"key":"value", "array": ["one", "two", "three"]}}
7
- @expected = {
8
- "key" => "value",
9
- "array" => %W(one two three)
10
- }
5
+ def test_decode_array
6
+ @json = %q{["one", "two", "three"]}
7
+ @expected = %w(one two three)
8
+ assert_equal @expected, Fog::JSON.decode(@json)
9
+ end
10
+
11
+ def test_decode_hash
12
+ @json = %q{{"key":"value"}}
13
+ @expected = { "key" => "value" }
11
14
  assert_equal @expected, Fog::JSON.decode(@json)
12
15
  end
13
16
 
@@ -2,16 +2,22 @@ require "minitest/autorun"
2
2
  require "fog/json"
3
3
 
4
4
  class TestJSONEncoding < Minitest::Test
5
- def test_encode_with_valid_hash
5
+ def test_encode_array
6
+ @array = %W(one two three)
7
+ @expected = %q{["one","two","three"]}
8
+ assert_equal @expected, Fog::JSON.encode(@array)
9
+ end
10
+
11
+ def test_encode_hash
6
12
  @hash = {
7
- "key" => "value",
8
- "array" => %W(one two three)
13
+ "key" => "value"
9
14
  }
10
- @expected = %q{{"key":"value","array":["one","two","three"]}}
15
+ @expected = %q{{"key":"value"}}
11
16
  assert_equal @expected, Fog::JSON.encode(@hash)
12
17
  end
13
18
 
14
19
  def test_encode_with_bad_input
20
+ skip if %w(1.8.7 2.0.0).include?(RUBY_VERSION)
15
21
  assert_raises(Fog::JSON::EncodeError) { Fog::JSON.encode("\x82\xAC\xEF") }
16
22
  end
17
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wesley Beary (geemus)
@@ -10,8 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-02-13 00:00:00.000000000 Z
13
+ date: 2015-04-07 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: fog-core
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '1.0'
15
29
  - !ruby/object:Gem::Dependency
16
30
  name: multi_json
17
31
  requirement: !ruby/object:Gem::Requirement
@@ -79,11 +93,17 @@ extensions: []
79
93
  extra_rdoc_files: []
80
94
  files:
81
95
  - ".gitignore"
96
+ - ".travis.yml"
97
+ - CHANGELOG.md
98
+ - CONTRIBUTING.md
99
+ - CONTRIBUTORS.md
82
100
  - Gemfile
101
+ - LICENSE.md
83
102
  - LICENSE.txt
84
103
  - README.md
85
104
  - Rakefile
86
105
  - fog-json.gemspec
106
+ - gemfiles/Gemfile-1.8.7
87
107
  - lib/fog/json.rb
88
108
  - lib/fog/json/version.rb
89
109
  - test/json_decode_test.rb
@@ -109,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
129
  version: '0'
110
130
  requirements: []
111
131
  rubyforge_project:
112
- rubygems_version: 2.2.1
132
+ rubygems_version: 2.4.5
113
133
  signing_key:
114
134
  specification_version: 4
115
135
  summary: JSON parsing for fog providers
@@ -117,4 +137,3 @@ test_files:
117
137
  - test/json_decode_test.rb
118
138
  - test/json_encode_test.rb
119
139
  - test/json_sanitize_test.rb
120
- has_rdoc: