mustachio 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -10,6 +10,8 @@ gem 'face', '0.0.4'
10
10
  gem 'imagesize', '~> 0.1', :require => 'image_size'
11
11
 
12
12
  group :development do
13
+ # rake 0.9.0 doesn't work with Jeweler 1.6.0
14
+ gem 'rake', '~> 0.8.7'
13
15
  gem 'jeweler', '~> 1.6'
14
16
  end
15
17
 
data/Gemfile.lock CHANGED
@@ -37,7 +37,7 @@ GEM
37
37
  rack (1.3.0)
38
38
  rack-test (0.6.0)
39
39
  rack (>= 1.0)
40
- rake (0.9.0)
40
+ rake (0.8.7)
41
41
  rest-client (1.6.1)
42
42
  mime-types (>= 1.16)
43
43
  rspec (2.6.0)
@@ -85,6 +85,7 @@ DEPENDENCIES
85
85
  magickly (~> 1.1)
86
86
  newrelic_rpm
87
87
  rack-test
88
+ rake (~> 0.8.7)
88
89
  rspec (~> 2.5)
89
90
  ruby-debug
90
91
  ruby-debug19
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/mustachio.rb CHANGED
@@ -12,19 +12,23 @@ Magickly.dragonfly.configure do |c|
12
12
  c.analyser.add :face_data_as_px do |temp_object|
13
13
  data = Mustachio.face_client.faces_detect(:file => temp_object.file, :attributes => 'none')['photos'].first # TODO use #face_data
14
14
 
15
- data['tags'].map! do |face|
16
- Mustachio::FACE_POS_ATTRS.each do |pos_attr|
17
- if face[pos_attr].nil?
18
- puts "WARN: missing position attribute '#{pos_attr}'"
19
- else
15
+ new_tags = []
16
+ data['tags'].map do |face|
17
+ has_all_attrs = Mustachio::FACE_POS_ATTRS.all? do |pos_attr|
18
+ if face[pos_attr]
20
19
  face[pos_attr]['x'] *= (data['width'] / 100.0)
21
20
  face[pos_attr]['y'] *= (data['height'] / 100.0)
21
+ true
22
+ else
23
+ # face attribute missing
24
+ false
22
25
  end
23
26
  end
24
27
 
25
- face
28
+ new_tags << face if has_all_attrs
26
29
  end
27
30
 
31
+ data['tags'] = new_tags
28
32
  data
29
33
  end
30
34
 
@@ -102,7 +106,9 @@ module Mustachio
102
106
  stache['mouth_overlap'] ||= 0
103
107
 
104
108
  stache['file_path'] = File.expand_path(File.join(File.dirname(__FILE__), '..', 'public', 'images', 'staches', stache['filename']))
105
- stache['width'], stache['height'] = ImageSize.new(File.new(stache['file_path'])).get_size
109
+ unless stache['width'] && stache['height']
110
+ stache['width'], stache['height'] = ImageSize.new(File.new(stache['file_path'])).get_size
111
+ end
106
112
  stache
107
113
  end
108
114
  @@mustaches = staches
data/mustachio.gemspec CHANGED
@@ -5,10 +5,10 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mustachio}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Aidan Feldman"]
11
+ s.authors = [%q{Aidan Feldman}]
12
12
  s.date = %q{2011-05-26}
13
13
  s.description = %q{Adds a 'mustachify' shortcut to magickly.}
14
14
  s.email = %q{aidan.feldman@gmail.com}
@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
36
36
  "public/images/guy_hecker.jpeg",
37
37
  "public/images/staches/colonel_mustard.png",
38
38
  "public/images/staches/mustache_03.png",
39
+ "public/images/staches/mustache_03.svg",
39
40
  "public/images/staches/mustache_07.png",
40
41
  "spec/fixtures/vcr_cassettes/big_obama.yml",
41
42
  "spec/fixtures/vcr_cassettes/dubya.yml",
@@ -52,9 +53,9 @@ Gem::Specification.new do |s|
52
53
  "views/test.haml"
53
54
  ]
54
55
  s.homepage = %q{http://github.com/afeld/mustachio}
55
- s.licenses = ["MIT"]
56
- s.require_paths = ["lib"]
57
- s.rubygems_version = %q{1.6.2}
56
+ s.licenses = [%q{MIT}]
57
+ s.require_paths = [%q{lib}]
58
+ s.rubygems_version = %q{1.8.4}
58
59
  s.summary = %q{automatic mustachifying of any image}
59
60
 
60
61
  if s.respond_to? :specification_version then
@@ -68,6 +69,7 @@ Gem::Specification.new do |s|
68
69
  s.add_runtime_dependency(%q<haml>, [">= 0"])
69
70
  s.add_runtime_dependency(%q<face>, ["= 0.0.4"])
70
71
  s.add_runtime_dependency(%q<imagesize>, ["~> 0.1"])
72
+ s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
71
73
  s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
72
74
  s.add_development_dependency(%q<rack-test>, [">= 0"])
73
75
  s.add_development_dependency(%q<rspec>, ["~> 2.5"])
@@ -83,6 +85,7 @@ Gem::Specification.new do |s|
83
85
  s.add_dependency(%q<haml>, [">= 0"])
84
86
  s.add_dependency(%q<face>, ["= 0.0.4"])
85
87
  s.add_dependency(%q<imagesize>, ["~> 0.1"])
88
+ s.add_dependency(%q<rake>, ["~> 0.8.7"])
86
89
  s.add_dependency(%q<jeweler>, ["~> 1.6"])
87
90
  s.add_dependency(%q<rack-test>, [">= 0"])
88
91
  s.add_dependency(%q<rspec>, ["~> 2.5"])
@@ -99,6 +102,7 @@ Gem::Specification.new do |s|
99
102
  s.add_dependency(%q<haml>, [">= 0"])
100
103
  s.add_dependency(%q<face>, ["= 0.0.4"])
101
104
  s.add_dependency(%q<imagesize>, ["~> 0.1"])
105
+ s.add_dependency(%q<rake>, ["~> 0.8.7"])
102
106
  s.add_dependency(%q<jeweler>, ["~> 1.6"])
103
107
  s.add_dependency(%q<rack-test>, [">= 0"])
104
108
  s.add_dependency(%q<rspec>, ["~> 2.5"])
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="489.932px" height="103.854px" viewBox="0 0 489.932 103.854" enable-background="new 0 0 489.932 103.854"
6
+ xml:space="preserve">
7
+ <path stroke="#000000" d="M294.864,76.623C410.3,166.247,489.466,1.776,489.466,1.776S463.27,69.139,380.938,35.457
8
+ c-82.332-33.681-92.312-22.142-119.287-7.017c0,0-3.588,2.651-14.191,9.198c0,0-9.98-7.484-18.712-11.227
9
+ c-29.389-12.598-37.423-26.196-119.755,7.484C26.662,67.578,0.466,0.216,0.466,0.216s77.688,162.531,194.602,74.847
10
+ C195.067,75.062,244.655,37.641,294.864,76.623z"/>
11
+ </svg>
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mustachio
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 21
4
5
  prerelease:
5
- version: 0.2.0
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 1
10
+ version: 0.2.1
6
11
  platform: ruby
7
12
  authors:
8
13
  - Aidan Feldman
@@ -10,163 +15,234 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-05-26 00:00:00 -04:00
14
- default_executable:
18
+ date: 2011-05-26 00:00:00 Z
15
19
  dependencies:
16
20
  - !ruby/object:Gem::Dependency
17
- name: sinatra
21
+ type: :runtime
18
22
  requirement: &id001 !ruby/object:Gem::Requirement
19
23
  none: false
20
24
  requirements:
21
25
  - - ~>
22
26
  - !ruby/object:Gem::Version
27
+ hash: 25
28
+ segments:
29
+ - 1
30
+ - 2
31
+ - 3
23
32
  version: 1.2.3
24
- type: :runtime
25
33
  prerelease: false
26
34
  version_requirements: *id001
35
+ name: sinatra
27
36
  - !ruby/object:Gem::Dependency
28
- name: dragonfly
37
+ type: :runtime
29
38
  requirement: &id002 !ruby/object:Gem::Requirement
30
39
  none: false
31
40
  requirements:
32
41
  - - ~>
33
42
  - !ruby/object:Gem::Version
43
+ hash: 59
44
+ segments:
45
+ - 0
46
+ - 9
47
+ - 0
34
48
  version: 0.9.0
35
- type: :runtime
36
49
  prerelease: false
37
50
  version_requirements: *id002
51
+ name: dragonfly
38
52
  - !ruby/object:Gem::Dependency
39
- name: magickly
53
+ type: :runtime
40
54
  requirement: &id003 !ruby/object:Gem::Requirement
41
55
  none: false
42
56
  requirements:
43
57
  - - ~>
44
58
  - !ruby/object:Gem::Version
59
+ hash: 13
60
+ segments:
61
+ - 1
62
+ - 1
45
63
  version: "1.1"
46
- type: :runtime
47
64
  prerelease: false
48
65
  version_requirements: *id003
66
+ name: magickly
49
67
  - !ruby/object:Gem::Dependency
50
- name: addressable
68
+ type: :runtime
51
69
  requirement: &id004 !ruby/object:Gem::Requirement
52
70
  none: false
53
71
  requirements:
54
72
  - - ~>
55
73
  - !ruby/object:Gem::Version
74
+ hash: 15
75
+ segments:
76
+ - 2
77
+ - 2
78
+ - 4
56
79
  version: 2.2.4
57
- type: :runtime
58
80
  prerelease: false
59
81
  version_requirements: *id004
82
+ name: addressable
60
83
  - !ruby/object:Gem::Dependency
61
- name: haml
84
+ type: :runtime
62
85
  requirement: &id005 !ruby/object:Gem::Requirement
63
86
  none: false
64
87
  requirements:
65
88
  - - ">="
66
89
  - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 0
67
93
  version: "0"
68
- type: :runtime
69
94
  prerelease: false
70
95
  version_requirements: *id005
96
+ name: haml
71
97
  - !ruby/object:Gem::Dependency
72
- name: face
98
+ type: :runtime
73
99
  requirement: &id006 !ruby/object:Gem::Requirement
74
100
  none: false
75
101
  requirements:
76
102
  - - "="
77
103
  - !ruby/object:Gem::Version
104
+ hash: 23
105
+ segments:
106
+ - 0
107
+ - 0
108
+ - 4
78
109
  version: 0.0.4
79
- type: :runtime
80
110
  prerelease: false
81
111
  version_requirements: *id006
112
+ name: face
82
113
  - !ruby/object:Gem::Dependency
83
- name: imagesize
114
+ type: :runtime
84
115
  requirement: &id007 !ruby/object:Gem::Requirement
85
116
  none: false
86
117
  requirements:
87
118
  - - ~>
88
119
  - !ruby/object:Gem::Version
120
+ hash: 9
121
+ segments:
122
+ - 0
123
+ - 1
89
124
  version: "0.1"
90
- type: :runtime
91
125
  prerelease: false
92
126
  version_requirements: *id007
127
+ name: imagesize
93
128
  - !ruby/object:Gem::Dependency
94
- name: jeweler
129
+ type: :development
95
130
  requirement: &id008 !ruby/object:Gem::Requirement
96
131
  none: false
97
132
  requirements:
98
133
  - - ~>
99
134
  - !ruby/object:Gem::Version
100
- version: "1.6"
101
- type: :development
135
+ hash: 49
136
+ segments:
137
+ - 0
138
+ - 8
139
+ - 7
140
+ version: 0.8.7
102
141
  prerelease: false
103
142
  version_requirements: *id008
143
+ name: rake
104
144
  - !ruby/object:Gem::Dependency
105
- name: rack-test
145
+ type: :development
106
146
  requirement: &id009 !ruby/object:Gem::Requirement
107
147
  none: false
108
148
  requirements:
109
- - - ">="
149
+ - - ~>
110
150
  - !ruby/object:Gem::Version
111
- version: "0"
112
- type: :development
151
+ hash: 3
152
+ segments:
153
+ - 1
154
+ - 6
155
+ version: "1.6"
113
156
  prerelease: false
114
157
  version_requirements: *id009
158
+ name: jeweler
115
159
  - !ruby/object:Gem::Dependency
116
- name: rspec
160
+ type: :development
117
161
  requirement: &id010 !ruby/object:Gem::Requirement
118
162
  none: false
119
163
  requirements:
120
- - - ~>
164
+ - - ">="
121
165
  - !ruby/object:Gem::Version
122
- version: "2.5"
123
- type: :development
166
+ hash: 3
167
+ segments:
168
+ - 0
169
+ version: "0"
124
170
  prerelease: false
125
171
  version_requirements: *id010
172
+ name: rack-test
126
173
  - !ruby/object:Gem::Dependency
127
- name: webmock
174
+ type: :development
128
175
  requirement: &id011 !ruby/object:Gem::Requirement
129
176
  none: false
130
177
  requirements:
131
178
  - - ~>
132
179
  - !ruby/object:Gem::Version
133
- version: "1.6"
134
- type: :development
180
+ hash: 9
181
+ segments:
182
+ - 2
183
+ - 5
184
+ version: "2.5"
135
185
  prerelease: false
136
186
  version_requirements: *id011
187
+ name: rspec
137
188
  - !ruby/object:Gem::Dependency
138
- name: vcr
189
+ type: :development
139
190
  requirement: &id012 !ruby/object:Gem::Requirement
140
191
  none: false
141
192
  requirements:
142
193
  - - ~>
143
194
  - !ruby/object:Gem::Version
144
- version: "1.9"
145
- type: :development
195
+ hash: 3
196
+ segments:
197
+ - 1
198
+ - 6
199
+ version: "1.6"
146
200
  prerelease: false
147
201
  version_requirements: *id012
202
+ name: webmock
148
203
  - !ruby/object:Gem::Dependency
149
- name: ruby-debug19
204
+ type: :development
150
205
  requirement: &id013 !ruby/object:Gem::Requirement
151
206
  none: false
152
207
  requirements:
153
- - - ">="
208
+ - - ~>
154
209
  - !ruby/object:Gem::Version
155
- version: "0"
156
- type: :development
210
+ hash: 29
211
+ segments:
212
+ - 1
213
+ - 9
214
+ version: "1.9"
157
215
  prerelease: false
158
216
  version_requirements: *id013
217
+ name: vcr
159
218
  - !ruby/object:Gem::Dependency
160
- name: ruby-debug
219
+ type: :development
161
220
  requirement: &id014 !ruby/object:Gem::Requirement
162
221
  none: false
163
222
  requirements:
164
223
  - - ">="
165
224
  - !ruby/object:Gem::Version
225
+ hash: 3
226
+ segments:
227
+ - 0
166
228
  version: "0"
167
- type: :development
168
229
  prerelease: false
169
230
  version_requirements: *id014
231
+ name: ruby-debug19
232
+ - !ruby/object:Gem::Dependency
233
+ type: :development
234
+ requirement: &id015 !ruby/object:Gem::Requirement
235
+ none: false
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ hash: 3
240
+ segments:
241
+ - 0
242
+ version: "0"
243
+ prerelease: false
244
+ version_requirements: *id015
245
+ name: ruby-debug
170
246
  description: Adds a 'mustachify' shortcut to magickly.
171
247
  email: aidan.feldman@gmail.com
172
248
  executables: []
@@ -196,6 +272,7 @@ files:
196
272
  - public/images/guy_hecker.jpeg
197
273
  - public/images/staches/colonel_mustard.png
198
274
  - public/images/staches/mustache_03.png
275
+ - public/images/staches/mustache_03.svg
199
276
  - public/images/staches/mustache_07.png
200
277
  - spec/fixtures/vcr_cassettes/big_obama.yml
201
278
  - spec/fixtures/vcr_cassettes/dubya.yml
@@ -210,7 +287,6 @@ files:
210
287
  - views/gallery.haml
211
288
  - views/index.haml
212
289
  - views/test.haml
213
- has_rdoc: true
214
290
  homepage: http://github.com/afeld/mustachio
215
291
  licenses:
216
292
  - MIT
@@ -224,7 +300,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
300
  requirements:
225
301
  - - ">="
226
302
  - !ruby/object:Gem::Version
227
- hash: 4287363607952724271
303
+ hash: 3
228
304
  segments:
229
305
  - 0
230
306
  version: "0"
@@ -233,11 +309,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
309
  requirements:
234
310
  - - ">="
235
311
  - !ruby/object:Gem::Version
312
+ hash: 3
313
+ segments:
314
+ - 0
236
315
  version: "0"
237
316
  requirements: []
238
317
 
239
318
  rubyforge_project:
240
- rubygems_version: 1.6.2
319
+ rubygems_version: 1.8.4
241
320
  signing_key:
242
321
  specification_version: 3
243
322
  summary: automatic mustachifying of any image