paperclip-dimension 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +2 -3
- data/VERSION +1 -1
- data/lib/paperclip-dimension.rb +1 -1
- data/paperclip-dimension.gemspec +6 -6
- data/spec/spec_helper.rb +3 -5
- metadata +54 -19
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,6 @@ paperclip-dimension
|
|
2
2
|
===================
|
3
3
|
|
4
4
|
This gem is the improved version of `mongoid_paperclip_image_dimension` that is ORM agnostic.
|
5
|
-
If you are using `mongoid_paperclip_image_dimension`, you should upgrade to this gem.
|
6
5
|
|
7
6
|
This is a simple gem to persist image dimensions of originals and thumbnails.
|
8
7
|
It works for both s3 and filesystem storages.
|
@@ -35,14 +34,14 @@ You need to make sure the following is in place:
|
|
35
34
|
|
36
35
|
**Rails & ActiveRecord Migration**
|
37
36
|
|
38
|
-
`paperclip` gives you the ability to create migrations with `
|
37
|
+
`paperclip` gives you the ability to create migrations with `attachment`.
|
39
38
|
For example:
|
40
39
|
|
41
40
|
```ruby
|
42
41
|
class CreatePosts < ActiveRecord::Migration
|
43
42
|
def up
|
44
43
|
create_table :posts do |t|
|
45
|
-
t.
|
44
|
+
t.attachment :image
|
46
45
|
end
|
47
46
|
end
|
48
47
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/paperclip-dimension.rb
CHANGED
data/paperclip-dimension.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "paperclip-dimension"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Aaron Qian"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-01-10"
|
13
13
|
s.description = "A simple plugin to persist image dimensions."
|
14
14
|
s.email = "aq1018@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -33,14 +33,14 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.homepage = "http://github.com/aq1018/paperclip-dimension"
|
34
34
|
s.licenses = ["MIT"]
|
35
35
|
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version = "1.8.
|
36
|
+
s.rubygems_version = "1.8.24"
|
37
37
|
s.summary = "A simple plugin to persist image dimensions."
|
38
38
|
|
39
39
|
if s.respond_to? :specification_version then
|
40
40
|
s.specification_version = 3
|
41
41
|
|
42
42
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
43
|
-
s.add_runtime_dependency(%q<paperclip>, [">=
|
43
|
+
s.add_runtime_dependency(%q<paperclip>, [">= 3.0"])
|
44
44
|
s.add_development_dependency(%q<activerecord>, [">= 0"])
|
45
45
|
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
46
46
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
@@ -48,7 +48,7 @@ Gem::Specification.new do |s|
|
|
48
48
|
s.add_development_dependency(%q<bundler>, [">= 0"])
|
49
49
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
50
50
|
else
|
51
|
-
s.add_dependency(%q<paperclip>, [">=
|
51
|
+
s.add_dependency(%q<paperclip>, [">= 3.0"])
|
52
52
|
s.add_dependency(%q<activerecord>, [">= 0"])
|
53
53
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
54
54
|
s.add_dependency(%q<rspec>, [">= 0"])
|
@@ -57,7 +57,7 @@ Gem::Specification.new do |s|
|
|
57
57
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
58
58
|
end
|
59
59
|
else
|
60
|
-
s.add_dependency(%q<paperclip>, [">=
|
60
|
+
s.add_dependency(%q<paperclip>, [">= 3.0"])
|
61
61
|
s.add_dependency(%q<activerecord>, [">= 0"])
|
62
62
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
63
63
|
s.add_dependency(%q<rspec>, [">= 0"])
|
data/spec/spec_helper.rb
CHANGED
@@ -5,7 +5,6 @@ require 'rspec'
|
|
5
5
|
require 'active_record'
|
6
6
|
require 'paperclip'
|
7
7
|
require 'paperclip-dimension'
|
8
|
-
require 'paperclip/railtie'
|
9
8
|
|
10
9
|
# mocking Rails.root & Rails.env used in Paperclip::Interploration
|
11
10
|
module Rails
|
@@ -22,8 +21,7 @@ module Rails
|
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|
25
|
-
|
26
|
-
Paperclip::Railtie.insert
|
24
|
+
ActiveRecord::Base.send(:include, Paperclip::Glue)
|
27
25
|
|
28
26
|
# turn off logging
|
29
27
|
Paperclip.options[:log] = false
|
@@ -37,8 +35,8 @@ ActiveRecord::Base.establish_connection({
|
|
37
35
|
# create tables
|
38
36
|
ActiveRecord::Schema.define do
|
39
37
|
create_table :posts do |t|
|
40
|
-
t.
|
41
|
-
t.
|
38
|
+
t.attachment :image
|
39
|
+
t.attachment :another_image
|
42
40
|
end
|
43
41
|
end
|
44
42
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-dimension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,27 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: paperclip
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: activerecord
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: sqlite3
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: rspec
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: yard
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: bundler
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,10 +101,15 @@ dependencies:
|
|
76
101
|
version: '0'
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: jeweler
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ! '>='
|
@@ -87,7 +117,12 @@ dependencies:
|
|
87
117
|
version: '0'
|
88
118
|
type: :development
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
91
126
|
description: A simple plugin to persist image dimensions.
|
92
127
|
email: aq1018@gmail.com
|
93
128
|
executables: []
|
@@ -123,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
158
|
version: '0'
|
124
159
|
segments:
|
125
160
|
- 0
|
126
|
-
hash: -
|
161
|
+
hash: -3262180631021356690
|
127
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
163
|
none: false
|
129
164
|
requirements:
|
@@ -132,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
167
|
version: '0'
|
133
168
|
requirements: []
|
134
169
|
rubyforge_project:
|
135
|
-
rubygems_version: 1.8.
|
170
|
+
rubygems_version: 1.8.24
|
136
171
|
signing_key:
|
137
172
|
specification_version: 3
|
138
173
|
summary: A simple plugin to persist image dimensions.
|