guillotine 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/guillotine.gemspec +1 -1
- data/lib/guillotine.rb +1 -1
- data/lib/guillotine/adapters/riak_adapter.rb +9 -4
- metadata +7 -7
data/guillotine.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'guillotine'
|
16
|
-
s.version = '1.0.
|
16
|
+
s.version = '1.0.8'
|
17
17
|
s.date = '2011-11-11'
|
18
18
|
s.rubyforge_project = 'guillotine'
|
19
19
|
|
data/lib/guillotine.rb
CHANGED
@@ -112,13 +112,18 @@ module Guillotine
|
|
112
112
|
# Fixes a bug in Guillotine 1.0.2 where the content type on url objects
|
113
113
|
# was not being set. The ruby Riak::Client defaults to JSON, so
|
114
114
|
# strings were being saved as "somecode", which is unparseable by JSON.
|
115
|
-
def fix_url_object(obj)
|
116
|
-
if
|
115
|
+
def fix_url_object(obj, data = nil)
|
116
|
+
if data
|
117
117
|
obj.content_type = PLAIN
|
118
|
-
obj.data =
|
118
|
+
obj.data = data
|
119
119
|
obj.store
|
120
|
+
return obj
|
121
|
+
end
|
122
|
+
case obj.content_type
|
123
|
+
when /json/ then fix_url_object(obj, JSON.parse(%({"data":#{obj.raw_data}}))['data'])
|
124
|
+
when PLAIN then obj
|
125
|
+
else fix_url_object(obj, obj.data) # old values had the right data but the content type was application/x-www-form-urlencoded
|
120
126
|
end
|
121
|
-
obj
|
122
127
|
end
|
123
128
|
|
124
129
|
def url_key(url)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guillotine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-11 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
16
|
-
requirement: &
|
16
|
+
requirement: &70215141118220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.2.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70215141118220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: addressable
|
27
|
-
requirement: &
|
27
|
+
requirement: &70215141117700 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.2.6
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70215141117700
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rack-test
|
38
|
-
requirement: &
|
38
|
+
requirement: &70215141117280 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70215141117280
|
47
47
|
description: Adaptable private URL shortener
|
48
48
|
email: technoweenie@gmail.com
|
49
49
|
executables: []
|