koala 1.4.0 → 1.5.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.
@@ -2,25 +2,25 @@
2
2
  # which is a problem because our mock testing service ultimately matches strings to see if requests are mocked
3
3
  # this fix solves that problem by ensuring all hashes are created with a consistent key order every time
4
4
  module MultiJson
5
- self.engine = :ok_json
5
+ self.use :ok_json
6
6
 
7
7
  class << self
8
- def encode_with_ordering(object)
8
+ def dump_with_ordering(object)
9
9
  # if it's a hash, recreate it with k/v pairs inserted in sorted-by-key order
10
10
  # (for some reason, REE fails if we don't assign the ternary result as a local variable
11
11
  # separately from calling encode_original)
12
- encode_original(sort_object(object))
12
+ dump_original(sort_object(object))
13
13
  end
14
14
 
15
- alias_method :encode_original, :encode
16
- alias_method :encode, :encode_with_ordering
15
+ alias_method :dump_original, :dump
16
+ alias_method :dump, :dump_with_ordering
17
17
 
18
- def decode_with_ordering(string)
19
- sort_object(decode_original(string))
18
+ def load_with_ordering(string)
19
+ sort_object(load_original(string))
20
20
  end
21
21
 
22
- alias_method :decode_original, :decode
23
- alias_method :decode, :decode_with_ordering
22
+ alias_method :load_original, :load
23
+ alias_method :load, :load_with_ordering
24
24
 
25
25
  private
26
26
 
@@ -6,7 +6,7 @@ module Koala
6
6
  include Koala::HTTPService
7
7
 
8
8
  # fix our specs to use ok_json, so we always get the same results from to_json
9
- MultiJson.engine = :ok_json
9
+ MultiJson.use :ok_json
10
10
 
11
11
  # Mocks all HTTP requests for with koala_spec_with_mocks.rb
12
12
  # Mocked values to be included in TEST_DATA used in specs
@@ -1,7 +1,7 @@
1
1
  module KoalaTest
2
2
  # directly taken from Rails 3.1's OrderedHash
3
3
  # see https://github.com/rails/rails/blob/master/activesupport/lib/active_support/ordered_hash.rb
4
-
4
+
5
5
  # The order of iteration over hashes in Ruby 1.8 is undefined. For example, you do not know the
6
6
  # order in which +keys+ will return keys, or +each+ yield pairs. <tt>ActiveSupport::OrderedHash</tt>
7
7
  # implements a hash that preserves insertion order, as in Ruby 1.9:
@@ -192,10 +192,6 @@ module KoalaTest
192
192
  OrderedHash[self.to_a.map!{|key_value_pair| key_value_pair.reverse}]
193
193
  end
194
194
 
195
- def inspect
196
- "#<OrderedHash #{super}>"
197
- end
198
-
199
195
  private
200
196
  def sync_keys!
201
197
  @keys.delete_if {|k| !has_key?(k)}
@@ -126,7 +126,7 @@ shared_examples_for "Koala RestAPI with an access token" do
126
126
  describe "#set_app_properties" do
127
127
  it "sends Facebook the properties JSON-encoded as :properties" do
128
128
  props = {:a => 2, :c => [1, 2, "d"]}
129
- @api.should_receive(:rest_call).with(anything, hash_including(:properties => MultiJson.encode(props)), anything, anything)
129
+ @api.should_receive(:rest_call).with(anything, hash_including(:properties => MultiJson.dump(props)), anything, anything)
130
130
  @api.set_app_properties(props)
131
131
  end
132
132
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koala
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,52 +9,72 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-11 00:00:00.000000000Z
12
+ date: 2012-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
16
- requirement: &70104159239520 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '1.0'
21
+ version: '1.3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70104159239520
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.3'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: faraday
27
- requirement: &70104159238080 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
31
36
  - !ruby/object:Gem::Version
32
- version: 0.7.0
37
+ version: '0.7'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70104159238080
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0.7'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rspec
38
- requirement: &70104159236640 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
42
52
  - !ruby/object:Gem::Version
43
- version: 2.8.0rc1
53
+ version: '2.8'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70104159236640
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.8'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rake
49
- requirement: &70104159224060 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
53
68
  - !ruby/object:Gem::Version
54
- version: 0.8.7
69
+ version: '0.8'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70104159224060
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '0.8'
58
78
  description: Koala is a lightweight, flexible Ruby SDK for Facebook. It allows read/write
59
79
  access to the social graph via the Graph and REST APIs, as well as support for realtime
60
80
  updates and OAuth and Facebook Connect authentication. Koala is fully tested and
@@ -143,16 +163,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
163
  version: '0'
144
164
  segments:
145
165
  - 0
146
- hash: 3977306572275608217
166
+ hash: -1225893302672105978
147
167
  required_rubygems_version: !ruby/object:Gem::Requirement
148
168
  none: false
149
169
  requirements:
150
170
  - - ! '>='
151
171
  - !ruby/object:Gem::Version
152
- version: '1.2'
172
+ version: '0'
173
+ segments:
174
+ - 0
175
+ hash: -1225893302672105978
153
176
  requirements: []
154
177
  rubyforge_project:
155
- rubygems_version: 1.8.10
178
+ rubygems_version: 1.8.21
156
179
  signing_key:
157
180
  specification_version: 3
158
181
  summary: A lightweight, flexible library for Facebook with support for the Graph API,