paperclip_redis 0.0.9 → 0.1.0

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.
Files changed (66) hide show
  1. checksums.yaml +5 -13
  2. data/Gemfile +11 -5
  3. data/Gemfile.lock +145 -40
  4. data/README.rdoc +3 -1
  5. data/VERSION +1 -1
  6. data/lib/paperclip/myversion.rb +2 -2
  7. data/lib/paperclip/storage/redis.rb +12 -4
  8. data/paperclip_redis.gemspec +75 -6
  9. data/spec/file.png +0 -0
  10. data/spec/models/paperclip_model_spec.rb +30 -0
  11. data/spec/{paperclip_redis_spec.rb → models/paperclip_redis_spec.rb} +2 -2
  12. data/spec/paperclip-app/.gitignore +16 -0
  13. data/spec/paperclip-app/Gemfile +44 -0
  14. data/spec/paperclip-app/Gemfile.lock +167 -0
  15. data/spec/paperclip-app/README.rdoc +28 -0
  16. data/spec/paperclip-app/Rakefile +6 -0
  17. data/spec/paperclip-app/app/assets/images/.keep +0 -0
  18. data/spec/paperclip-app/app/assets/javascripts/application.js +16 -0
  19. data/spec/paperclip-app/app/assets/stylesheets/application.css +15 -0
  20. data/spec/paperclip-app/app/controllers/application_controller.rb +5 -0
  21. data/spec/paperclip-app/app/controllers/concerns/.keep +0 -0
  22. data/spec/paperclip-app/app/helpers/application_helper.rb +2 -0
  23. data/spec/paperclip-app/app/mailers/.keep +0 -0
  24. data/spec/paperclip-app/app/models/.keep +0 -0
  25. data/spec/paperclip-app/app/models/concerns/.keep +0 -0
  26. data/spec/paperclip-app/app/models/test_paperclip.rb +9 -0
  27. data/spec/paperclip-app/app/views/layouts/application.html.erb +14 -0
  28. data/spec/paperclip-app/bin/bundle +3 -0
  29. data/spec/paperclip-app/bin/rails +8 -0
  30. data/spec/paperclip-app/bin/rake +8 -0
  31. data/spec/paperclip-app/bin/spring +18 -0
  32. data/spec/paperclip-app/config/application.rb +23 -0
  33. data/spec/paperclip-app/config/boot.rb +4 -0
  34. data/spec/paperclip-app/config/database.yml +25 -0
  35. data/spec/paperclip-app/config/environment.rb +5 -0
  36. data/spec/paperclip-app/config/environments/development.rb +37 -0
  37. data/spec/paperclip-app/config/environments/production.rb +82 -0
  38. data/spec/paperclip-app/config/environments/test.rb +39 -0
  39. data/spec/paperclip-app/config/initializers/assets.rb +8 -0
  40. data/spec/paperclip-app/config/initializers/backtrace_silencers.rb +7 -0
  41. data/spec/paperclip-app/config/initializers/cookies_serializer.rb +3 -0
  42. data/spec/paperclip-app/config/initializers/filter_parameter_logging.rb +4 -0
  43. data/spec/paperclip-app/config/initializers/inflections.rb +16 -0
  44. data/spec/paperclip-app/config/initializers/mime_types.rb +4 -0
  45. data/spec/paperclip-app/config/initializers/session_store.rb +3 -0
  46. data/spec/paperclip-app/config/initializers/wrap_parameters.rb +14 -0
  47. data/spec/paperclip-app/config/locales/en.yml +23 -0
  48. data/spec/paperclip-app/config/routes.rb +56 -0
  49. data/spec/paperclip-app/config/secrets.yml +22 -0
  50. data/spec/paperclip-app/config.ru +4 -0
  51. data/spec/paperclip-app/db/migrate/20140626105022_create_test_paperclips.rb +8 -0
  52. data/spec/paperclip-app/db/migrate/20140626114326_add_attachment_avatar_to_test_paperclips.rb +11 -0
  53. data/spec/paperclip-app/db/schema.rb +25 -0
  54. data/spec/paperclip-app/db/seeds.rb +7 -0
  55. data/spec/paperclip-app/lib/assets/.keep +0 -0
  56. data/spec/paperclip-app/lib/tasks/.keep +0 -0
  57. data/spec/paperclip-app/log/.keep +0 -0
  58. data/spec/paperclip-app/public/404.html +67 -0
  59. data/spec/paperclip-app/public/422.html +67 -0
  60. data/spec/paperclip-app/public/500.html +66 -0
  61. data/spec/paperclip-app/public/favicon.ico +0 -0
  62. data/spec/paperclip-app/public/robots.txt +5 -0
  63. data/spec/paperclip-app/vendor/assets/javascripts/.keep +0 -0
  64. data/spec/paperclip-app/vendor/assets/stylesheets/.keep +0 -0
  65. data/spec/spec_helper.rb +5 -3
  66. metadata +141 -16
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NzhhNDRlNmExOTcxZTY4NzQwNTc3OTNjMDBjMTAxMzYxZmE5ZGQwNQ==
5
- data.tar.gz: !binary |-
6
- NjA2YzZkMzJjZWZkNTM2MTZlMTc0YjNmNjYzMjQ4YWUwYzRhZDdlMg==
2
+ SHA1:
3
+ metadata.gz: 68dc8434a91f49b930e3d9a7ce107d17b2d6a048
4
+ data.tar.gz: 412cc15ef06d21f5f87ffad32c95ccb829f2c2a8
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MTY5M2MzYWMwMDgzMGE0OTRhZWE5MjY5OTU1ZTBmZWU0OTkzMzAwYjg0YjQ5
10
- NjdiYmU0ODBmNThmYWJiZmU2ZDdjYTNiOGQyZmFmYzFmNjlhN2ExOTU3MWIz
11
- MDlmYjdhNTQ3OWU3NTA3MTg0NjVlZTFhNzM2MWNmNWJjMzNmZTA=
12
- data.tar.gz: !binary |-
13
- YWQwMWUxYTkxMzNmYjk4MjEyN2Y1YTk1NDBlOWU4MDcyMDY0MmM4YjgzMzA3
14
- Njg1YmZhMWZkMzU0Y2M4MWMyN2Q2N2RkNjNjNDEyZTY1NGJhNzcxMDczMTIw
15
- ZWY4YmMyZjAzZGYxMTdjMzMwYmNiNjlkYmI5YTFkOTkxZmJmMGE=
6
+ metadata.gz: 9d60d75e2109e6b1500a9f48b0fe6740dd02caf9262bc49a69f9cf991575cd46e792d113556f3396a2cf459d905e06c636c7310eb64aec30de37ba1ecb59f058
7
+ data.tar.gz: f32f4fa13d8dc69aeb708a375cb2174ceb7c3709befc49c39f862b48cb32a244f7a3df0c25949d13ae00127168ff58bb9f63ba4346da74f48cd497637f7e0c5b
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
+ ruby '2.0.0'
2
3
 
3
4
  if RUBY_VERSION =~ /1.9/
4
5
  Encoding.default_external = Encoding::UTF_8
@@ -9,13 +10,18 @@ gem 'paperclip'
9
10
  gem 'redis'
10
11
 
11
12
  group :development do
12
- gem "shoulda", ">= 0"
13
- gem "rdoc", "~> 3.12"
14
- gem "bundler", "~> 1.0"
15
- gem "jeweler", "~> 2.0.1"
16
- gem "simplecov", ">= 0"
13
+ gem 'shoulda', '>= 0'
14
+ gem 'rdoc', '~> 3.12'
15
+ gem 'bundler', '~> 1.0'
16
+ gem 'jeweler', '~> 2.0.1'
17
+ gem 'simplecov', '>= 0'
17
18
  end
18
19
 
19
20
  group :development, :test do
21
+ gem 'guard-rspec', '>= 0'
22
+ gem 'guard-yard', '>= 0'
23
+ gem 'rails', '>= 4.0.0'
24
+ gem 'sqlite3'
20
25
  gem 'rspec'
26
+ gem 'rspec-rails'
21
27
  end
data/Gemfile.lock CHANGED
@@ -1,28 +1,52 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activemodel (4.0.4)
5
- activesupport (= 4.0.4)
6
- builder (~> 3.1.0)
7
- activesupport (4.0.4)
4
+ actionmailer (4.1.1)
5
+ actionpack (= 4.1.1)
6
+ actionview (= 4.1.1)
7
+ mail (~> 2.5.4)
8
+ actionpack (4.1.1)
9
+ actionview (= 4.1.1)
10
+ activesupport (= 4.1.1)
11
+ rack (~> 1.5.2)
12
+ rack-test (~> 0.6.2)
13
+ actionview (4.1.1)
14
+ activesupport (= 4.1.1)
15
+ builder (~> 3.1)
16
+ erubis (~> 2.7.0)
17
+ activemodel (4.1.1)
18
+ activesupport (= 4.1.1)
19
+ builder (~> 3.1)
20
+ activerecord (4.1.1)
21
+ activemodel (= 4.1.1)
22
+ activesupport (= 4.1.1)
23
+ arel (~> 5.0.0)
24
+ activesupport (4.1.1)
8
25
  i18n (~> 0.6, >= 0.6.9)
9
- minitest (~> 4.2)
10
- multi_json (~> 1.3)
26
+ json (~> 1.7, >= 1.7.7)
27
+ minitest (~> 5.1)
11
28
  thread_safe (~> 0.1)
12
- tzinfo (~> 0.3.37)
13
- addressable (2.3.5)
14
- atomic (1.1.16)
15
- builder (3.1.4)
29
+ tzinfo (~> 1.1)
30
+ addressable (2.3.6)
31
+ arel (5.0.1.20140414130214)
32
+ builder (3.2.2)
33
+ celluloid (0.15.2)
34
+ timers (~> 1.1.0)
16
35
  climate_control (0.0.3)
17
36
  activesupport (>= 3.0)
18
- cocaine (0.5.3)
37
+ cocaine (0.5.4)
19
38
  climate_control (>= 0.0.3, < 1.0)
20
- descendants_tracker (0.0.3)
39
+ coderay (1.1.0)
40
+ descendants_tracker (0.0.4)
41
+ thread_safe (~> 0.3, >= 0.3.1)
21
42
  diff-lcs (1.2.5)
22
- docile (1.1.3)
43
+ docile (1.1.5)
44
+ erubis (2.7.0)
23
45
  faraday (0.9.0)
24
46
  multipart-post (>= 1.2, < 3)
25
- git (1.2.6)
47
+ ffi (1.9.3)
48
+ formatador (0.2.5)
49
+ git (1.2.7)
26
50
  github_api (0.11.3)
27
51
  addressable (~> 2.3)
28
52
  descendants_tracker (~> 0.0.1)
@@ -31,8 +55,21 @@ GEM
31
55
  multi_json (>= 1.7.5, < 2.0)
32
56
  nokogiri (~> 1.6.0)
33
57
  oauth2
34
- hashie (2.0.5)
58
+ guard (2.6.1)
59
+ formatador (>= 0.2.4)
60
+ listen (~> 2.7)
61
+ lumberjack (~> 1.0)
62
+ pry (>= 0.9.12)
63
+ thor (>= 0.18.1)
64
+ guard-rspec (4.2.10)
65
+ guard (~> 2.1)
66
+ rspec (>= 2.14, < 4.0)
67
+ guard-yard (2.1.1)
68
+ guard (>= 1.1.0)
69
+ yard (>= 0.7.0)
70
+ hashie (3.1.0)
35
71
  highline (1.6.21)
72
+ hike (1.2.3)
36
73
  i18n (0.6.9)
37
74
  jeweler (2.0.1)
38
75
  builder
@@ -44,19 +81,27 @@ GEM
44
81
  rake
45
82
  rdoc
46
83
  json (1.8.1)
47
- jwt (0.1.11)
48
- multi_json (>= 1.5)
49
- mime-types (2.2)
50
- mini_portile (0.5.2)
51
- minitest (4.7.5)
52
- multi_json (1.9.0)
84
+ jwt (1.0.0)
85
+ listen (2.7.9)
86
+ celluloid (>= 0.15.2)
87
+ rb-fsevent (>= 0.9.3)
88
+ rb-inotify (>= 0.9)
89
+ lumberjack (1.0.9)
90
+ mail (2.5.4)
91
+ mime-types (~> 1.16)
92
+ treetop (~> 1.4.8)
93
+ method_source (0.8.2)
94
+ mime-types (1.25.1)
95
+ mini_portile (0.6.0)
96
+ minitest (5.3.5)
97
+ multi_json (1.10.1)
53
98
  multi_xml (0.5.5)
54
99
  multipart-post (2.0.0)
55
- nokogiri (1.6.1)
56
- mini_portile (~> 0.5.0)
57
- oauth2 (0.9.3)
100
+ nokogiri (1.6.2.1)
101
+ mini_portile (= 0.6.0)
102
+ oauth2 (0.9.4)
58
103
  faraday (>= 0.8, < 0.10)
59
- jwt (~> 0.1.8)
104
+ jwt (~> 1.0)
60
105
  multi_json (~> 1.3)
61
106
  multi_xml (~> 0.5)
62
107
  rack (~> 1.2)
@@ -65,43 +110,103 @@ GEM
65
110
  activesupport (>= 3.0.0)
66
111
  cocaine (~> 0.5.3)
67
112
  mime-types
113
+ polyglot (0.3.5)
114
+ pry (0.10.0)
115
+ coderay (~> 1.1.0)
116
+ method_source (~> 0.8.1)
117
+ slop (~> 3.4)
68
118
  rack (1.5.2)
69
- rake (10.1.1)
119
+ rack-test (0.6.2)
120
+ rack (>= 1.0)
121
+ rails (4.1.1)
122
+ actionmailer (= 4.1.1)
123
+ actionpack (= 4.1.1)
124
+ actionview (= 4.1.1)
125
+ activemodel (= 4.1.1)
126
+ activerecord (= 4.1.1)
127
+ activesupport (= 4.1.1)
128
+ bundler (>= 1.3.0, < 2.0)
129
+ railties (= 4.1.1)
130
+ sprockets-rails (~> 2.0)
131
+ railties (4.1.1)
132
+ actionpack (= 4.1.1)
133
+ activesupport (= 4.1.1)
134
+ rake (>= 0.8.7)
135
+ thor (>= 0.18.1, < 2.0)
136
+ rake (10.3.2)
137
+ rb-fsevent (0.9.4)
138
+ rb-inotify (0.9.5)
139
+ ffi (>= 0.5.0)
70
140
  rdoc (3.12.2)
71
141
  json (~> 1.4)
72
- redis (3.0.7)
73
- rspec (2.14.1)
74
- rspec-core (~> 2.14.0)
75
- rspec-expectations (~> 2.14.0)
76
- rspec-mocks (~> 2.14.0)
77
- rspec-core (2.14.8)
78
- rspec-expectations (2.14.5)
79
- diff-lcs (>= 1.1.3, < 2.0)
80
- rspec-mocks (2.14.6)
142
+ redis (3.1.0)
143
+ rspec (3.0.0)
144
+ rspec-core (~> 3.0.0)
145
+ rspec-expectations (~> 3.0.0)
146
+ rspec-mocks (~> 3.0.0)
147
+ rspec-core (3.0.2)
148
+ rspec-support (~> 3.0.0)
149
+ rspec-expectations (3.0.2)
150
+ diff-lcs (>= 1.2.0, < 2.0)
151
+ rspec-support (~> 3.0.0)
152
+ rspec-mocks (3.0.2)
153
+ rspec-support (~> 3.0.0)
154
+ rspec-rails (3.0.1)
155
+ actionpack (>= 3.0)
156
+ activesupport (>= 3.0)
157
+ railties (>= 3.0)
158
+ rspec-core (~> 3.0.0)
159
+ rspec-expectations (~> 3.0.0)
160
+ rspec-mocks (~> 3.0.0)
161
+ rspec-support (~> 3.0.0)
162
+ rspec-support (3.0.2)
81
163
  shoulda (3.5.0)
82
164
  shoulda-context (~> 1.0, >= 1.0.1)
83
165
  shoulda-matchers (>= 1.4.1, < 3.0)
84
- shoulda-context (1.1.6)
85
- shoulda-matchers (2.5.0)
166
+ shoulda-context (1.2.1)
167
+ shoulda-matchers (2.6.1)
86
168
  activesupport (>= 3.0.0)
87
169
  simplecov (0.8.2)
88
170
  docile (~> 1.1.0)
89
171
  multi_json
90
172
  simplecov-html (~> 0.8.0)
91
173
  simplecov-html (0.8.0)
92
- thread_safe (0.3.1)
93
- atomic (>= 1.1.7, < 2)
94
- tzinfo (0.3.39)
174
+ slop (3.5.0)
175
+ sprockets (2.12.1)
176
+ hike (~> 1.2)
177
+ multi_json (~> 1.0)
178
+ rack (~> 1.0)
179
+ tilt (~> 1.1, != 1.3.0)
180
+ sprockets-rails (2.1.3)
181
+ actionpack (>= 3.0)
182
+ activesupport (>= 3.0)
183
+ sprockets (~> 2.8)
184
+ sqlite3 (1.3.9)
185
+ thor (0.19.1)
186
+ thread_safe (0.3.4)
187
+ tilt (1.4.1)
188
+ timers (1.1.0)
189
+ treetop (1.4.15)
190
+ polyglot
191
+ polyglot (>= 0.3.1)
192
+ tzinfo (1.2.1)
193
+ thread_safe (~> 0.1)
194
+ yard (0.8.7.4)
95
195
 
96
196
  PLATFORMS
97
197
  ruby
98
198
 
99
199
  DEPENDENCIES
100
200
  bundler (~> 1.0)
201
+ guard-rspec
202
+ guard-yard
101
203
  jeweler (~> 2.0.1)
102
204
  paperclip
205
+ rails (>= 4.0.0)
103
206
  rdoc (~> 3.12)
104
207
  redis
105
208
  rspec
209
+ rspec-rails
106
210
  shoulda
107
211
  simplecov
212
+ sqlite3
data/README.rdoc CHANGED
@@ -10,7 +10,9 @@ A storage backed written as a {gist}[https://gist.github.com/unnu/4253524] by {N
10
10
 
11
11
  Use the environment variable +PAPERCLIP_REDIS+ to define the location of the redis server
12
12
 
13
- +PAPERCLIP_REDIS=http://remotehost:6379/
13
+
14
+ PAPERCLIP_REDIS=http://remotehost:6379/
15
+
14
16
 
15
17
  == Contributing to paperclip_redis
16
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.1.0
@@ -2,8 +2,8 @@
2
2
  class Paperclip
3
3
  module Version
4
4
  MAJOR = 0
5
- MINOR = 0
6
- PATCH = 9
5
+ MINOR = 1
6
+ PATCH = 0
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
9
9
  end
@@ -17,7 +17,9 @@ module Paperclip
17
17
  end
18
18
 
19
19
  def exists?(style = default_style)
20
- @redis.exists(path(style))
20
+ @redis.with_reconnect do
21
+ @redis.exists(path(style))
22
+ end
21
23
  end
22
24
 
23
25
  def ping
@@ -28,14 +30,18 @@ module Paperclip
28
30
  @queued_for_write.each do |style, file|
29
31
  log("saving #{path(style)}")
30
32
  file.rewind
31
- @redis.set(path(style), file.read)
33
+ @redis.with_reconnect do
34
+ @redis.set(path(style), file.read)
35
+ end
32
36
  end
33
37
  end
34
38
 
35
39
  def flush_deletes
36
40
  @queued_for_delete.each do |path|
37
41
  log("deleting #{path}")
38
- @redis.del(path)
42
+ @redis.with_reconnect do
43
+ @redis.del(path)
44
+ end
39
45
  end
40
46
  end
41
47
 
@@ -46,7 +52,9 @@ module Paperclip
46
52
  end
47
53
 
48
54
  def read(style = default_style)
49
- @redis.get(path(style))
55
+ @redis.with_reconnect do
56
+ @redis.get(path(style))
57
+ end
50
58
  end
51
59
 
52
60
  class App
@@ -2,16 +2,14 @@
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.9 ruby lib
6
5
 
7
6
  Gem::Specification.new do |s|
8
7
  s.name = "paperclip_redis"
9
- s.version = "0.0.9"
8
+ s.version = "0.1.0"
10
9
 
11
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
11
  s.authors = ["Daniel W. Crompton", "Norman Timmler"]
14
- s.date = "2014-04-13"
12
+ s.date = "2014-06-26"
15
13
  s.description = "This module stores the image files in Redis"
16
14
  s.email = ["paperclip+redis@specialbrands.net", ""]
17
15
  s.extra_rdoc_files = [
@@ -32,12 +30,68 @@ Gem::Specification.new do |s|
32
30
  "lib/paperclip/storage/redis.rb",
33
31
  "lib/paperclip_redis.rb",
34
32
  "paperclip_redis.gemspec",
35
- "spec/paperclip_redis_spec.rb",
33
+ "spec/file.png",
34
+ "spec/models/paperclip_model_spec.rb",
35
+ "spec/models/paperclip_redis_spec.rb",
36
+ "spec/paperclip-app/.gitignore",
37
+ "spec/paperclip-app/Gemfile",
38
+ "spec/paperclip-app/Gemfile.lock",
39
+ "spec/paperclip-app/README.rdoc",
40
+ "spec/paperclip-app/Rakefile",
41
+ "spec/paperclip-app/app/assets/images/.keep",
42
+ "spec/paperclip-app/app/assets/javascripts/application.js",
43
+ "spec/paperclip-app/app/assets/stylesheets/application.css",
44
+ "spec/paperclip-app/app/controllers/application_controller.rb",
45
+ "spec/paperclip-app/app/controllers/concerns/.keep",
46
+ "spec/paperclip-app/app/helpers/application_helper.rb",
47
+ "spec/paperclip-app/app/mailers/.keep",
48
+ "spec/paperclip-app/app/models/.keep",
49
+ "spec/paperclip-app/app/models/concerns/.keep",
50
+ "spec/paperclip-app/app/models/test_paperclip.rb",
51
+ "spec/paperclip-app/app/views/layouts/application.html.erb",
52
+ "spec/paperclip-app/bin/bundle",
53
+ "spec/paperclip-app/bin/rails",
54
+ "spec/paperclip-app/bin/rake",
55
+ "spec/paperclip-app/bin/spring",
56
+ "spec/paperclip-app/config.ru",
57
+ "spec/paperclip-app/config/application.rb",
58
+ "spec/paperclip-app/config/boot.rb",
59
+ "spec/paperclip-app/config/database.yml",
60
+ "spec/paperclip-app/config/environment.rb",
61
+ "spec/paperclip-app/config/environments/development.rb",
62
+ "spec/paperclip-app/config/environments/production.rb",
63
+ "spec/paperclip-app/config/environments/test.rb",
64
+ "spec/paperclip-app/config/initializers/assets.rb",
65
+ "spec/paperclip-app/config/initializers/backtrace_silencers.rb",
66
+ "spec/paperclip-app/config/initializers/cookies_serializer.rb",
67
+ "spec/paperclip-app/config/initializers/filter_parameter_logging.rb",
68
+ "spec/paperclip-app/config/initializers/inflections.rb",
69
+ "spec/paperclip-app/config/initializers/mime_types.rb",
70
+ "spec/paperclip-app/config/initializers/session_store.rb",
71
+ "spec/paperclip-app/config/initializers/wrap_parameters.rb",
72
+ "spec/paperclip-app/config/locales/en.yml",
73
+ "spec/paperclip-app/config/routes.rb",
74
+ "spec/paperclip-app/config/secrets.yml",
75
+ "spec/paperclip-app/db/migrate/20140626105022_create_test_paperclips.rb",
76
+ "spec/paperclip-app/db/migrate/20140626114326_add_attachment_avatar_to_test_paperclips.rb",
77
+ "spec/paperclip-app/db/schema.rb",
78
+ "spec/paperclip-app/db/seeds.rb",
79
+ "spec/paperclip-app/lib/assets/.keep",
80
+ "spec/paperclip-app/lib/tasks/.keep",
81
+ "spec/paperclip-app/log/.keep",
82
+ "spec/paperclip-app/public/404.html",
83
+ "spec/paperclip-app/public/422.html",
84
+ "spec/paperclip-app/public/500.html",
85
+ "spec/paperclip-app/public/favicon.ico",
86
+ "spec/paperclip-app/public/robots.txt",
87
+ "spec/paperclip-app/vendor/assets/javascripts/.keep",
88
+ "spec/paperclip-app/vendor/assets/stylesheets/.keep",
36
89
  "spec/spec_helper.rb"
37
90
  ]
38
91
  s.homepage = "http://github.com/webhat/paperclip_redis"
39
92
  s.licenses = ["LGPLv2"]
40
- s.rubygems_version = "2.2.2"
93
+ s.require_paths = ["lib"]
94
+ s.rubygems_version = "2.0.6"
41
95
  s.summary = "Store Images in Redis"
42
96
 
43
97
  if s.respond_to? :specification_version then
@@ -51,7 +105,12 @@ Gem::Specification.new do |s|
51
105
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
52
106
  s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
53
107
  s.add_development_dependency(%q<simplecov>, [">= 0"])
108
+ s.add_development_dependency(%q<guard-rspec>, [">= 0"])
109
+ s.add_development_dependency(%q<guard-yard>, [">= 0"])
110
+ s.add_development_dependency(%q<rails>, [">= 4.0.0"])
111
+ s.add_development_dependency(%q<sqlite3>, [">= 0"])
54
112
  s.add_development_dependency(%q<rspec>, [">= 0"])
113
+ s.add_development_dependency(%q<rspec-rails>, [">= 0"])
55
114
  else
56
115
  s.add_dependency(%q<paperclip>, [">= 0"])
57
116
  s.add_dependency(%q<redis>, [">= 0"])
@@ -60,7 +119,12 @@ Gem::Specification.new do |s|
60
119
  s.add_dependency(%q<bundler>, ["~> 1.0"])
61
120
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
62
121
  s.add_dependency(%q<simplecov>, [">= 0"])
122
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
123
+ s.add_dependency(%q<guard-yard>, [">= 0"])
124
+ s.add_dependency(%q<rails>, [">= 4.0.0"])
125
+ s.add_dependency(%q<sqlite3>, [">= 0"])
63
126
  s.add_dependency(%q<rspec>, [">= 0"])
127
+ s.add_dependency(%q<rspec-rails>, [">= 0"])
64
128
  end
65
129
  else
66
130
  s.add_dependency(%q<paperclip>, [">= 0"])
@@ -70,7 +134,12 @@ Gem::Specification.new do |s|
70
134
  s.add_dependency(%q<bundler>, ["~> 1.0"])
71
135
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
72
136
  s.add_dependency(%q<simplecov>, [">= 0"])
137
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
138
+ s.add_dependency(%q<guard-yard>, [">= 0"])
139
+ s.add_dependency(%q<rails>, [">= 4.0.0"])
140
+ s.add_dependency(%q<sqlite3>, [">= 0"])
73
141
  s.add_dependency(%q<rspec>, [">= 0"])
142
+ s.add_dependency(%q<rspec-rails>, [">= 0"])
74
143
  end
75
144
  end
76
145
 
data/spec/file.png ADDED
Binary file
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe TestPaperclip do
4
+ describe 'creates a new attachment' do
5
+ [nil, 'http://localhost:6379/'].each do |url|
6
+ before(:each) do
7
+ @model = TestPaperclip.new
8
+ @model.save
9
+ end
10
+
11
+ it "should add a file with: '#{url}'" do
12
+ ENV['PAPERCLIP_REDIS'] = url
13
+
14
+ @model.avatar = File.open('spec/file.png')
15
+ @model.save
16
+ end
17
+ it "should copy a file with: '#{url}'" do
18
+ ENV['PAPERCLIP_REDIS'] = url
19
+
20
+ @new_model = TestPaperclip.new
21
+ @model.avatar = File.open('spec/file.png')
22
+ @new_model.avatar = @model.avatar
23
+ @new_model.save
24
+
25
+ @new_model.avatar = @model.avatar
26
+ @new_model.save
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,6 +1,6 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require 'paperclip_redis'
2
2
 
3
- describe "PaperclipRedis" do
3
+ describe 'Paperclip::Storage::Redis' do
4
4
  class DummyClass
5
5
  def initialize
6
6
  @options = {}
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
@@ -0,0 +1,44 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.2.rc1'
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 4.0.3'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .js.coffee assets and views
13
+ gem 'coffee-rails', '~> 4.0.0'
14
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
25
+
26
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
27
+ gem 'spring', group: :development
28
+
29
+ # Use ActiveModel has_secure_password
30
+ # gem 'bcrypt', '~> 3.1.7'
31
+
32
+ # Use unicorn as the app server
33
+ # gem 'unicorn'
34
+
35
+ # Use Capistrano for deployment
36
+ # gem 'capistrano-rails', group: :development
37
+
38
+ # Use debugger
39
+ # gem 'debugger', group: [:development, :test]
40
+
41
+ gem "rspec-rails", :group => [:development, :test]
42
+
43
+ gem 'paperclip', github: 'thoughtbot/paperclip'
44
+ gem 'paperclip_redis', path: '../..'