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 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(:user) %>
13
+ <%= image_tag image.image_temporal_url(preview) %>
@@ -1,3 +1,3 @@
1
1
  module Crimagify
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.2.1"
3
3
  end
@@ -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/crimagify_sestings.yml"
9
+ copy_file "crimagify_settings.yml", "config/crimagify_settings.yml"
10
10
  end
11
11
 
12
12
  def copy_migrations
@@ -1,4 +1,5 @@
1
1
  #THis file is for configurate the env_variables of the functionability of the gem
2
+ #PREVIEW_IMAGE_CROPPED: user
2
3
  # MAX_SIZE: 0.5
3
4
  # MAX_WIDTH_BOX_CROPPER: 200
4
5
  # MAX_HEIGHT_BOX_CROPPER: 200
@@ -1,4 +1,5 @@
1
1
  #THis file is for configurate the env_variables of the functionability of the gem
2
+ PREVIEW_IMAGE_CROPPED: user
2
3
  MAX_SIZE: 0.5
3
4
  # MAX_WIDTH_BOX_CROPPER: 200
4
5
  # MAX_HEIGHT_BOX_CROPPER: 200
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-25 00:00:00.000000000 Z
12
+ date: 2013-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails