rack-newsstand 0.0.3 → 0.1.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rack/newsstand/migrations/002_add_full_text_search.rb +16 -0
- data/lib/rack/newsstand.rb +3 -5
- data/rack-newsstand-0.0.3.gem +0 -0
- data/rack-newsstand.gemspec +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b367c856f078fcdbb962dd55e89f06dfacfd255f
|
4
|
+
data.tar.gz: 46e4bb39d7c25a55a6c717b63d33f9523441b4e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4d30b225c4a9115c292395c3ea4fe3d598f862cfa33936943b72c5e9c18c5d60565ffc389518cc4c17ef553bbb2c7ee7beec70f27e5dbd1c9aa60f386077019
|
7
|
+
data.tar.gz: 753ac1d1f37effa07d2af6589abddac05581f3edc3db9b4b1bf9afcceebe53d354f8b49d901a178ec28b3deb5cc2cd3d2fb18a3e26de8f4e2a62413d8410694d
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
up do
|
3
|
+
add_column :newsstand_issues, :tsv, 'TSVector'
|
4
|
+
add_index :newsstand_issues, :tsv, type: "GIN"
|
5
|
+
create_trigger :newsstand_issues, :tsv, :tsvector_update_trigger,
|
6
|
+
args: [:tsv, :'pg_catalog.english', :title, :summary],
|
7
|
+
events: [:insert, :update],
|
8
|
+
each_row: true
|
9
|
+
end
|
10
|
+
|
11
|
+
down do
|
12
|
+
drop_column :newsstand_issues, :tsv
|
13
|
+
drop_index :newsstand_issues, :tsv
|
14
|
+
drop_trigger :newsstand_issues, :tsv
|
15
|
+
end
|
16
|
+
end
|
data/lib/rack/newsstand.rb
CHANGED
@@ -20,8 +20,8 @@ module Rack
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
get '/issues' do
|
24
|
-
@issues = Issue.order(:published_at).all
|
23
|
+
get '/issues/?' do
|
24
|
+
@issues = Issue.where("published_at <= :now AND (expires_at > :now OR expires_at IS NULL)", now: Time.now).order(:published_at).all
|
25
25
|
|
26
26
|
request.accept.each do |type|
|
27
27
|
case type.to_s
|
@@ -39,12 +39,10 @@ module Rack
|
|
39
39
|
halt 406
|
40
40
|
end
|
41
41
|
|
42
|
-
get '/issues/:name' do
|
42
|
+
get '/issues/:name/?' do
|
43
43
|
pass unless request.accept? 'application/x-plist'
|
44
44
|
content_type 'application/x-plist'
|
45
45
|
|
46
|
-
param :name, String, empty: false
|
47
|
-
|
48
46
|
Issue.find(name: params[:name]).to_plist
|
49
47
|
end
|
50
48
|
|
Binary file
|
data/rack-newsstand.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.authors = ["Mattt Thompson"]
|
8
8
|
s.email = "m@mattt.me"
|
9
9
|
s.homepage = "http://mattt.me"
|
10
|
-
s.version = "0.0
|
10
|
+
s.version = "0.1.0"
|
11
11
|
s.platform = Gem::Platform::RUBY
|
12
12
|
s.summary = "Rack::Newsstand"
|
13
13
|
s.description = "Automatically generate webservice endpoints for Newsstand"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-newsstand
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattt Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -117,11 +117,13 @@ files:
|
|
117
117
|
- ./Gemfile
|
118
118
|
- ./Gemfile.lock
|
119
119
|
- ./lib/rack/newsstand/migrations/001_base_schema.rb
|
120
|
+
- ./lib/rack/newsstand/migrations/002_add_full_text_search.rb
|
120
121
|
- ./lib/rack/newsstand/models/issue.rb
|
121
122
|
- ./lib/rack/newsstand.rb
|
122
123
|
- ./LICENSE
|
123
124
|
- ./rack-newsstand-0.0.1.gem
|
124
125
|
- ./rack-newsstand-0.0.2.gem
|
126
|
+
- ./rack-newsstand-0.0.3.gem
|
125
127
|
- ./rack-newsstand.gemspec
|
126
128
|
- ./Rakefile
|
127
129
|
- ./README.md
|