attribute_imagifiable 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 186d03c066bfcc03c8b229825a5286b43076707b
4
+ data.tar.gz: 8f23a64843109bc610147d0fdb819848631a53df
5
+ SHA512:
6
+ metadata.gz: cb9ab5d948aed40fb670be8e622f4b7d44427c83be3a9694abc16d05b02ca93874e939119b06979e0ce9048c518e2abc8e54f18dbc800c47220405bdfdbe9906
7
+ data.tar.gz: 5eea7bec732e4643c1f64d4ab5ab330b5010c90088a8259514a4a35c192d8e6ac77f124575435686b1f366a0b778a7f15239b70faf3df21877386426200b4445
data/README.md CHANGED
@@ -19,7 +19,15 @@ Or install it yourself as:
19
19
 
20
20
  ## Usage
21
21
 
22
- include and use in your Models:
22
+ 1. Generate Paperclip attachments
23
+
24
+ ```
25
+ rails g paperclip person email_image
26
+ rails g paperclip person telephone_image
27
+ rake db:migrate
28
+ ```
29
+
30
+ 2. Include and use in your Models:
23
31
 
24
32
  ```ruby
25
33
 
@@ -29,14 +37,15 @@ class Person < ActiveRecord::Base
29
37
  has_attached_file :telephone_image,
30
38
  styles: {small: "150x105>"},
31
39
  url: '/system/:class/:attachment/:id/:style/:filename'
32
- has_attached_file :mail_image,
40
+ has_attached_file :email_image,
33
41
  styles: {small: "150x105>"},
34
42
  url: '/system/:class/:attachment/:id/:style/:filename'
35
43
  include AttributeImagifiable
36
- attribute_imagifiable :telefon, as: :telephone_image
44
+ attribute_imagifiable :telephone, as: :telephone_image
37
45
  attribute_imagifiable :email, as: :mail_image
38
46
 
39
47
  ```
40
- This will automatically generate an image for the "telefon" and "email" attribute before each update, if that attribute changed.
48
+ This will automatically generate an image for the "telephone" and "email" attribute before each update, if that attribute changed.
49
+
41
50
 
42
- IMPORTANT: Use and generate paperclip attachments and attributes before
51
+ attribute_imagifiable takes an optional ``:font`` parameter with path to a system ttf font. Default is "/usr/share/fonts/truetype/msttcorefonts/Verdana.ttf".
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "attribute_imagifiable"
7
- gem.version = "0.0.7"
7
+ gem.version = "0.0.8"
8
8
  gem.authors = ["Stefan Wienert", "Akos Toth"]
9
9
  gem.email = ["stefan.wienert@pludoni.de"]
10
10
  gem.description = %q{Using paperclip to generate images from sensible attributes like e-mails and telephone numbers, in order to reduce crawler's success}
@@ -15,4 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
16
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
17
  gem.require_paths = ["lib"]
18
+ gem.add_dependency "paperclip"
18
19
  end
@@ -3,7 +3,7 @@ module AttributeImagifiable
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- after_validation :generate_image
6
+ before_save :generate_image
7
7
  end
8
8
 
9
9
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attribute_imagifiable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Stefan Wienert
@@ -10,8 +9,22 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-10-09 00:00:00.000000000 Z
14
- dependencies: []
12
+ date: 2013-07-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: paperclip
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
15
28
  description: Using paperclip to generate images from sensible attributes like e-mails
16
29
  and telephone numbers, in order to reduce crawler's success
17
30
  email:
@@ -29,28 +42,26 @@ files:
29
42
  - lib/attribute_imagifiable.rb
30
43
  homepage: https://github.com/zealot128/attribute_imagifiable
31
44
  licenses: []
45
+ metadata: {}
32
46
  post_install_message:
33
47
  rdoc_options: []
34
48
  require_paths:
35
49
  - lib
36
50
  required_ruby_version: !ruby/object:Gem::Requirement
37
- none: false
38
51
  requirements:
39
- - - ! '>='
52
+ - - '>='
40
53
  - !ruby/object:Gem::Version
41
54
  version: '0'
42
55
  required_rubygems_version: !ruby/object:Gem::Requirement
43
- none: false
44
56
  requirements:
45
- - - ! '>='
57
+ - - '>='
46
58
  - !ruby/object:Gem::Version
47
59
  version: '0'
48
60
  requirements: []
49
61
  rubyforge_project:
50
- rubygems_version: 1.8.24
62
+ rubygems_version: 2.0.3
51
63
  signing_key:
52
- specification_version: 3
64
+ specification_version: 4
53
65
  summary: Using paperclip to generate images from sensible attributes like e-mails
54
66
  and telephone numbers, in order to reduce crawler's success
55
67
  test_files: []
56
- has_rdoc: