barcodeservice 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source :rubygems
2
+
3
+ gem 'gbarcode', '0.98.16'
4
+ gem 'sinatra'
5
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.3.0
@@ -5,18 +5,18 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{barcodeservice}
8
- s.version = "1.2.1"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Danger Canty"]
12
- s.date = %q{2010-10-02}
12
+ s.date = %q{2011-02-07}
13
13
  s.description = %q{Run your own barcode image generator for free on Heroku.com}
14
14
  s.email = %q{gitcommit@6brand.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README.markdown"
17
17
  ]
18
18
  s.files = [
19
- ".gems",
19
+ "Gemfile",
20
20
  "README.markdown",
21
21
  "Rakefile",
22
22
  "VERSION",
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  "config.ru",
25
25
  "lib/barcode_service.rb",
26
26
  "lib/barcodeservice.rb",
27
+ "pkg/barcodeservice-1.2.1.gem",
27
28
  "test.rb"
28
29
  ]
29
30
  s.homepage = %q{http://github.com/JackDanger/barcodeservice}
@@ -11,17 +11,18 @@ require 'gbarcode'
11
11
 
12
12
 
13
13
  get '/:code.:extension' do
14
- # begin
14
+ begin
15
15
  options = request.env['rack.request.query_hash']
16
16
  options = default_options.merge(options)
17
17
 
18
18
  content_type "image/#{params[:extension]}"
19
+ headers['Cache-Control'] = "public, max-age=#{3600*24*365}"
19
20
 
20
21
  Converter.encode params[:code], params[:extension], options
21
- # rescue => error
22
- # puts error.inspect
23
- # status 400
24
- # end
22
+ rescue => error
23
+ puts error.inspect
24
+ status 400
25
+ end
25
26
  end
26
27
 
27
28
  get '/' do
Binary file
data/test.rb CHANGED
@@ -37,6 +37,10 @@ class BarcodeServiceTest < Test::Unit::TestCase
37
37
  should "return ok" do
38
38
  assert last_response.ok?
39
39
  end
40
+ should "cache for a year" do
41
+ assert_equal 'public, max-age=31536000',
42
+ last_response.headers['Cache-Control']
43
+ end
40
44
  should "return #{format} content-type" do
41
45
  assert_equal "image/#{format}", last_response.headers['Content-Type']
42
46
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barcodeservice
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 2
9
- - 1
10
- version: 1.2.1
8
+ - 3
9
+ - 0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jack Danger Canty
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-02 00:00:00 -07:00
18
+ date: 2011-02-07 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -69,7 +69,7 @@ extensions: []
69
69
  extra_rdoc_files:
70
70
  - README.markdown
71
71
  files:
72
- - .gems
72
+ - Gemfile
73
73
  - README.markdown
74
74
  - Rakefile
75
75
  - VERSION
@@ -77,6 +77,7 @@ files:
77
77
  - config.ru
78
78
  - lib/barcode_service.rb
79
79
  - lib/barcodeservice.rb
80
+ - pkg/barcodeservice-1.2.1.gem
80
81
  - test.rb
81
82
  has_rdoc: true
82
83
  homepage: http://github.com/JackDanger/barcodeservice
data/.gems DELETED
@@ -1,2 +0,0 @@
1
- gbarcode
2
- sinatra