avatars_for_rails 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.rdoc +6 -9
- data/app/models/avatar.rb +2 -2
- data/avatars_for_rails.gemspec +1 -1
- metadata +27 -26
- data/Gemfile.lock +0 -138
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
@@ -46,11 +46,16 @@ In config/initializers/avatars_for_rails.rb you have to define:
|
|
46
46
|
config.avatarable_model = :actor
|
47
47
|
config.current_avatarable_object = :current_actor
|
48
48
|
config.avatarable_filters = [:authenticate_user!]
|
49
|
+
config.avatarable_styles = { :representation => "20x20>",
|
50
|
+
:tie => "30x30>",
|
51
|
+
:actor => '35x35>',
|
52
|
+
:profile => '94x94'}
|
49
53
|
end
|
50
54
|
|
51
55
|
* actor is the name of the object owner of the avatars
|
52
56
|
* current_actor will return the actor you wants to be the owner of the new avatars, etc For example, you can return the current logged in actor. This method can be defined on the application_controller of your app.
|
53
57
|
* authenticate_user! is the filter which will be applied as a before_filter for the avatars. You can use as many as you want.
|
58
|
+
* styles are the styles you want to have for your avatars. You can use your own sizes.
|
54
59
|
|
55
60
|
Finally, add to your actor model the relation with avatars_for_rails:
|
56
61
|
|
@@ -94,12 +99,4 @@ For rendering an image_tag for an acctor's avatar:
|
|
94
99
|
If you wan't to display an actor's active avatar:
|
95
100
|
<%= image_tag(actor.avatars.active.first, :id => "current_avatar_img") %>
|
96
101
|
|
97
|
-
The id of the image it's important. If it's set like this, when you change the default avatar from the list, it will change the avatar shown on the image with jquery.
|
98
|
-
|
99
|
-
The avaible styles for now are:
|
100
|
-
|
101
|
-
:representation => 20x20 px
|
102
|
-
:tie => 30x30 px
|
103
|
-
:actor => 35x35 px
|
104
|
-
:profile => 94x94 px
|
105
|
-
|
102
|
+
The id of the image it's important. If it's set like this, when you change the default avatar from the list, it will change the avatar shown on the image with jquery.
|
data/app/models/avatar.rb
CHANGED
@@ -3,7 +3,7 @@ require 'RMagick'
|
|
3
3
|
class Avatar < ActiveRecord::Base
|
4
4
|
has_attached_file :logo,
|
5
5
|
:styles => AvatarsForRails.avatarable_styles,
|
6
|
-
:default_url => "
|
6
|
+
:default_url => "logos/:style/:subtype_class.png"
|
7
7
|
|
8
8
|
before_post_process :process_precrop
|
9
9
|
attr_accessor :crop_x, :crop_y, :crop_w, :crop_h, :name,:updating_logo,:drag,:drag_name
|
@@ -50,7 +50,7 @@ class Avatar < ActiveRecord::Base
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def self.images_tmp_path
|
53
|
-
images_path = File.join(
|
53
|
+
images_path = File.join(Rails.root, "public", "images")
|
54
54
|
tmp_path = FileUtils.mkdir_p(File.join(images_path, "tmp"))
|
55
55
|
end
|
56
56
|
|
data/avatars_for_rails.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# project in your rails apps through git.
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "avatars_for_rails"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.10"
|
6
6
|
s.authors = ["Jaime Castro Montero"]
|
7
7
|
s.summary = "Avatar manager for rails apps."
|
8
8
|
s.description = "A Rails engine that allows any model to act as avatarable, permitting it to have a complete avatar manager with a few options."
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avatars_for_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 10
|
10
|
+
version: 0.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jaime Castro Montero
|
@@ -15,11 +15,12 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-10 00:00:00 +02:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
name: foreigner
|
22
22
|
prerelease: false
|
23
|
+
type: :runtime
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
25
26
|
requirements:
|
@@ -31,11 +32,11 @@ dependencies:
|
|
31
32
|
- 9
|
32
33
|
- 1
|
33
34
|
version: 0.9.1
|
34
|
-
|
35
|
+
name: foreigner
|
35
36
|
version_requirements: *id001
|
36
37
|
- !ruby/object:Gem::Dependency
|
37
|
-
name: paperclip
|
38
38
|
prerelease: false
|
39
|
+
type: :runtime
|
39
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
42
|
requirements:
|
@@ -47,11 +48,11 @@ dependencies:
|
|
47
48
|
- 3
|
48
49
|
- 4
|
49
50
|
version: 2.3.4
|
50
|
-
|
51
|
+
name: paperclip
|
51
52
|
version_requirements: *id002
|
52
53
|
- !ruby/object:Gem::Dependency
|
53
|
-
name: rmagick
|
54
54
|
prerelease: false
|
55
|
+
type: :runtime
|
55
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
57
|
none: false
|
57
58
|
requirements:
|
@@ -63,11 +64,11 @@ dependencies:
|
|
63
64
|
- 13
|
64
65
|
- 1
|
65
66
|
version: 2.13.1
|
66
|
-
|
67
|
+
name: rmagick
|
67
68
|
version_requirements: *id003
|
68
69
|
- !ruby/object:Gem::Dependency
|
69
|
-
name: rails
|
70
70
|
prerelease: false
|
71
|
+
type: :development
|
71
72
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
73
|
none: false
|
73
74
|
requirements:
|
@@ -79,11 +80,11 @@ dependencies:
|
|
79
80
|
- 0
|
80
81
|
- 5
|
81
82
|
version: 3.0.5
|
82
|
-
|
83
|
+
name: rails
|
83
84
|
version_requirements: *id004
|
84
85
|
- !ruby/object:Gem::Dependency
|
85
|
-
name: sqlite3-ruby
|
86
86
|
prerelease: false
|
87
|
+
type: :development
|
87
88
|
requirement: &id005 !ruby/object:Gem::Requirement
|
88
89
|
none: false
|
89
90
|
requirements:
|
@@ -93,11 +94,11 @@ dependencies:
|
|
93
94
|
segments:
|
94
95
|
- 0
|
95
96
|
version: "0"
|
96
|
-
|
97
|
+
name: sqlite3-ruby
|
97
98
|
version_requirements: *id005
|
98
99
|
- !ruby/object:Gem::Dependency
|
99
|
-
name: ruby-debug
|
100
100
|
prerelease: false
|
101
|
+
type: :development
|
101
102
|
requirement: &id006 !ruby/object:Gem::Requirement
|
102
103
|
none: false
|
103
104
|
requirements:
|
@@ -109,11 +110,11 @@ dependencies:
|
|
109
110
|
- 10
|
110
111
|
- 3
|
111
112
|
version: 0.10.3
|
112
|
-
|
113
|
+
name: ruby-debug
|
113
114
|
version_requirements: *id006
|
114
115
|
- !ruby/object:Gem::Dependency
|
115
|
-
name: rspec-rails
|
116
116
|
prerelease: false
|
117
|
+
type: :development
|
117
118
|
requirement: &id007 !ruby/object:Gem::Requirement
|
118
119
|
none: false
|
119
120
|
requirements:
|
@@ -125,11 +126,11 @@ dependencies:
|
|
125
126
|
- 5
|
126
127
|
- 0
|
127
128
|
version: 2.5.0
|
128
|
-
|
129
|
+
name: rspec-rails
|
129
130
|
version_requirements: *id007
|
130
131
|
- !ruby/object:Gem::Dependency
|
131
|
-
name: factory_girl
|
132
132
|
prerelease: false
|
133
|
+
type: :development
|
133
134
|
requirement: &id008 !ruby/object:Gem::Requirement
|
134
135
|
none: false
|
135
136
|
requirements:
|
@@ -141,11 +142,11 @@ dependencies:
|
|
141
142
|
- 3
|
142
143
|
- 2
|
143
144
|
version: 1.3.2
|
144
|
-
|
145
|
+
name: factory_girl
|
145
146
|
version_requirements: *id008
|
146
147
|
- !ruby/object:Gem::Dependency
|
147
|
-
name: forgery
|
148
148
|
prerelease: false
|
149
|
+
type: :development
|
149
150
|
requirement: &id009 !ruby/object:Gem::Requirement
|
150
151
|
none: false
|
151
152
|
requirements:
|
@@ -157,11 +158,11 @@ dependencies:
|
|
157
158
|
- 3
|
158
159
|
- 6
|
159
160
|
version: 0.3.6
|
160
|
-
|
161
|
+
name: forgery
|
161
162
|
version_requirements: *id009
|
162
163
|
- !ruby/object:Gem::Dependency
|
163
|
-
name: capybara
|
164
164
|
prerelease: false
|
165
|
+
type: :development
|
165
166
|
requirement: &id010 !ruby/object:Gem::Requirement
|
166
167
|
none: false
|
167
168
|
requirements:
|
@@ -173,7 +174,7 @@ dependencies:
|
|
173
174
|
- 3
|
174
175
|
- 9
|
175
176
|
version: 0.3.9
|
176
|
-
|
177
|
+
name: capybara
|
177
178
|
version_requirements: *id010
|
178
179
|
description: A Rails engine that allows any model to act as avatarable, permitting it to have a complete avatar manager with a few options.
|
179
180
|
email: jaime1988@gmail.com
|
@@ -186,7 +187,6 @@ extra_rdoc_files: []
|
|
186
187
|
files:
|
187
188
|
- .gitignore
|
188
189
|
- Gemfile
|
189
|
-
- Gemfile.lock
|
190
190
|
- MIT-LICENSE
|
191
191
|
- README.rdoc
|
192
192
|
- Rakefile
|
@@ -296,6 +296,7 @@ files:
|
|
296
296
|
- spec/dummy/script/rails
|
297
297
|
- spec/integration/navigation_spec.rb
|
298
298
|
- spec/spec_helper.rb
|
299
|
+
has_rdoc: true
|
299
300
|
homepage: http://github.com/ging/avatars_for_rails
|
300
301
|
licenses: []
|
301
302
|
|
@@ -325,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
325
326
|
requirements: []
|
326
327
|
|
327
328
|
rubyforge_project:
|
328
|
-
rubygems_version: 1.
|
329
|
+
rubygems_version: 1.6.2
|
329
330
|
signing_key:
|
330
331
|
specification_version: 3
|
331
332
|
summary: Avatar manager for rails apps.
|
data/Gemfile.lock
DELETED
@@ -1,138 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
avatars_for_rails (0.0.8)
|
5
|
-
foreigner (~> 0.9.1)
|
6
|
-
paperclip (~> 2.3.4)
|
7
|
-
rmagick (~> 2.13.1)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: http://rubygems.org/
|
11
|
-
specs:
|
12
|
-
abstract (1.0.0)
|
13
|
-
actionmailer (3.0.5)
|
14
|
-
actionpack (= 3.0.5)
|
15
|
-
mail (~> 2.2.15)
|
16
|
-
actionpack (3.0.5)
|
17
|
-
activemodel (= 3.0.5)
|
18
|
-
activesupport (= 3.0.5)
|
19
|
-
builder (~> 2.1.2)
|
20
|
-
erubis (~> 2.6.6)
|
21
|
-
i18n (~> 0.4)
|
22
|
-
rack (~> 1.2.1)
|
23
|
-
rack-mount (~> 0.6.13)
|
24
|
-
rack-test (~> 0.5.7)
|
25
|
-
tzinfo (~> 0.3.23)
|
26
|
-
activemodel (3.0.5)
|
27
|
-
activesupport (= 3.0.5)
|
28
|
-
builder (~> 2.1.2)
|
29
|
-
i18n (~> 0.4)
|
30
|
-
activerecord (3.0.5)
|
31
|
-
activemodel (= 3.0.5)
|
32
|
-
activesupport (= 3.0.5)
|
33
|
-
arel (~> 2.0.2)
|
34
|
-
tzinfo (~> 0.3.23)
|
35
|
-
activeresource (3.0.5)
|
36
|
-
activemodel (= 3.0.5)
|
37
|
-
activesupport (= 3.0.5)
|
38
|
-
activesupport (3.0.5)
|
39
|
-
arel (2.0.9)
|
40
|
-
builder (2.1.2)
|
41
|
-
capybara (0.3.9)
|
42
|
-
culerity (>= 0.2.4)
|
43
|
-
mime-types (>= 1.16)
|
44
|
-
nokogiri (>= 1.3.3)
|
45
|
-
rack (>= 1.0.0)
|
46
|
-
rack-test (>= 0.5.4)
|
47
|
-
selenium-webdriver (>= 0.0.3)
|
48
|
-
childprocess (0.1.8)
|
49
|
-
ffi (~> 1.0.6)
|
50
|
-
columnize (0.3.2)
|
51
|
-
culerity (0.2.15)
|
52
|
-
diff-lcs (1.1.2)
|
53
|
-
erubis (2.6.6)
|
54
|
-
abstract (>= 1.0.0)
|
55
|
-
factory_girl (1.3.3)
|
56
|
-
ffi (1.0.7)
|
57
|
-
rake (>= 0.8.7)
|
58
|
-
foreigner (0.9.2)
|
59
|
-
forgery (0.3.7)
|
60
|
-
nokogiri (~> 1.4)
|
61
|
-
i18n (0.5.0)
|
62
|
-
json_pure (1.5.1)
|
63
|
-
linecache (0.43)
|
64
|
-
mail (2.2.15)
|
65
|
-
activesupport (>= 2.3.6)
|
66
|
-
i18n (>= 0.4.0)
|
67
|
-
mime-types (~> 1.16)
|
68
|
-
treetop (~> 1.4.8)
|
69
|
-
mime-types (1.16)
|
70
|
-
nokogiri (1.4.4)
|
71
|
-
paperclip (2.3.11)
|
72
|
-
activerecord (>= 2.3.0)
|
73
|
-
activesupport (>= 2.3.2)
|
74
|
-
polyglot (0.3.1)
|
75
|
-
rack (1.2.2)
|
76
|
-
rack-mount (0.6.14)
|
77
|
-
rack (>= 1.0.0)
|
78
|
-
rack-test (0.5.7)
|
79
|
-
rack (>= 1.0)
|
80
|
-
rails (3.0.5)
|
81
|
-
actionmailer (= 3.0.5)
|
82
|
-
actionpack (= 3.0.5)
|
83
|
-
activerecord (= 3.0.5)
|
84
|
-
activeresource (= 3.0.5)
|
85
|
-
activesupport (= 3.0.5)
|
86
|
-
bundler (~> 1.0)
|
87
|
-
railties (= 3.0.5)
|
88
|
-
railties (3.0.5)
|
89
|
-
actionpack (= 3.0.5)
|
90
|
-
activesupport (= 3.0.5)
|
91
|
-
rake (>= 0.8.7)
|
92
|
-
thor (~> 0.14.4)
|
93
|
-
rake (0.8.7)
|
94
|
-
rmagick (2.13.1)
|
95
|
-
rspec (2.5.0)
|
96
|
-
rspec-core (~> 2.5.0)
|
97
|
-
rspec-expectations (~> 2.5.0)
|
98
|
-
rspec-mocks (~> 2.5.0)
|
99
|
-
rspec-core (2.5.1)
|
100
|
-
rspec-expectations (2.5.0)
|
101
|
-
diff-lcs (~> 1.1.2)
|
102
|
-
rspec-mocks (2.5.0)
|
103
|
-
rspec-rails (2.5.0)
|
104
|
-
actionpack (~> 3.0)
|
105
|
-
activesupport (~> 3.0)
|
106
|
-
railties (~> 3.0)
|
107
|
-
rspec (~> 2.5.0)
|
108
|
-
ruby-debug (0.10.4)
|
109
|
-
columnize (>= 0.1)
|
110
|
-
ruby-debug-base (~> 0.10.4.0)
|
111
|
-
ruby-debug-base (0.10.4)
|
112
|
-
linecache (>= 0.3)
|
113
|
-
rubyzip (0.9.4)
|
114
|
-
selenium-webdriver (0.1.4)
|
115
|
-
childprocess (>= 0.1.7)
|
116
|
-
ffi (>= 1.0.7)
|
117
|
-
json_pure
|
118
|
-
rubyzip
|
119
|
-
sqlite3 (1.3.3)
|
120
|
-
sqlite3-ruby (1.3.3)
|
121
|
-
sqlite3 (>= 1.3.3)
|
122
|
-
thor (0.14.6)
|
123
|
-
treetop (1.4.9)
|
124
|
-
polyglot (>= 0.3.1)
|
125
|
-
tzinfo (0.3.26)
|
126
|
-
|
127
|
-
PLATFORMS
|
128
|
-
ruby
|
129
|
-
|
130
|
-
DEPENDENCIES
|
131
|
-
avatars_for_rails!
|
132
|
-
capybara (~> 0.3.9)
|
133
|
-
factory_girl (~> 1.3.2)
|
134
|
-
forgery (~> 0.3.6)
|
135
|
-
rails (>= 3.0.5)
|
136
|
-
rspec-rails (~> 2.5.0)
|
137
|
-
ruby-debug (~> 0.10.3)
|
138
|
-
sqlite3-ruby
|