paperclip-riak 0.0.2 → 0.0.3

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fac0da239ccac7b49fc61cf7ce453f67971338fc
4
+ data.tar.gz: 2518dd1a5d221fbb32f3406cf57a63158f74900d
5
+ SHA512:
6
+ metadata.gz: 360667c2bff07757b6ff11236aeb46ebabc937c6f2e2106364fd789312c402294dafa61ffc1935f06b75499389a6a5e11ea88b5534c6e5a524e4cee43f95ab56
7
+ data.tar.gz: 93627f9d9dcd0d9bde9ce284e1c1cc38fc9fb85fe7db1298a94b23cb62aa7751f5d228247622e16cc012468a5080fdf64b01ad46f675b5ed5ed97c800a9e6396
@@ -6,7 +6,7 @@ module Paperclip
6
6
  module Riak
7
7
 
8
8
  def self.extended(base)
9
- attr_accessor :riak_hosts, :riak_bucket, :riak_endpoint
9
+ attr_accessor :riak_hosts, :riak_bucket, :riak_endpoint, :riak_client
10
10
 
11
11
  base.instance_eval do
12
12
  self.setup_options
@@ -14,11 +14,15 @@ module Paperclip
14
14
  end
15
15
 
16
16
  def url(style=default_style, options={})
17
- "#{@riak_endpoint}/#{@riak_bucket}/#{path(style)}"
17
+ if @riak_endpoint
18
+ "#{@riak_endpoint}/#{@riak_bucket}/#{path(style)}"
19
+ else
20
+ @url_generator.for(style, options)
21
+ end
18
22
  end
19
23
 
20
24
  def riak
21
- @riak ||= ::Riak::Client.new(@client_options)
25
+ @riak ||= @riak_client || ::Riak::Client.new(@client_options)
22
26
  end
23
27
 
24
28
  def bucket
@@ -31,11 +35,12 @@ module Paperclip
31
35
  }
32
36
  @riak_bucket = @options[:riak_bucket]
33
37
  @riak_endpoint = @options[:riak_endpoint]
38
+ @riak_client = @options[:riak_client]
34
39
  end
35
40
 
36
41
  def exists?(style = default_style)
37
42
  if original_filename
38
- @bucket.exists?(path(style))
43
+ bucket.exists?(path(style))
39
44
  else
40
45
  false
41
46
  end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "paperclip-riak"
6
- s.version = "0.0.2"
6
+ s.version = "0.0.3"
7
7
  s.authors = ["Nugroho Herucahyono"]
8
8
  s.email = ["xinuc@xinuc.org"]
9
9
  s.homepage = "https://github.com/xinuc/paperclip-riak"
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_runtime_dependency "paperclip"
23
- s.add_runtime_dependency "riak-client"
22
+ s.add_runtime_dependency "paperclip", ">= 2.7"
23
+ s.add_runtime_dependency "riak-client", ">= 1.1"
24
24
  end
metadata CHANGED
@@ -1,38 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-riak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nugroho Herucahyono
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-28 00:00:00.000000000 Z
11
+ date: 2014-07-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: paperclip
16
- requirement: &5863180 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: '2.7'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *5863180
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '2.7'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: riak-client
27
- requirement: &5862600 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ! '>='
31
32
  - !ruby/object:Gem::Version
32
- version: '0'
33
+ version: '1.1'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *5862600
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
36
41
  description: Paperclip storage module that allow us to store uploaded files to Riak
37
42
  email:
38
43
  - xinuc@xinuc.org
@@ -50,26 +55,25 @@ files:
50
55
  homepage: https://github.com/xinuc/paperclip-riak
51
56
  licenses:
52
57
  - MIT
58
+ metadata: {}
53
59
  post_install_message:
54
60
  rdoc_options: []
55
61
  require_paths:
56
62
  - lib
57
63
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
64
  requirements:
60
65
  - - ! '>='
61
66
  - !ruby/object:Gem::Version
62
67
  version: '0'
63
68
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
69
  requirements:
66
70
  - - ! '>='
67
71
  - !ruby/object:Gem::Version
68
72
  version: '0'
69
73
  requirements: []
70
74
  rubyforge_project: paperclip-riak
71
- rubygems_version: 1.8.10
75
+ rubygems_version: 2.0.3
72
76
  signing_key:
73
- specification_version: 3
77
+ specification_version: 4
74
78
  summary: Use riak as paperclip file storage
75
79
  test_files: []