avatars_for_rails 0.1.2 → 0.1.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.
- data/app/models/avatar.rb +5 -1
- data/app/views/avatars/_precrop.html.erb +2 -2
- data/avatars_for_rails.gemspec +1 -1
- data/lib/avatars_for_rails.rb +2 -1
- metadata +3 -3
data/app/models/avatar.rb
CHANGED
@@ -57,11 +57,15 @@ class Avatar < ActiveRecord::Base
|
|
57
57
|
|
58
58
|
#Returns the avatars_for_rails temp directory.
|
59
59
|
def self.images_tmp_path
|
60
|
-
tmp_path = File.join(Rails.root, AvatarsForRails.tmp_path)
|
60
|
+
tmp_path = File.join(Rails.root, 'public', AvatarsForRails.tmp_path)
|
61
61
|
FileUtils.mkdir_p(tmp_path)
|
62
62
|
tmp_path
|
63
63
|
end
|
64
64
|
|
65
|
+
def self.image_tmp_path(tmp_image)
|
66
|
+
File.join '/', AvatarsForRails.tmp_path, tmp_image
|
67
|
+
end
|
68
|
+
|
65
69
|
#This method copies a file to the avatars_for_rails temp directory.
|
66
70
|
def self.copy_to_temp_file(path)
|
67
71
|
FileUtils.cp(path,Avatar.images_tmp_path)
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= t('avatar.preview') %>
|
12
12
|
</div>
|
13
13
|
<div id="precropPrevImg" class="logo">
|
14
|
-
<%= image_tag
|
14
|
+
<%= image_tag Avatar.image_tmp_path(my_file_name) ,:id=>"preview" %>
|
15
15
|
</div>
|
16
16
|
</div>
|
17
17
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</div>
|
21
21
|
|
22
22
|
<div id="precropDiv" class = "block title content">
|
23
|
-
<%= image_tag
|
23
|
+
<%= image_tag Avatar.image_tmp_path(my_file_name) ,:id=>"cropImage" %>
|
24
24
|
</div>
|
25
25
|
</div>
|
26
26
|
|
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.1.
|
5
|
+
s.version = "0.1.3"
|
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. Adapted to rails 3.1.0"
|
data/lib/avatars_for_rails.rb
CHANGED
@@ -10,8 +10,9 @@ module AvatarsForRails
|
|
10
10
|
mattr_accessor :current_avatarable_object
|
11
11
|
mattr_accessor :avatarable_filters
|
12
12
|
mattr_accessor :avatarable_styles
|
13
|
+
# The tmp path inside public/
|
13
14
|
mattr_accessor :tmp_path
|
14
|
-
@@tmp_path = File.join('
|
15
|
+
@@tmp_path = File.join('images', 'tmp')
|
15
16
|
|
16
17
|
class << self
|
17
18
|
def setup
|
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: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jaime Castro Montero
|