mugshot 0.1.4 → 0.1.5

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/mugshot/application.rb +8 -9
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -1,7 +1,7 @@
1
1
  require 'sinatra/base'
2
2
 
3
3
  class Mugshot::Application < Sinatra::Base
4
-
4
+
5
5
  set :static, true
6
6
  set :public, ::File.expand_path(::File.join(::File.dirname(__FILE__), "public"))
7
7
 
@@ -9,11 +9,15 @@ class Mugshot::Application < Sinatra::Base
9
9
  content_type :jpg
10
10
  end
11
11
 
12
+ get '/?' do
13
+ 'ok'
14
+ end
15
+
12
16
  post '/?' do
13
17
  content_type :html
14
18
  @storage.write(params['file'][:tempfile].read)
15
19
  end
16
-
20
+
17
21
  get '/:size/:id.:ext' do |size, id, ext|
18
22
  image = @storage.read(id)
19
23
 
@@ -23,19 +27,14 @@ class Mugshot::Application < Sinatra::Base
23
27
  image.resize! dimm
24
28
  image.to_blob
25
29
  end
26
-
30
+
27
31
  get '/:id.:ext' do |id, ext|
28
32
  image = @storage.read(id)
29
33
  halt 404 if image.nil?
30
34
  image.to_blob
31
35
  end
32
-
33
- get '/' do
34
- 'ok'
35
- end
36
-
37
- protected
38
36
 
37
+ protected
39
38
  def initialize(storage)
40
39
  @storage = storage
41
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mugshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Cain\xC3\xA3 Nunes"