rack-passbook 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f7535da0ed761a8727633eba10eb11a5c9f9cbec
4
+ data.tar.gz: 76a31a02edc13f7d6a34911973b1b88c449d0e45
5
+ SHA512:
6
+ metadata.gz: bb1c8abdfc1d4af2d649051804feff13eb9e7fe6efa43774ad43639f94bcbe7ce9074abec10034fb4afc9eb86e2163a01a3896f5d7140fbfaaf460060515b482
7
+ data.tar.gz: c500d648dbff85e0e4d1576840c1e7c64e84dbf463f1fdeef0cf01aec158e7910bc7fce2eb3043052129e4e55e5a4719a7481337453464fdae92e65de74a5b1d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-passbook (0.1.1)
4
+ rack-passbook (0.2.0)
5
5
  rack (~> 1.4)
6
6
  sequel (~> 3.37)
7
7
  sinatra (~> 1.3)
@@ -10,16 +10,16 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  rack (1.5.2)
13
- rack-protection (1.5.0)
13
+ rack-protection (1.5.2)
14
14
  rack
15
15
  rake (0.9.6)
16
16
  rspec (0.6.4)
17
- sequel (3.45.0)
18
- sinatra (1.4.1)
19
- rack (~> 1.5, >= 1.5.2)
17
+ sequel (3.48.0)
18
+ sinatra (1.4.4)
19
+ rack (~> 1.4)
20
20
  rack-protection (~> 1.4)
21
21
  tilt (~> 1.3, >= 1.3.4)
22
- tilt (1.3.6)
22
+ tilt (1.4.1)
23
23
 
24
24
  PLATFORMS
25
25
  ruby
data/README.md CHANGED
@@ -2,13 +2,11 @@
2
2
 
3
3
  # Rack::Passbook
4
4
 
5
- > This is still in early stages of development, so proceed with caution when using this in a production application. Any bug reports, feature requests, or general feedback at this point would be greatly appreciated.
6
-
7
5
  [Passbook](http://www.apple.com/ios/whats-new/#passbook) is an iOS 6 feature that manages boarding passes, movie tickets, retail coupons, & loyalty cards. Using the [PassKit API](https://developer.apple.com/library/prerelease/ios/#documentation/UserExperience/Reference/PassKit_Framework/_index.html), developers can register web services to automatically update content on the pass, such as gate changes on a boarding pass, or adding credit to a loyalty card.
8
6
 
9
7
  Apple [provides a specification](https://developer.apple.com/library/prerelease/ios/#documentation/PassKit/Reference/PassKit_WebService/WebService.html) for a REST-style web service protocol to communicate with Passbook, with endpoints to get the latest version of a pass, register / unregister devices to receive push notifications for a pass, and query for passes registered for a device.
10
8
 
11
- This project is an example implementation of this web service specification in Rails, and will serve the basis for a more comprehensive Rails generator in the near future.
9
+ Rack::Passbook provides those specified endpoints.
12
10
 
13
11
  > If you're just starting out Passbook development, you should definitely check out [this great two-part tutorial](http://www.raywenderlich.com/20734/beginning-passbook-part-1) by [Marin Todorov](http://www.raywenderlich.com/about#marintodorov) ([Part 1](http://www.raywenderlich.com/20734/beginning-passbook-part-1) [Part 2](http://www.raywenderlich.com/20785/beginning-passbook-in-ios-6-part-22)).
14
12
 
@@ -68,7 +66,7 @@ GET http://example.com/v1/devices/:deviceLibraryIdentifier/registrations/:passTy
68
66
  - **deviceLibraryIdentifier** A unique identifier that is used to identify and authenticate the device.
69
67
  - **passTypeIdentifier** The pass’s type, as specified in the pass.
70
68
  - **serialNumber** The unique pass identifier, as specified in the pass.
71
- - **passesUpdatedSince** _Optional_ A tag from a previous request.
69
+ - **passesUpdatedSince** _Optional_ A tag from a previous request.
72
70
 
73
71
  **Response**
74
72
 
@@ -9,19 +9,18 @@ require 'sequel'
9
9
 
10
10
  module Rack
11
11
  class Passbook < Sinatra::Base
12
- VERSION = '0.1.1'
13
12
 
14
13
  use Rack::PostBodyContentTypeParser
15
14
  helpers Sinatra::Param
16
15
 
17
- Sequel.extension :core_extensions, :migration, :pg_hstore, :pg_hstore_ops
18
-
19
- autoload :Pass, ::File.join(::File.dirname(__FILE__), 'passbook/models/pass')
20
- autoload :Registration, ::File.join(::File.dirname(__FILE__), 'passbook/models/registration')
16
+ autoload :Pass, 'rack/passbook/models/pass'
17
+ autoload :Registration, 'rack/passbook/models/registration'
21
18
 
22
19
  disable :raise_errors, :show_exceptions
23
20
 
24
21
  configure do
22
+ Sequel.extension :core_extensions, :migration, :pg_hstore, :pg_hstore_ops
23
+
25
24
  if ENV['DATABASE_URL']
26
25
  DB = Sequel.connect(ENV['DATABASE_URL'])
27
26
  Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), "passbook/migrations"), table: 'passbook_schema_info')
@@ -53,7 +52,7 @@ module Rack
53
52
  @passes = Pass.filter(pass_type_identifier: params[:pass_type_identifier]).join(Registration.dataset, device_library_identifier: params[:device_library_identifier])
54
53
  halt 404 if @passes.empty?
55
54
 
56
- @passes = @passes.filter('passes.updated_at > ?', params[:passesUpdatedSince]) if params[:passesUpdatedSince]
55
+ @passes = @passes.filter("#{Pass.table_name}.updated_at > ?", Time.parse(params[:passesUpdatedSince])) if params[:passesUpdatedSince]
57
56
 
58
57
  if @passes.any?
59
58
  {
@@ -10,7 +10,7 @@ Sequel.migration do
10
10
 
11
11
  down do
12
12
  drop_column :passbook_passes, :tsv
13
- drop_index :passbook_passes, :tsv_GIN
14
- drop_trigger :passbook_passes, :TS_tsv
13
+ drop_index :passbook_passes, :tsv
14
+ drop_trigger :passbook_passes, :tsv
15
15
  end
16
16
  end
@@ -20,7 +20,7 @@ module Rack
20
20
  validates_presence :device_library_identifier
21
21
  validates_unique [:device_library_identifier, :pass_id]
22
22
  validates_format /[[:xdigit:]]+/, :push_token
23
- validates_exact_length 40, :push_token
23
+ validates_exact_length 64, :push_token
24
24
  end
25
25
 
26
26
  private
@@ -1,13 +1,12 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "rack/passbook"
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
  s.name = "rack-passbook"
7
6
  s.authors = ["Mattt Thompson"]
8
7
  s.email = "m@mattt.me"
9
8
  s.homepage = "http://mattt.me"
10
- s.version = Rack::Passbook::VERSION
9
+ s.version = '0.2.0'
11
10
  s.platform = Gem::Platform::RUBY
12
11
  s.summary = "Rack::Passbook"
13
12
  s.description = "Automatically generate REST APIs for Passbook registration."
metadata CHANGED
@@ -1,71 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-passbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mattt Thompson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-20 00:00:00.000000000 Z
11
+ date: 2014-03-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
- requirement: &70297457981760 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0.6'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *70297457981760
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.6'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rake
27
- requirement: &70297457981220 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ~>
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0.9'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *70297457981220
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '0.9'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rack
38
- requirement: &70297457980700 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
45
  - - ~>
42
46
  - !ruby/object:Gem::Version
43
47
  version: '1.4'
44
48
  type: :runtime
45
49
  prerelease: false
46
- version_requirements: *70297457980700
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.4'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: sinatra
49
- requirement: &70297457980240 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
54
61
  version: '1.3'
55
62
  type: :runtime
56
63
  prerelease: false
57
- version_requirements: *70297457980240
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: sequel
60
- requirement: &70297457979740 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
73
  - - ~>
64
74
  - !ruby/object:Gem::Version
65
75
  version: '3.37'
66
76
  type: :runtime
67
77
  prerelease: false
68
- version_requirements: *70297457979740
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '3.37'
69
83
  description: Automatically generate REST APIs for Passbook registration.
70
84
  email: m@mattt.me
71
85
  executables: []
@@ -80,40 +94,30 @@ files:
80
94
  - ./lib/rack/passbook/models/registration.rb
81
95
  - ./lib/rack/passbook.rb
82
96
  - ./LICENSE
83
- - ./rack-passbook-0.0.1.gem
84
- - ./rack-passbook-0.0.2.gem
85
- - ./rack-passbook-0.1.0.gem
86
97
  - ./rack-passbook.gemspec
87
98
  - ./Rakefile
88
99
  - ./README.md
89
100
  homepage: http://mattt.me
90
101
  licenses: []
102
+ metadata: {}
91
103
  post_install_message:
92
104
  rdoc_options: []
93
105
  require_paths:
94
106
  - lib
95
107
  required_ruby_version: !ruby/object:Gem::Requirement
96
- none: false
97
108
  requirements:
98
- - - ! '>='
109
+ - - '>='
99
110
  - !ruby/object:Gem::Version
100
111
  version: '0'
101
- segments:
102
- - 0
103
- hash: -3468656602360383615
104
112
  required_rubygems_version: !ruby/object:Gem::Requirement
105
- none: false
106
113
  requirements:
107
- - - ! '>='
114
+ - - '>='
108
115
  - !ruby/object:Gem::Version
109
116
  version: '0'
110
- segments:
111
- - 0
112
- hash: -3468656602360383615
113
117
  requirements: []
114
118
  rubyforge_project:
115
- rubygems_version: 1.8.15
119
+ rubygems_version: 2.1.11
116
120
  signing_key:
117
- specification_version: 3
121
+ specification_version: 4
118
122
  summary: Rack::Passbook
119
123
  test_files: []
Binary file
Binary file
Binary file