imobile 0.0.8 → 0.0.9
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.
- data/CHANGELOG +2 -0
- data/imobile.gemspec +2 -2
- data/lib/imobile/crypto_app_fprint.rb +2 -1
- data/test/crypto_app_fprint_test.rb +16 -0
- metadata +2 -2
data/CHANGELOG
CHANGED
data/imobile.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{imobile}
|
5
|
-
s.version = "0.0.
|
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-
|
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
|
-
|
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.
|
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-
|
12
|
+
date: 2009-08-09 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|