rack-passbook 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +10 -10
- data/README.md +6 -0
- data/lib/rack/passbook/migrations/001_base_schema.rb +3 -3
- data/lib/rack/passbook/models/pass.rb +5 -3
- data/lib/rack/passbook.rb +2 -2
- data/rack-passbook-0.0.1.gem +0 -0
- data/rack-passbook.gemspec +2 -2
- metadata +18 -42
data/Gemfile.lock
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-passbook (0.0.
|
4
|
+
rack-passbook (0.0.2)
|
5
5
|
rack (~> 1.4)
|
6
|
-
sequel (~> 3.37
|
7
|
-
sinatra (~> 1.3
|
6
|
+
sequel (~> 3.37)
|
7
|
+
sinatra (~> 1.3)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
rack (1.
|
13
|
-
rack-protection (1.
|
12
|
+
rack (1.5.2)
|
13
|
+
rack-protection (1.4.0)
|
14
14
|
rack
|
15
15
|
rake (0.9.6)
|
16
16
|
rspec (0.6.4)
|
17
|
-
sequel (3.
|
18
|
-
sinatra (1.3.
|
19
|
-
rack (~> 1.
|
20
|
-
rack-protection (~> 1.
|
17
|
+
sequel (3.45.0)
|
18
|
+
sinatra (1.3.5)
|
19
|
+
rack (~> 1.4)
|
20
|
+
rack-protection (~> 1.3)
|
21
21
|
tilt (~> 1.3, >= 1.3.3)
|
22
|
-
tilt (1.3.
|
22
|
+
tilt (1.3.4)
|
23
23
|
|
24
24
|
PLATFORMS
|
25
25
|
ruby
|
data/README.md
CHANGED
@@ -12,6 +12,12 @@ This project is an example implementation of this web service specification in R
|
|
12
12
|
|
13
13
|
> 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
14
|
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
```
|
18
|
+
$ gem install rack-passbook
|
19
|
+
```
|
20
|
+
|
15
21
|
## Requirements
|
16
22
|
|
17
23
|
- Ruby 1.9
|
@@ -2,7 +2,7 @@ Sequel.migration do
|
|
2
2
|
up do
|
3
3
|
run %{CREATE EXTENSION hstore;}
|
4
4
|
|
5
|
-
create_table :
|
5
|
+
create_table :passbook_passes do
|
6
6
|
primary_key :id
|
7
7
|
|
8
8
|
column :pass_type_identifier, :varchar, unique: true, empty: false
|
@@ -30,7 +30,7 @@ Sequel.migration do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
down do
|
33
|
-
drop_table :
|
34
|
-
drop_table :
|
33
|
+
drop_table :passbook_passes
|
34
|
+
drop_table :passbook_registrations
|
35
35
|
end
|
36
36
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
module Rack
|
2
2
|
class Passbook
|
3
|
-
|
4
|
-
|
3
|
+
if ENV['DATABASE_URL']
|
4
|
+
DB = Sequel.connect(ENV['DATABASE_URL'])
|
5
|
+
Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), "../migrations"))
|
6
|
+
end
|
5
7
|
|
6
8
|
class Pass < Sequel::Model
|
7
9
|
plugin :json_serializer, naked: true, except: :id
|
@@ -10,7 +12,7 @@ module Rack
|
|
10
12
|
plugin :schema
|
11
13
|
plugin :typecast_on_load
|
12
14
|
|
13
|
-
self.dataset = :
|
15
|
+
self.dataset = :passbook_passes
|
14
16
|
self.strict_param_setting = false
|
15
17
|
self.raise_on_save_failure = false
|
16
18
|
|
data/lib/rack/passbook.rb
CHANGED
@@ -3,12 +3,13 @@ require 'rack/contrib'
|
|
3
3
|
|
4
4
|
require 'sinatra/base'
|
5
5
|
require 'sinatra/param'
|
6
|
+
require 'rack'
|
6
7
|
|
7
8
|
require 'sequel'
|
8
9
|
|
9
10
|
module Rack
|
10
11
|
class Passbook < Sinatra::Base
|
11
|
-
VERSION = '0.0.
|
12
|
+
VERSION = '0.0.2'
|
12
13
|
|
13
14
|
use Rack::PostBodyContentTypeParser
|
14
15
|
helpers Sinatra::Param
|
@@ -73,7 +74,6 @@ module Rack
|
|
73
74
|
status = @registration.new? ? 201 : 200
|
74
75
|
|
75
76
|
@registration.save
|
76
|
-
p @registration
|
77
77
|
halt 406 unless @registration.valid?
|
78
78
|
|
79
79
|
halt status
|
Binary file
|
data/rack-passbook.gemspec
CHANGED
@@ -16,8 +16,8 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_development_dependency "rake", "~> 0.9.2"
|
17
17
|
|
18
18
|
s.add_dependency "rack", "~> 1.4"
|
19
|
-
s.add_dependency "sinatra", "~> 1.3
|
20
|
-
s.add_dependency "sequel", "~> 3.37
|
19
|
+
s.add_dependency "sinatra", "~> 1.3"
|
20
|
+
s.add_dependency "sequel", "~> 3.37"
|
21
21
|
|
22
22
|
s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|example|log|pkg|script|spec|test|vendor)/ }
|
23
23
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-passbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70266951408840 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.6.1
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.6.1
|
24
|
+
version_requirements: *70266951408840
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: rake
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70266951407240 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ~>
|
@@ -37,15 +32,10 @@ dependencies:
|
|
37
32
|
version: 0.9.2
|
38
33
|
type: :development
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: 0.9.2
|
35
|
+
version_requirements: *70266951407240
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: rack
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &70266951422020 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
41
|
- - ~>
|
@@ -53,44 +43,29 @@ dependencies:
|
|
53
43
|
version: '1.4'
|
54
44
|
type: :runtime
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.4'
|
46
|
+
version_requirements: *70266951422020
|
62
47
|
- !ruby/object:Gem::Dependency
|
63
48
|
name: sinatra
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirement: &70266951420840 !ruby/object:Gem::Requirement
|
65
50
|
none: false
|
66
51
|
requirements:
|
67
52
|
- - ~>
|
68
53
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.3
|
54
|
+
version: '1.3'
|
70
55
|
type: :runtime
|
71
56
|
prerelease: false
|
72
|
-
version_requirements:
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 1.3.2
|
57
|
+
version_requirements: *70266951420840
|
78
58
|
- !ruby/object:Gem::Dependency
|
79
59
|
name: sequel
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirement: &70266951419380 !ruby/object:Gem::Requirement
|
81
61
|
none: false
|
82
62
|
requirements:
|
83
63
|
- - ~>
|
84
64
|
- !ruby/object:Gem::Version
|
85
|
-
version: 3.37
|
65
|
+
version: '3.37'
|
86
66
|
type: :runtime
|
87
67
|
prerelease: false
|
88
|
-
version_requirements:
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 3.37.0
|
68
|
+
version_requirements: *70266951419380
|
94
69
|
description: Automatically generate REST APIs for Passbook registration.
|
95
70
|
email: m@mattt.me
|
96
71
|
executables: []
|
@@ -104,6 +79,7 @@ files:
|
|
104
79
|
- ./lib/rack/passbook/models/registration.rb
|
105
80
|
- ./lib/rack/passbook.rb
|
106
81
|
- ./LICENSE
|
82
|
+
- ./rack-passbook-0.0.1.gem
|
107
83
|
- ./rack-passbook.gemspec
|
108
84
|
- ./Rakefile
|
109
85
|
- ./README.md
|
@@ -121,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
97
|
version: '0'
|
122
98
|
segments:
|
123
99
|
- 0
|
124
|
-
hash:
|
100
|
+
hash: 3671754240132311788
|
125
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
102
|
none: false
|
127
103
|
requirements:
|
@@ -130,10 +106,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
106
|
version: '0'
|
131
107
|
segments:
|
132
108
|
- 0
|
133
|
-
hash:
|
109
|
+
hash: 3671754240132311788
|
134
110
|
requirements: []
|
135
111
|
rubyforge_project:
|
136
|
-
rubygems_version: 1.8.
|
112
|
+
rubygems_version: 1.8.15
|
137
113
|
signing_key:
|
138
114
|
specification_version: 3
|
139
115
|
summary: Rack::Passbook
|