crimagify 0.0.2 → 0.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +26 -2
- data/app/views/crimagify/crop_partials/_img_final.html.erb +3 -1
- data/lib/crimagify/version.rb +1 -1
- data/lib/generators/crimagify/install/install_generator.rb +1 -1
- data/lib/generators/crimagify/install/templates/crimagify_settings.yml +1 -0
- data/test/dummy/config/crimagify_settings.yml +1 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -44,13 +44,37 @@ Add to application.js:<tt>//= require crimagify/application</tt>
|
|
44
44
|
|
45
45
|
Add to application.css:<tt>*= require crimagify/application</tt>
|
46
46
|
|
47
|
+
Edit the file generated for the gem: config/crimagify_versions.yml, with the specific format mantaining the same ratio for all versions in each blocks, adding models that use images:
|
48
|
+
|
49
|
+
|
50
|
+
User:
|
51
|
+
imgA:
|
52
|
+
user:
|
53
|
+
width: 100
|
54
|
+
height: 100
|
55
|
+
big:
|
56
|
+
width: 500
|
57
|
+
height: 500
|
58
|
+
imgB:
|
59
|
+
big:
|
60
|
+
width: 800
|
61
|
+
height: 500
|
62
|
+
small:
|
63
|
+
width: 400
|
64
|
+
height: 250
|
65
|
+
Product:
|
66
|
+
imgA:
|
67
|
+
big:
|
68
|
+
width: 600
|
69
|
+
height: 300
|
70
|
+
|
47
71
|
Add to your form view:
|
48
72
|
|
49
73
|
|
50
74
|
<%= form_for(@object) do |f| %>
|
51
75
|
...
|
52
76
|
<%= images_id(@object) %>
|
53
|
-
<%= image_cropper(@object, { image_name: "imgA", ratio: :big}) %>
|
54
|
-
<%= image_cropper(@object, { image_name: "imgB", ratio: :small}) %>
|
77
|
+
<%= image_cropper(@object, { image_name: "imgA", ratio: :big}) %> #The attributes "imgA" and :big or :small are defined
|
78
|
+
<%= image_cropper(@object, { image_name: "imgB", ratio: :small}) %> #into file config/crimagify_versions.yml generated for the gem
|
55
79
|
...
|
56
80
|
<% end %>
|
@@ -1,4 +1,6 @@
|
|
1
1
|
<%
|
2
|
+
preview = ENV['PREVIEW_IMAGE_CROPPED']
|
3
|
+
preview = preview.to_sym
|
2
4
|
image_name = @img[7]
|
3
5
|
if @img.first == 0
|
4
6
|
image = @img_new
|
@@ -8,4 +10,4 @@
|
|
8
10
|
end
|
9
11
|
%>
|
10
12
|
<%= image_name %><br>
|
11
|
-
<%= image_tag image.image_temporal_url(
|
13
|
+
<%= image_tag image.image_temporal_url(preview) %>
|
data/lib/crimagify/version.rb
CHANGED
@@ -6,7 +6,7 @@ module Crimagify
|
|
6
6
|
|
7
7
|
def copy_config_file
|
8
8
|
copy_file "crimagify_versions.yml", "config/crimagify_versions.yml"
|
9
|
-
copy_file "crimagify_settings.yml", "config/
|
9
|
+
copy_file "crimagify_settings.yml", "config/crimagify_settings.yml"
|
10
10
|
end
|
11
11
|
|
12
12
|
def copy_migrations
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crimagify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2
|
4
|
+
version: 0.0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|