rack-in-app-purchase 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
@@ -1,32 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-in-app-purchase (0.0.2)
4
+ rack-in-app-purchase (0.1.0)
5
5
  rack (~> 1.4)
6
6
  sequel (~> 3.37)
7
7
  sinatra (~> 1.3)
8
8
  venice
9
9
 
10
10
  GEM
11
- remote: http://rubygems.org/
11
+ remote: https://rubygems.org/
12
12
  specs:
13
13
  commander (4.1.3)
14
14
  highline (~> 1.6.11)
15
15
  excon (0.17.0)
16
- highline (1.6.15)
16
+ highline (1.6.16)
17
17
  json (1.7.7)
18
18
  rack (1.5.2)
19
- rack-protection (1.4.0)
19
+ rack-protection (1.5.0)
20
20
  rack
21
21
  rake (0.9.6)
22
22
  rspec (0.6.4)
23
23
  sequel (3.45.0)
24
- sinatra (1.3.5)
25
- rack (~> 1.4)
26
- rack-protection (~> 1.3)
27
- tilt (~> 1.3, >= 1.3.3)
24
+ sinatra (1.4.1)
25
+ rack (~> 1.5, >= 1.5.2)
26
+ rack-protection (~> 1.4)
27
+ tilt (~> 1.3, >= 1.3.4)
28
28
  terminal-table (1.4.5)
29
- tilt (1.3.4)
29
+ tilt (1.3.6)
30
30
  venice (0.0.1)
31
31
  commander (~> 4.1.2)
32
32
  excon (~> 0.17.0)
@@ -38,5 +38,5 @@ PLATFORMS
38
38
 
39
39
  DEPENDENCIES
40
40
  rack-in-app-purchase!
41
- rake (~> 0.9.2)
42
- rspec (~> 0.6.1)
41
+ rake (~> 0.9)
42
+ rspec (~> 0.6)
@@ -11,7 +11,7 @@ require 'venice'
11
11
 
12
12
  module Rack
13
13
  class InAppPurchase < Sinatra::Base
14
- VERSION = '0.0.2'
14
+ VERSION = '0.1.0'
15
15
 
16
16
  use Rack::PostBodyContentTypeParser
17
17
  helpers Sinatra::Param
@@ -23,6 +23,13 @@ module Rack
23
23
 
24
24
  disable :raise_errors, :show_exceptions
25
25
 
26
+ configure do
27
+ if ENV['DATABASE_URL']
28
+ DB = Sequel.connect(ENV['DATABASE_URL'])
29
+ Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), "in-app-purchase/migrations"), table: 'in_app_purchase_schema_info')
30
+ end
31
+ end
32
+
26
33
  before do
27
34
  content_type :json
28
35
  end
@@ -0,0 +1,27 @@
1
+ Sequel.migration do
2
+ up do
3
+ add_column :in_app_purchase_products, :tsv, 'TSVector'
4
+ add_index :in_app_purchase_products, :tsv, type: "GIN"
5
+ create_trigger :in_app_purchase_products, :tsv, :tsvector_update_trigger,
6
+ args: [:tsv, :'pg_catalog.english', :product_identifier, :type, :title, :description],
7
+ events: [:insert, :update],
8
+ each_row: true
9
+
10
+ add_column :in_app_purchase_receipts, :tsv, 'TSVector'
11
+ add_index :in_app_purchase_receipts, :tsv, type: "GIN"
12
+ create_trigger :in_app_purchase_receipts, :tsv, :tsvector_update_trigger,
13
+ args: [:tsv, :'pg_catalog.english', :product_id, :transaction_id, :app_item_id],
14
+ events: [:insert, :update],
15
+ each_row: true
16
+ end
17
+
18
+ down do
19
+ drop_column :in_app_purchase_products, :tsv
20
+ drop_index :in_app_purchase_products, :tsv
21
+ drop_trigger :in_app_purchase_products, :tsv
22
+
23
+ drop_column :in_app_purchase_receipts, :tsv
24
+ drop_index :in_app_purchase_receipts, :tsv
25
+ drop_trigger :in_app_purchase_receipts, :tsv
26
+ end
27
+ end
@@ -1,12 +1,5 @@
1
1
  module Rack
2
- class InAppPurchase
3
- if ENV['DATABASE_URL']
4
- DB = Sequel.connect(ENV['DATABASE_URL'])
5
- Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), "../migrations"), table: 'in_app_purchase_schema_info')
6
- end
7
-
8
- Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), "../migrations"))
9
-
2
+ class InAppPurchase
10
3
  class Receipt < Sequel::Model
11
4
  plugin :json_serializer, naked: true, except: :id
12
5
  plugin :validation_helpers
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
  s.summary = "Rack::InAppPurchase"
13
13
  s.description = "Rack middleware for in-app purchase receipt verification and product listing."
14
14
 
15
- s.add_development_dependency "rspec", "~> 0.6.1"
16
- s.add_development_dependency "rake", "~> 0.9.2"
15
+ s.add_development_dependency "rspec", "~> 0.6"
16
+ s.add_development_dependency "rake", "~> 0.9"
17
17
 
18
18
  s.add_dependency "rack", "~> 1.4"
19
19
  s.add_dependency "sinatra", "~> 1.3"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-in-app-purchase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,33 +9,33 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-08 00:00:00.000000000 Z
12
+ date: 2013-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70304734208600 !ruby/object:Gem::Requirement
16
+ requirement: &70189053995620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.6.1
21
+ version: '0.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70304734208600
24
+ version_requirements: *70189053995620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70304734208100 !ruby/object:Gem::Requirement
27
+ requirement: &70189053994980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 0.9.2
32
+ version: '0.9'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70304734208100
35
+ version_requirements: *70189053994980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack
38
- requirement: &70304734207640 !ruby/object:Gem::Requirement
38
+ requirement: &70189053994480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70304734207640
46
+ version_requirements: *70189053994480
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sinatra
49
- requirement: &70304734207160 !ruby/object:Gem::Requirement
49
+ requirement: &70189053993720 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '1.3'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70304734207160
57
+ version_requirements: *70189053993720
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: sequel
60
- requirement: &70304734206680 !ruby/object:Gem::Requirement
60
+ requirement: &70189053993000 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '3.37'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70304734206680
68
+ version_requirements: *70189053993000
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: venice
71
- requirement: &70304734206260 !ruby/object:Gem::Requirement
71
+ requirement: &70189053992440 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70304734206260
79
+ version_requirements: *70189053992440
80
80
  description: Rack middleware for in-app purchase receipt verification and product
81
81
  listing.
82
82
  email: m@mattt.me
@@ -87,6 +87,7 @@ files:
87
87
  - ./Gemfile
88
88
  - ./Gemfile.lock
89
89
  - ./lib/rack/in-app-purchase/migrations/001_base_schema.rb
90
+ - ./lib/rack/in-app-purchase/migrations/002_add_full_text_search.rb
90
91
  - ./lib/rack/in-app-purchase/models/product.rb
91
92
  - ./lib/rack/in-app-purchase/models/receipt.rb
92
93
  - ./lib/rack/in-app-purchase.rb
@@ -109,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
110
  version: '0'
110
111
  segments:
111
112
  - 0
112
- hash: 1782813247397323068
113
+ hash: -3839802527710962917
113
114
  required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  none: false
115
116
  requirements:
@@ -118,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
119
  version: '0'
119
120
  segments:
120
121
  - 0
121
- hash: 1782813247397323068
122
+ hash: -3839802527710962917
122
123
  requirements: []
123
124
  rubyforge_project:
124
125
  rubygems_version: 1.8.15