guillotine 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
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 = '0.1.1'
16
+ s.version = '0.1.2'
17
17
  s.date = '2011-08-17'
18
18
  s.rubyforge_project = 'guillotine'
19
19
 
@@ -50,6 +50,8 @@ module Guillotine
50
50
  if obj = @code_bucket.get(code, :r => 1)
51
51
  obj.data
52
52
  end
53
+ rescue Riak::FailedRequest => err
54
+ raise unless err.not_found?
53
55
  end
54
56
  end
55
57
  end
data/lib/guillotine.rb CHANGED
@@ -2,7 +2,7 @@ require 'base64'
2
2
  require 'digest/md5'
3
3
 
4
4
  module Guillotine
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
 
7
7
  dir = File.expand_path '../guillotine', __FILE__
8
8
  autoload :App, "#{dir}/app"
@@ -31,6 +31,10 @@ begin
31
31
  code = @db.add '456', code
32
32
  end
33
33
  end
34
+
35
+ def test_missing_code
36
+ assert_nil @db.find('missing')
37
+ end
34
38
  end
35
39
  rescue LoadError
36
40
  puts "skipping ActiveRecord tests: #{$!}"
@@ -26,4 +26,8 @@ class MemoryAdapterTest < Guillotine::TestCase
26
26
  @db.add 'def', code
27
27
  end
28
28
  end
29
+
30
+ def test_missing_code
31
+ assert_nil @db.find('missing')
32
+ end
29
33
  end
@@ -54,6 +54,10 @@ begin
54
54
  URL_BUCKET.delete Digest::SHA1.hexdigest('def')
55
55
  CODE_BUCKET.delete code
56
56
  end
57
+
58
+ def test_missing_code
59
+ assert_nil @db.find('missing')
60
+ end
57
61
  end
58
62
  rescue LoadError
59
63
  puts "Skipping Riak tests: #{$!}"
@@ -31,6 +31,10 @@ begin
31
31
  code = @db.add '456', code
32
32
  end
33
33
  end
34
+
35
+ def test_missing_code
36
+ assert_nil @db.find('missing')
37
+ end
34
38
  end
35
39
  rescue LoadError
36
40
  puts "Skipping sequel tests"
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: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-08-17 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70307039101360 !ruby/object:Gem::Requirement
16
+ requirement: &70121188810040 !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: *70307039101360
24
+ version_requirements: *70121188810040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: addressable
27
- requirement: &70307039100900 !ruby/object:Gem::Requirement
27
+ requirement: &70121188809580 !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: *70307039100900
35
+ version_requirements: *70121188809580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack-test
38
- requirement: &70307039100520 !ruby/object:Gem::Requirement
38
+ requirement: &70121188809200 !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: *70307039100520
46
+ version_requirements: *70121188809200
47
47
  description: Adaptable private URL shortener
48
48
  email: technoweenie@gmail.com
49
49
  executables: []