imobile 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.0.9. Added support for device attributes stored in Tempfile instances.
2
+
1
3
  v0.0.8. Added flushing to daemon-optimized push notification API.
2
4
 
3
5
  v0.0.7. New API for push notifications, better suited for daemons.
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{imobile}
5
- s.version = "0.0.8"
5
+ s.version = "0.0.9"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
9
- s.date = %q{2009-07-29}
9
+ s.date = %q{2009-08-09}
10
10
  s.description = %q{Library for servers backing iPhone applications.}
11
11
  s.email = %q{victor@zergling.net}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "lib/imobile/crypto_app_fprint.rb", "lib/imobile/push_notification.rb", "lib/imobile/validate_receipt.rb", "lib/imobile.rb", "LICENSE", "README.textile"]
@@ -61,7 +61,8 @@ module CryptoSupportAppFprint
61
61
  def self.device_fprint_data(device_attributes)
62
62
  attrs = device_fprint_attributes
63
63
  keys = device_attributes.keys.select { |k| attrs.include? k.to_s }
64
- 'D|' + keys.sort.map { |k| device_attributes[k] }.join('|')
64
+ 'D|' + keys.sort.map { |k| device_attributes[k] }.
65
+ map { |v| v.respond_to?(:read) ? v.read : v }.join('|')
65
66
  end
66
67
 
67
68
  # The device attributes included in the finger-printing operation.
@@ -29,6 +29,22 @@ class CryptoAppFprintTest < Test::Unit::TestCase
29
29
  assert_equal '3231b35f8466d60a6ae00122d2530e65', fprint
30
30
  end
31
31
 
32
+ class MockTempfile
33
+ def initialize(string)
34
+ @string = string
35
+ end
36
+ def read
37
+ @string
38
+ end
39
+ end
40
+
41
+ def test_device_fprint_from_tempfile
42
+ attrs = {}
43
+ @device_attrs.each { |k, v| attrs[k] = MockTempfile.new v }
44
+ fprint = Imobile::CryptoSupportAppFprint.hex_device_fprint @device_attrs
45
+ assert_equal '3231b35f8466d60a6ae00122d2530e65', fprint
46
+ end
47
+
32
48
  def test_crypto_app_fprint
33
49
  mock_binary_path = '/binary/path'
34
50
  flexmock(File).should_receive(:read).with(mock_binary_path).
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-29 00:00:00 -04:00
12
+ date: 2009-08-09 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency