paperclip_redis 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzFjNTFkMGVhMTQ2NWNkNjMzNGY0ZWI2NmM4YTk4Njc2MTE0ZWMxNw==
4
+ NzhhNDRlNmExOTcxZTY4NzQwNTc3OTNjMDBjMTAxMzYxZmE5ZGQwNQ==
5
5
  data.tar.gz: !binary |-
6
- MWY3MDE5NTM3ZGQ3ZTc5Mzg2MjEyZDMzNGQ5NGU5ODMzNGYzYmMwZQ==
6
+ NjA2YzZkMzJjZWZkNTM2MTZlMTc0YjNmNjYzMjQ4YWUwYzRhZDdlMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDUwYmY2ZDMyOWViOGFiNjJkMzBmYjU5OTliOGUwNjg5YjZkMDk2NjYzZTY1
10
- ZmE0YjRkNGIxNGY0MDE3MWFkMWZlYTI3MTQ4MDZmZjFjM2U4M2JlNDk3NDA0
11
- NWM4ZGQ1Mzg0ZDE2MGNlYTgyNzNmZTIxNGRiOGNmZTE1ZDc1NGQ=
9
+ MTY5M2MzYWMwMDgzMGE0OTRhZWE5MjY5OTU1ZTBmZWU0OTkzMzAwYjg0YjQ5
10
+ NjdiYmU0ODBmNThmYWJiZmU2ZDdjYTNiOGQyZmFmYzFmNjlhN2ExOTU3MWIz
11
+ MDlmYjdhNTQ3OWU3NTA3MTg0NjVlZTFhNzM2MWNmNWJjMzNmZTA=
12
12
  data.tar.gz: !binary |-
13
- Mzg0ZWJlNmZiNzA2MjBjNzExMGU0NGMyMDk2ZDYyMjJjNTQ2MjY1MzU3MmVk
14
- M2VjYWE2Mzk3NjU2ZDk4NjEyNDFiNTAyODgxMzE2Y2NhZjE4NTJjMTRjN2Q0
15
- MmNkZTE4YmJmNTA5ODgxY2Q0ZGVmY2ViODk4MTQ3MTA0MWYzNDk=
13
+ YWQwMWUxYTkxMzNmYjk4MjEyN2Y1YTk1NDBlOWU4MDcyMDY0MmM4YjgzMzA3
14
+ Njg1YmZhMWZkMzU0Y2M4MWMyN2Q2N2RkNjNjNDEyZTY1NGJhNzcxMDczMTIw
15
+ ZWY4YmMyZjAzZGYxMTdjMzMwYmNiNjlkYmI5YTFkOTkxZmJmMGE=
data/README.rdoc CHANGED
@@ -4,6 +4,13 @@ A storage backed written as a {gist}[https://gist.github.com/unnu/4253524] by {N
4
4
 
5
5
  {<img src="https://badge.fury.io/rb/paperclip_redis.png" alt="Gem Version" />}[http://badge.fury.io/rb/paperclip_redis]
6
6
  {<img src="https://travis-ci.org/webhat/paperclip_redis.png?branch=master" alt='Travis Build Status' />}[https://travis-ci.org/webhat/paperclip_redis]
7
+ {<img src="https://www.versioneye.com/user/projects/5336d4467bae4bb0ec000ad6/badge.png" alt="Dependency Status" />}[https://www.versioneye.com/user/projects/5336d4467bae4bb0ec000ad6]
8
+
9
+ = Usage
10
+
11
+ Use the environment variable +PAPERCLIP_REDIS+ to define the location of the redis server
12
+
13
+ +PAPERCLIP_REDIS=http://remotehost:6379/
7
14
 
8
15
  == Contributing to paperclip_redis
9
16
 
@@ -17,6 +24,5 @@ A storage backed written as a {gist}[https://gist.github.com/unnu/4253524] by {N
17
24
 
18
25
  == Copyright
19
26
 
20
- Copyright (c) 2014 Daniël W. Crompton, Norman Timmler. See LICENSE.txt for
21
- further details.
27
+ Copyright (c) 2014 Daniël W. Crompton, Norman Timmler. See LICENSE.txt for further details.
22
28
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -3,7 +3,7 @@ class Paperclip
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 0
6
- PATCH = 8
6
+ PATCH = 9
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
9
9
  end
@@ -12,7 +12,7 @@ module Paperclip
12
12
  base.instance_eval do
13
13
  @options[:path] ||= ":class/:attachment/:id_partition/:style/:filename"
14
14
  @options[:url] ||= "/dynamic/:class/:attachment/:id_partition/:style/:filename"
15
- @redis = ::Redis.new
15
+ @redis = ::Redis.new( url: ENV['PAPERCLIP_REDIS'])
16
16
  end
17
17
  end
18
18
 
@@ -20,6 +20,10 @@ module Paperclip
20
20
  @redis.exists(path(style))
21
21
  end
22
22
 
23
+ def ping
24
+ @redis.ping
25
+ end
26
+
23
27
  def flush_writes
24
28
  @queued_for_write.each do |style, file|
25
29
  log("saving #{path(style)}")
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: paperclip_redis 0.0.8 ruby lib
5
+ # stub: paperclip_redis 0.0.9 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "paperclip_redis"
9
- s.version = "0.0.8"
9
+ s.version = "0.0.9"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Daniel W. Crompton", "Norman Timmler"]
14
- s.date = "2014-03-25"
14
+ s.date = "2014-04-13"
15
15
  s.description = "This module stores the image files in Redis"
16
16
  s.email = ["paperclip+redis@specialbrands.net", ""]
17
17
  s.extra_rdoc_files = [
@@ -1,7 +1,29 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "PaperclipRedis" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
6
- end
4
+ class DummyClass
5
+ def initialize
6
+ @options = {}
7
+ end
8
+ end
9
+
10
+ before(:each) do
11
+ @redis_dummy = DummyClass.new
12
+ end
13
+ it 'should run without a redis url' do
14
+ @redis_dummy.extend(Paperclip::Storage::Redis)
15
+ @redis_dummy.ping.should eq 'PONG'
16
+ end
17
+ it 'should run with a redis url' do
18
+ ENV['PAPERCLIP_REDIS'] = 'http://localhost:6379/'
19
+ @redis_dummy.extend(Paperclip::Storage::Redis)
20
+ @redis_dummy.ping.should eq 'PONG'
21
+ end
22
+ it 'should not run with a bad redis url' do
23
+ ENV['PAPERCLIP_REDIS'] = 'http://localhost:8000/'
24
+ @redis_dummy.extend(Paperclip::Storage::Redis)
25
+ expect {
26
+ @redis_dummy.ping
27
+ }.to raise_error
28
+ end
7
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip_redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel W. Crompton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-25 00:00:00.000000000 Z
12
+ date: 2014-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: paperclip