rack-passbook 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/rack/passbook.rb +8 -1
- data/lib/rack/passbook/migrations/002_add_full_text_search.rb +5 -12
- data/lib/rack/passbook/models/pass.rb +0 -5
- data/rack-passbook-0.1.0.gem +0 -0
- metadata +15 -14
data/Gemfile.lock
CHANGED
data/lib/rack/passbook.rb
CHANGED
@@ -9,7 +9,7 @@ require 'sequel'
|
|
9
9
|
|
10
10
|
module Rack
|
11
11
|
class Passbook < Sinatra::Base
|
12
|
-
VERSION = '0.1.
|
12
|
+
VERSION = '0.1.1'
|
13
13
|
|
14
14
|
use Rack::PostBodyContentTypeParser
|
15
15
|
helpers Sinatra::Param
|
@@ -21,6 +21,13 @@ module Rack
|
|
21
21
|
|
22
22
|
disable :raise_errors, :show_exceptions
|
23
23
|
|
24
|
+
configure do
|
25
|
+
if ENV['DATABASE_URL']
|
26
|
+
DB = Sequel.connect(ENV['DATABASE_URL'])
|
27
|
+
Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), "passbook/migrations"), table: 'passbook_schema_info')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
24
31
|
before do
|
25
32
|
content_type :json
|
26
33
|
end
|
@@ -1,18 +1,11 @@
|
|
1
1
|
Sequel.migration do
|
2
2
|
up do
|
3
3
|
add_column :passbook_passes, :tsv, 'TSVector'
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
run %{
|
11
|
-
CREATE TRIGGER TS_tsv \
|
12
|
-
BEFORE INSERT OR UPDATE ON passbook_passes \
|
13
|
-
FOR EACH ROW EXECUTE PROCEDURE \
|
14
|
-
tsvector_update_trigger(tsv, 'pg_catalog.english', pass_type_identifier, serial_number);
|
15
|
-
}
|
4
|
+
add_index :passbook_passes, :tsv, type: "GIN"
|
5
|
+
create_trigger :passbook_passes, :tsv, :tsvector_update_trigger,
|
6
|
+
args: [:tsv, :'pg_catalog.english', :pass_type_identifier, :serial_number],
|
7
|
+
events: [:insert, :update],
|
8
|
+
each_row: true
|
16
9
|
end
|
17
10
|
|
18
11
|
down do
|
@@ -1,10 +1,5 @@
|
|
1
1
|
module Rack
|
2
2
|
class Passbook
|
3
|
-
if ENV['DATABASE_URL']
|
4
|
-
DB = Sequel.connect(ENV['DATABASE_URL'])
|
5
|
-
Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), "../migrations"), table: 'passbook_schema_info')
|
6
|
-
end
|
7
|
-
|
8
3
|
class Pass < Sequel::Model
|
9
4
|
plugin :json_serializer, naked: true, except: :id
|
10
5
|
plugin :validation_helpers
|
Binary file
|
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.1.
|
4
|
+
version: 0.1.1
|
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-03-
|
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: &
|
16
|
+
requirement: &70297457981760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0.6'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70297457981760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70297457981220 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.9'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70297457981220
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rack
|
38
|
-
requirement: &
|
38
|
+
requirement: &70297457980700 !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: *
|
46
|
+
version_requirements: *70297457980700
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sinatra
|
49
|
-
requirement: &
|
49
|
+
requirement: &70297457980240 !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: *
|
57
|
+
version_requirements: *70297457980240
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: sequel
|
60
|
-
requirement: &
|
60
|
+
requirement: &70297457979740 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '3.37'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70297457979740
|
69
69
|
description: Automatically generate REST APIs for Passbook registration.
|
70
70
|
email: m@mattt.me
|
71
71
|
executables: []
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- ./LICENSE
|
83
83
|
- ./rack-passbook-0.0.1.gem
|
84
84
|
- ./rack-passbook-0.0.2.gem
|
85
|
+
- ./rack-passbook-0.1.0.gem
|
85
86
|
- ./rack-passbook.gemspec
|
86
87
|
- ./Rakefile
|
87
88
|
- ./README.md
|
@@ -99,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
100
|
version: '0'
|
100
101
|
segments:
|
101
102
|
- 0
|
102
|
-
hash:
|
103
|
+
hash: -3468656602360383615
|
103
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
105
|
none: false
|
105
106
|
requirements:
|
@@ -108,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
109
|
version: '0'
|
109
110
|
segments:
|
110
111
|
- 0
|
111
|
-
hash:
|
112
|
+
hash: -3468656602360383615
|
112
113
|
requirements: []
|
113
114
|
rubyforge_project:
|
114
115
|
rubygems_version: 1.8.15
|