paperclip-globalize3 1.0.0 → 1.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.
- checksums.yaml +15 -0
- data/.travis.yml +3 -0
- data/README.md +3 -3
- data/Rakefile +1 -2
- data/lib/paperclip-globalize3.rb +0 -4
- data/lib/paperclip/globalize3/attachment.rb +2 -15
- data/lib/paperclip/globalize3/gem_helper.rb +15 -0
- data/lib/paperclip/globalize3/gem_tasks.rb +2 -0
- data/lib/paperclip/globalize3/version.rb +1 -1
- data/paperclip-globalize3.gemspec +6 -1
- metadata +103 -128
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTJlOTRhNDE3Y2NiNDNkZTY0OTI0M2M3ZDUzNzc5YmRlMTZmNDM4Zg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MmNmZjBhMjMzYjY3ZTQ0NDQ2YjA1MThmNmRlOTk4ZjJmOGU3NDk5ZQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTIwYWMwYTdlZTZmNjFiYTA5MWNhMzhlMmZkM2Y2MmY2ODM2MmZmOGQ1ZmRl
|
10
|
+
Yjg4M2UyMDRmMTk4N2FkYmM4OTQzMzA0ODg2OTM1M2MyN2QxMTYwMmZiOGFj
|
11
|
+
NGVkYTQxYzE2NTRmN2YzYzE0YzI1N2JjMTEwOGNiMTRmNzc1YjI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MThkODE3ZTYxMjI1NzYxOGVkYzlmMGViMjVhNGZlOGE1OTgwNzQ1ZWM0MmFi
|
14
|
+
NzgzZDAyMTkxMmNhYzliYTBkMzViZTdhNmQxZjM5MDFjN2RiMjI3ZDEwMmEy
|
15
|
+
NjlkMTAyMjYxNzI2MzNjZjFmMGQyMDRlYmM5NzcxOWI0ODI2Mzg=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Paperclip::Globalize3
|
2
2
|
|
3
|
-
[](https://travis-ci.org/emjot/paperclip-globalize3)
|
4
4
|
|
5
5
|
Use locale-specific attachments in your Rails app with paperclip and globalize3.
|
6
6
|
|
@@ -10,7 +10,7 @@ Note that this implementation patches some methods in the `Paperclip::Attachment
|
|
10
10
|
|
11
11
|
## Compatibility
|
12
12
|
|
13
|
-
Currently, paperclip 3.x (>= 3.
|
13
|
+
This is a maintenance branch for paperclip 3.x support. Currently, paperclip 3.x (>= 3.4) and globalize3 0.3 are supported.
|
14
14
|
|
15
15
|
For paperclip 2.x support please use the 0.x versions of this gem.
|
16
16
|
|
@@ -18,7 +18,7 @@ For paperclip 2.x support please use the 0.x versions of this gem.
|
|
18
18
|
|
19
19
|
Add this line to your application's Gemfile:
|
20
20
|
|
21
|
-
gem 'paperclip-globalize3'
|
21
|
+
gem 'paperclip-globalize3', '~> 1.1.0'
|
22
22
|
|
23
23
|
And then execute:
|
24
24
|
|
data/Rakefile
CHANGED
data/lib/paperclip-globalize3.rb
CHANGED
@@ -6,8 +6,4 @@ require "paperclip"
|
|
6
6
|
|
7
7
|
Paperclip.interpolates(:locale) { |_, _| Globalize.locale.to_s }
|
8
8
|
|
9
|
-
unless Paperclip::Attachment.instance_methods.include?(:only_process)
|
10
|
-
Paperclip::Attachment.send(:include, Paperclip::Globalize3::Attachment::Compatibility::Paperclip33)
|
11
|
-
end
|
12
|
-
|
13
9
|
Paperclip::Attachment.send(:include, Paperclip::Globalize3::Attachment)
|
@@ -16,6 +16,7 @@ module Paperclip
|
|
16
16
|
ensure_required_accessors!
|
17
17
|
file = Paperclip.io_adapters.for(uploaded_file)
|
18
18
|
|
19
|
+
return nil if file.respond_to?(:assignment?) && !file.assignment?
|
19
20
|
self.clear(*only_process, :locales => Globalize.locale) # [paperclip-globalize3] only clear current locale
|
20
21
|
return nil if file.nil?
|
21
22
|
|
@@ -30,8 +31,7 @@ module Paperclip
|
|
30
31
|
@dirty = true
|
31
32
|
|
32
33
|
if post_processing &&
|
33
|
-
(
|
34
|
-
valid_assignment?)
|
34
|
+
(file.respond_to?(:assignment?) || valid_assignment?)
|
35
35
|
post_process(*only_process)
|
36
36
|
end
|
37
37
|
|
@@ -84,19 +84,6 @@ module Paperclip
|
|
84
84
|
|
85
85
|
end
|
86
86
|
|
87
|
-
module Compatibility
|
88
|
-
|
89
|
-
# For compatibility with paperclip 3.3
|
90
|
-
module Paperclip33
|
91
|
-
def only_process
|
92
|
-
only_process = @options[:only_process].dup
|
93
|
-
only_process = only_process.call(self) if only_process.respond_to?(:call)
|
94
|
-
only_process.map(&:to_sym)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
99
|
-
|
100
87
|
end
|
101
88
|
end
|
102
89
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Paperclip
|
2
|
+
module Globalize3
|
3
|
+
|
4
|
+
# Like Bundler::GemHelper, but tags versions without the 'v' prefix (e.g. '1.0.0' instead of 'v1.0.0')
|
5
|
+
class GemHelper < Bundler::GemHelper
|
6
|
+
|
7
|
+
protected
|
8
|
+
|
9
|
+
def version_tag
|
10
|
+
"#{version}"
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -3,6 +3,11 @@ lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'paperclip/globalize3/version'
|
5
5
|
|
6
|
+
paperclip_version = '~> 3.3'
|
7
|
+
unless ENV['PAPERCLIP_VERSION'].to_s.empty?
|
8
|
+
paperclip_version = Gem::Requirement.new(ENV['PAPERCLIP_VERSION'])
|
9
|
+
end
|
10
|
+
|
6
11
|
Gem::Specification.new do |spec|
|
7
12
|
spec.name = "paperclip-globalize3"
|
8
13
|
spec.version = Paperclip::Globalize3::VERSION
|
@@ -18,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
18
23
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
24
|
spec.require_paths = ["lib"]
|
20
25
|
|
21
|
-
spec.add_runtime_dependency "paperclip",
|
26
|
+
spec.add_runtime_dependency "paperclip", paperclip_version
|
22
27
|
spec.add_runtime_dependency "globalize3", "~> 0.3"
|
23
28
|
|
24
29
|
spec.add_development_dependency "bundler", "~> 1.3"
|
metadata
CHANGED
@@ -1,137 +1,120 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-globalize3
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Maximilian Herold
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: paperclip
|
22
|
-
|
23
|
-
|
24
|
-
none: false
|
25
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
26
17
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 3
|
31
|
-
- 3
|
32
|
-
version: "3.3"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.3'
|
33
20
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: globalize3
|
37
21
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: globalize3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
41
31
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
- 3
|
47
|
-
version: "0.3"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.3'
|
48
34
|
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: bundler
|
52
35
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
56
38
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
63
48
|
type: :development
|
64
|
-
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: appraisal
|
67
49
|
prerelease: false
|
68
|
-
|
69
|
-
|
70
|
-
requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
71
52
|
- - ~>
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: appraisal
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
78
61
|
version: 0.5.1
|
79
62
|
type: :development
|
80
|
-
version_requirements: *id004
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: rspec-rails
|
83
63
|
prerelease: false
|
84
|
-
|
85
|
-
|
86
|
-
requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
87
66
|
- - ~>
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.5.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
94
75
|
version: 2.8.0
|
95
76
|
type: :development
|
96
|
-
version_requirements: *id005
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: sqlite3
|
99
77
|
prerelease: false
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sqlite3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
109
90
|
type: :development
|
110
|
-
version_requirements: *id006
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rake
|
113
91
|
prerelease: false
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
123
104
|
type: :development
|
124
|
-
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
125
111
|
description: locale-specific attachments with paperclip and globalize3
|
126
|
-
email:
|
112
|
+
email:
|
127
113
|
- herold@emjot.de
|
128
114
|
executables: []
|
129
|
-
|
130
115
|
extensions: []
|
131
|
-
|
132
116
|
extra_rdoc_files: []
|
133
|
-
|
134
|
-
files:
|
117
|
+
files:
|
135
118
|
- .gitignore
|
136
119
|
- .rspec
|
137
120
|
- .travis.yml
|
@@ -145,6 +128,8 @@ files:
|
|
145
128
|
- gemfiles/rails_3.2.gemfile
|
146
129
|
- lib/paperclip-globalize3.rb
|
147
130
|
- lib/paperclip/globalize3/attachment.rb
|
131
|
+
- lib/paperclip/globalize3/gem_helper.rb
|
132
|
+
- lib/paperclip/globalize3/gem_tasks.rb
|
148
133
|
- lib/paperclip/globalize3/version.rb
|
149
134
|
- paperclip-globalize3.gemspec
|
150
135
|
- spec/attachment_helper_spec.rb
|
@@ -154,43 +139,33 @@ files:
|
|
154
139
|
- spec/data/test2.png
|
155
140
|
- spec/spec_helper.rb
|
156
141
|
homepage: https://github.com/emjot/paperclip-globalize3
|
157
|
-
licenses:
|
142
|
+
licenses:
|
158
143
|
- MIT
|
144
|
+
metadata: {}
|
159
145
|
post_install_message:
|
160
146
|
rdoc_options: []
|
161
|
-
|
162
|
-
require_paths:
|
147
|
+
require_paths:
|
163
148
|
- lib
|
164
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
none: false
|
175
|
-
requirements:
|
176
|
-
- - ">="
|
177
|
-
- !ruby/object:Gem::Version
|
178
|
-
hash: 3
|
179
|
-
segments:
|
180
|
-
- 0
|
181
|
-
version: "0"
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ! '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
182
159
|
requirements: []
|
183
|
-
|
184
160
|
rubyforge_project:
|
185
|
-
rubygems_version:
|
161
|
+
rubygems_version: 2.2.2
|
186
162
|
signing_key:
|
187
|
-
specification_version:
|
163
|
+
specification_version: 4
|
188
164
|
summary: locale-specific attachments with paperclip and globalize3
|
189
|
-
test_files:
|
165
|
+
test_files:
|
190
166
|
- spec/attachment_helper_spec.rb
|
191
167
|
- spec/data/models.rb
|
192
168
|
- spec/data/schema.rb
|
193
169
|
- spec/data/test.png
|
194
170
|
- spec/data/test2.png
|
195
171
|
- spec/spec_helper.rb
|
196
|
-
has_rdoc:
|