paperclip_redis 0.0.8 → 0.0.9
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.
- checksums.yaml +8 -8
- data/README.rdoc +8 -2
- data/VERSION +1 -1
- data/lib/paperclip/myversion.rb +1 -1
- data/lib/paperclip/storage/redis.rb +5 -1
- data/paperclip_redis.gemspec +3 -3
- data/spec/paperclip_redis_spec.rb +25 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzhhNDRlNmExOTcxZTY4NzQwNTc3OTNjMDBjMTAxMzYxZmE5ZGQwNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjA2YzZkMzJjZWZkNTM2MTZlMTc0YjNmNjYzMjQ4YWUwYzRhZDdlMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTY5M2MzYWMwMDgzMGE0OTRhZWE5MjY5OTU1ZTBmZWU0OTkzMzAwYjg0YjQ5
|
10
|
+
NjdiYmU0ODBmNThmYWJiZmU2ZDdjYTNiOGQyZmFmYzFmNjlhN2ExOTU3MWIz
|
11
|
+
MDlmYjdhNTQ3OWU3NTA3MTg0NjVlZTFhNzM2MWNmNWJjMzNmZTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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.
|
1
|
+
0.0.9
|
data/lib/paperclip/myversion.rb
CHANGED
@@ -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)}")
|
data/paperclip_redis.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
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
|
-
|
5
|
-
|
6
|
-
|
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.
|
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-
|
12
|
+
date: 2014-04-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paperclip
|