gamifier 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0d784495186ef24052ed75fe234d48f27942eb75
4
+ data.tar.gz: 0d81b74f39e713aa00db0576d897936b8d3b7124
5
+ SHA512:
6
+ metadata.gz: fb12f2449fefa00eb974c4ae7502edf5568e0afc8a03874bfffa950678bbf76da3329a83d666c326b0bcf654621b9eeebc70f33aa6d1c5f738a7524c29b1c65a
7
+ data.tar.gz: 06e9a438a331bfb37c6515991d83d5a7a88e883dd87faacaf873cf3314da8c311cdecf0351dc91b449d1a2734a2128909dcc611a0ee278cfcf3436956a015d33
@@ -2,11 +2,12 @@
2
2
  require File.expand_path('../lib/gamifier/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
+ gem.license = 'MIT'
5
6
  gem.authors = ["Cyril Rohr"]
6
7
  gem.email = ["cyril.rohr@gmail.com"]
7
8
  gem.description = %q{Gem for accessing game engine APIs}
8
9
  gem.summary = %q{Currently supports Badgeville Core API}
9
- gem.homepage = ""
10
+ gem.homepage = "https://github.com/dimelo/gamifier"
10
11
 
11
12
  gem.files = `git ls-files`.split($\)
12
13
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -16,8 +17,8 @@ Gem::Specification.new do |gem|
16
17
  gem.version = Gamifier::VERSION
17
18
 
18
19
  gem.add_dependency "faraday", "~> 0.8"
19
- gem.add_dependency "json"
20
20
  gem.add_dependency "faraday_middleware", "~> 0.8"
21
+ gem.add_dependency "multi_json"
21
22
 
22
23
  gem.add_development_dependency('rspec', '~> 2')
23
24
  gem.add_development_dependency('webmock')
@@ -1,6 +1,7 @@
1
1
  require 'logger'
2
2
  require "gamifier/version"
3
3
  require 'gamifier/errors'
4
+ require "multi_json"
4
5
 
5
6
  module Gamifier
6
7
  class << self
@@ -40,7 +40,7 @@ module Gamifier
40
40
  attr_to_keep.each do |k,v|
41
41
  attr_to_keep[k] = encode(k.to_sym,v) || case v
42
42
  when Hash
43
- JSON.dump(v)
43
+ MultiJson.dump(v)
44
44
  # Lazyloaded attributes
45
45
  when Proc
46
46
  v.call
@@ -5,10 +5,10 @@ module Gamifier
5
5
  def encode(key, value)
6
6
  case key
7
7
  when :components
8
- JSON.dump(value)
8
+ MultiJson.dump(value)
9
9
  else
10
10
  super(key,value)
11
11
  end
12
12
  end
13
13
  end
14
- end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Gamifier
2
- VERSION = "1.1.2" unless defined?(Gamifier::VERSION)
2
+ VERSION = "1.1.3" unless defined?(Gamifier::VERSION)
3
3
  end
@@ -167,7 +167,7 @@ describe Gamifier::Engine do
167
167
 
168
168
  it "should return the parsed response if the status is in the 2xx range (except 204)" do
169
169
  stub_request(:get, "http://somewhere.ltd/resource.json").
170
- to_return(:body => JSON.dump(site), :headers => {'Content-Type' => 'application/json;charset=utf-8'})
170
+ to_return(:body => MultiJson.dump(site), :headers => {'Content-Type' => 'application/json;charset=utf-8'})
171
171
  @engine.transmit(:get, "/resource").should == site
172
172
  end
173
173
 
@@ -129,7 +129,7 @@ describe Gamifier::Model do
129
129
  describe "replace_if_successful" do
130
130
 
131
131
  it "should replace the attributes if res is a Hash and has a 'data' key" do
132
- @model.replace_if_successful(JSON.parse(raw_create)).should == @model
132
+ @model.replace_if_successful(MultiJson.load(raw_create)).should == @model
133
133
  @model._id.should == "4fc7661f49f83857cd006044"
134
134
  end
135
135
 
@@ -175,7 +175,7 @@ describe Gamifier::Model do
175
175
 
176
176
  it "should return the first entry if data is returned" do
177
177
  @engine.should_receive(:transmit).with(:get, "models/1234@dimelo.com", :query => {}).
178
- and_return JSON.parse(raw_find)
178
+ and_return MultiJson.load(raw_find)
179
179
  user = @collection.find("1234@dimelo.com")
180
180
  user.should be_a(Gamifier::Model)
181
181
  user._id.should == "4fc75d1a3dc648153b006183"
@@ -191,7 +191,7 @@ describe Gamifier::Model do
191
191
 
192
192
  it "should return the first entry if a matching entry can be found" do
193
193
  @engine.should_receive(:transmit).with(:get, "models", instance_of(Hash)).
194
- and_return JSON.parse(@raw_payload)
194
+ and_return MultiJson.load(@raw_payload)
195
195
  entry = @collection.find_by_name("karma")
196
196
  entry.should be_a(Gamifier::Model)
197
197
  entry.label.should == "Karma"
@@ -199,7 +199,7 @@ describe Gamifier::Model do
199
199
 
200
200
  it "should return nil if no entry can be found" do
201
201
  @engine.should_receive(:transmit).with(:get, "models", instance_of(Hash)).
202
- and_return JSON.parse('{"data": [], "paging": {}}')
202
+ and_return MultiJson.load('{"data": [], "paging": {}}')
203
203
  entry = @collection.find_by_name("karma")
204
204
  entry.should be_nil
205
205
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamifier
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.1.2
4
+ version: 1.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Cyril Rohr
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-09 00:00:00.000000000 Z
11
+ date: 2013-11-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: faraday
@@ -18,47 +17,41 @@ dependencies:
18
17
  - - ~>
19
18
  - !ruby/object:Gem::Version
20
19
  version: '0.8'
21
- none: false
20
+ type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.8'
27
- none: false
28
- prerelease: false
29
- type: :runtime
30
27
  - !ruby/object:Gem::Dependency
31
- name: json
28
+ name: faraday_middleware
32
29
  requirement: !ruby/object:Gem::Requirement
33
30
  requirements:
34
- - - ! '>='
31
+ - - ~>
35
32
  - !ruby/object:Gem::Version
36
- version: '0'
37
- none: false
33
+ version: '0.8'
34
+ type: :runtime
35
+ prerelease: false
38
36
  version_requirements: !ruby/object:Gem::Requirement
39
37
  requirements:
40
- - - ! '>='
38
+ - - ~>
41
39
  - !ruby/object:Gem::Version
42
- version: '0'
43
- none: false
44
- prerelease: false
45
- type: :runtime
40
+ version: '0.8'
46
41
  - !ruby/object:Gem::Dependency
47
- name: faraday_middleware
42
+ name: multi_json
48
43
  requirement: !ruby/object:Gem::Requirement
49
44
  requirements:
50
- - - ~>
45
+ - - '>='
51
46
  - !ruby/object:Gem::Version
52
- version: '0.8'
53
- none: false
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
54
50
  version_requirements: !ruby/object:Gem::Requirement
55
51
  requirements:
56
- - - ~>
52
+ - - '>='
57
53
  - !ruby/object:Gem::Version
58
- version: '0.8'
59
- none: false
60
- prerelease: false
61
- type: :runtime
54
+ version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,31 +59,27 @@ dependencies:
66
59
  - - ~>
67
60
  - !ruby/object:Gem::Version
68
61
  version: '2'
69
- none: false
62
+ type: :development
63
+ prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
66
  - - ~>
73
67
  - !ruby/object:Gem::Version
74
68
  version: '2'
75
- none: false
76
- prerelease: false
77
- type: :development
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: webmock
80
71
  requirement: !ruby/object:Gem::Requirement
81
72
  requirements:
82
- - - ! '>='
73
+ - - '>='
83
74
  - !ruby/object:Gem::Version
84
75
  version: '0'
85
- none: false
76
+ type: :development
77
+ prerelease: false
86
78
  version_requirements: !ruby/object:Gem::Requirement
87
79
  requirements:
88
- - - ! '>='
80
+ - - '>='
89
81
  - !ruby/object:Gem::Version
90
82
  version: '0'
91
- none: false
92
- prerelease: false
93
- type: :development
94
83
  description: Gem for accessing game engine APIs
95
84
  email:
96
85
  - cyril.rohr@gmail.com
@@ -145,29 +134,29 @@ files:
145
134
  - spec/unit/model_spec.rb
146
135
  - spec/unit/models/activity_definition_spec.rb
147
136
  - spec/unit/models/player_spec.rb
148
- homepage: ''
149
- licenses: []
137
+ homepage: https://github.com/dimelo/gamifier
138
+ licenses:
139
+ - MIT
140
+ metadata: {}
150
141
  post_install_message:
151
142
  rdoc_options: []
152
143
  require_paths:
153
144
  - lib
154
145
  required_ruby_version: !ruby/object:Gem::Requirement
155
146
  requirements:
156
- - - ! '>='
147
+ - - '>='
157
148
  - !ruby/object:Gem::Version
158
149
  version: '0'
159
- none: false
160
150
  required_rubygems_version: !ruby/object:Gem::Requirement
161
151
  requirements:
162
- - - ! '>='
152
+ - - '>='
163
153
  - !ruby/object:Gem::Version
164
154
  version: '0'
165
- none: false
166
155
  requirements: []
167
156
  rubyforge_project:
168
- rubygems_version: 1.8.25
157
+ rubygems_version: 2.1.11
169
158
  signing_key:
170
- specification_version: 3
159
+ specification_version: 4
171
160
  summary: Currently supports Badgeville Core API
172
161
  test_files:
173
162
  - spec/integration/collection_integration_spec.rb