oja 0.2.0 → 0.2.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6e5667eb8cbf4769057696f18aaacdb9061525e6
4
+ data.tar.gz: 64f97c7997fd060dffdd9025a40708fdf84625b2
5
+ SHA512:
6
+ metadata.gz: 9d8d72bbce281d9217581d5ad2e0ddac08918745c8f49346763f75d4108a8c48040196004c66afea8f7d97d268d6b06f1cde0c502bf1f9743bf996a1701ba45f
7
+ data.tar.gz: d0b77f94dda4ca72e249276ce3c43a0294965340bba0aa728219dbc031cec0677fd7533509a76cd5b5ac0a22ea22c583dadc4cab44a7208a1d58dd9671e57805
data/README.md CHANGED
@@ -18,4 +18,8 @@ iOS and Mac application receive Receipts when handling purchases from the App St
18
18
  # The receipt probably expired
19
19
  else
20
20
  raise RuntimeError, response.humanized_status
21
- end
21
+ end
22
+
23
+ ## Oja?
24
+
25
+ Ja.
@@ -0,0 +1,4 @@
1
+ module Oja
2
+ class JSONReceipt < Receipt
3
+ end
4
+ end
@@ -2,7 +2,7 @@ require 'base64'
2
2
 
3
3
  module Oja
4
4
  class Receipt
5
- attr_accessor :filename, :password
5
+ attr_accessor :filename, :password, :format
6
6
  attr_writer :data
7
7
 
8
8
  def initialize(attributes)
@@ -32,11 +32,20 @@ module Oja
32
32
  end
33
33
 
34
34
  def attributes
35
- attributes = { 'receipt-data' => receipt_data }
35
+ if json?
36
+ attributes = JSON.parse(data)
37
+ else
38
+ attributes = { 'receipt-data' => receipt_data }
39
+ end
40
+
36
41
  attributes['password'] = password if password
37
42
  attributes
38
43
  end
39
44
 
45
+ def json?
46
+ format == :json
47
+ end
48
+
40
49
  def to_json
41
50
  JSON.dump(attributes)
42
51
  end
metadata CHANGED
@@ -1,74 +1,70 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oja
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Manfred Stienstra
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-10-16 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: nap
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
- description: ! ' Oja is a Ruby client for verification of Apple Store Receipts.
31
-
32
- '
27
+ description: |2
28
+ Oja is a Ruby client for verification of Apple Store Receipts.
33
29
  email: manfred@fngtps.com
34
30
  executables: []
35
31
  extensions: []
36
32
  extra_rdoc_files:
37
33
  - LICENSE
38
34
  files:
35
+ - LICENSE
36
+ - README.md
37
+ - lib/oja.rb
39
38
  - lib/oja/cli.rb
39
+ - lib/oja/json_receipt.rb
40
40
  - lib/oja/mock.rb
41
41
  - lib/oja/option_parser.rb
42
42
  - lib/oja/receipt.rb
43
43
  - lib/oja/request.rb
44
44
  - lib/oja/response.rb
45
- - lib/oja.rb
46
- - LICENSE
47
- - README.md
48
45
  homepage:
49
46
  licenses: []
47
+ metadata: {}
50
48
  post_install_message:
51
49
  rdoc_options:
52
- - --charset=utf-8
50
+ - "--charset=utf-8"
53
51
  require_paths:
54
52
  - lib
55
53
  required_ruby_version: !ruby/object:Gem::Requirement
56
- none: false
57
54
  requirements:
58
- - - ! '>='
55
+ - - ">="
59
56
  - !ruby/object:Gem::Version
60
57
  version: '0'
61
58
  required_rubygems_version: !ruby/object:Gem::Requirement
62
- none: false
63
59
  requirements:
64
- - - ! '>='
60
+ - - ">="
65
61
  - !ruby/object:Gem::Version
66
62
  version: '0'
67
63
  requirements: []
68
64
  rubyforge_project:
69
- rubygems_version: 1.8.23
65
+ rubygems_version: 2.4.5.1
70
66
  signing_key:
71
- specification_version: 3
67
+ specification_version: 4
72
68
  summary: iOS and Mac application receive Receipts when handling purchases from the
73
69
  App Store. Before authorizing access to in-app content, these applications need
74
70
  to verify the receipt with Apple. Oja helps you check the Receipt's status.