rack-newsstand 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6593b8cd8b161d5fb3d31a895e8064de2fab51b2
4
- data.tar.gz: d3db244673a496ca0a39a38331ecabaf9a3a5f5e
3
+ metadata.gz: b367c856f078fcdbb962dd55e89f06dfacfd255f
4
+ data.tar.gz: 46e4bb39d7c25a55a6c717b63d33f9523441b4e2
5
5
  SHA512:
6
- metadata.gz: 2e92b50f238e90aaabbacbaceafc2da5f3d608345fba365ebb186ebad2322796057188fb77b00d97f8128740058d455a07bb09339c8f256b87f9a6da451f9c37
7
- data.tar.gz: 60209b4a09d4b6a37fdcc2aa907401890a6e44e3ae2cce94edc45f3426552ddf4bef6b15415372b466a507e9f6c4f2980d5cd77ce1efc71019937467230f5612
6
+ metadata.gz: f4d30b225c4a9115c292395c3ea4fe3d598f862cfa33936943b72c5e9c18c5d60565ffc389518cc4c17ef553bbb2c7ee7beec70f27e5dbd1c9aa60f386077019
7
+ data.tar.gz: 753ac1d1f37effa07d2af6589abddac05581f3edc3db9b4b1bf9afcceebe53d354f8b49d901a178ec28b3deb5cc2cd3d2fb18a3e26de8f4e2a62413d8410694d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-newsstand (0.0.3)
4
+ rack-newsstand (0.1.0)
5
5
  builder (>= 3.0)
6
6
  plist (~> 3.1)
7
7
  rack (~> 1.4)
@@ -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
@@ -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
@@ -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.3"
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.3
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-03 00:00:00.000000000 Z
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