longbow 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/longbow/commands/shoot.rb +1 -1
- data/lib/longbow/images.rb +6 -15
- data/lib/longbow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2d4ada9203e20a3ef73173397c696dd9c02b6ae
|
4
|
+
data.tar.gz: 3bedd049af7d8a93882d9be3572f8f7cd3e49ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd93e8e95cbb2ee94843ce2ed30377a45e3a79a52794511639dd8752b2e840e0100f0b6509b2c7a7862200cb6f9f928c7a894648d34f20ff7decf4752d9925a6
|
7
|
+
data.tar.gz: 80197edcae90dfd91e4eeacebeaaf1d1e4c6d876aae0a7f9854a86487d6531a2388b619b2fade6e322322bfcbb0ceb4d9adad9c08629e470a339e666a5250c2b
|
data/Gemfile.lock
CHANGED
@@ -45,7 +45,7 @@ command :shoot do |c|
|
|
45
45
|
end
|
46
46
|
|
47
47
|
if @targets.length == 0
|
48
|
-
Longbow::red "\n Couldn't find a target named #{@target_name} in the
|
48
|
+
Longbow::red "\n Couldn't find a target named #{@target_name} in the longbow.json file.\n"
|
49
49
|
next
|
50
50
|
end
|
51
51
|
else
|
data/lib/longbow/images.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
$:.push File.expand_path('../', __FILE__)
|
2
|
-
require 'mini_magick'
|
2
|
+
# require 'mini_magick'
|
3
|
+
require 'RMagick'
|
4
|
+
include Magick
|
3
5
|
require 'colors'
|
4
6
|
require 'xcodeproj'
|
5
7
|
require 'open-uri'
|
@@ -53,7 +55,7 @@ module Longbow
|
|
53
55
|
image_sizes += ['120x120', '114x114', '80x80', '58x58', '57x57', '29x29'] if iPhone
|
54
56
|
image_sizes += ['152x152', '144x144', '100x100', '80x80', '76x76', '72x72', '58x58', '50x50', '40x40', '29x29'] if iPad
|
55
57
|
image_sizes.uniq.each do |size|
|
56
|
-
image =
|
58
|
+
image = Image.read(img_path).first
|
57
59
|
next unless image
|
58
60
|
resize_image_to_directory img_dir, image, size, 'icon'
|
59
61
|
end
|
@@ -94,7 +96,7 @@ module Longbow
|
|
94
96
|
|
95
97
|
# Resize Images
|
96
98
|
sizes.each do |size|
|
97
|
-
image =
|
99
|
+
image = Image.read(img_path).first
|
98
100
|
return false unless image
|
99
101
|
resize_image_to_directory img_dir, image, size, key + '_'
|
100
102
|
end
|
@@ -110,18 +112,7 @@ module Longbow
|
|
110
112
|
sizes = size.split('x')
|
111
113
|
new_w = Integer(sizes[0])
|
112
114
|
new_h = Integer(sizes[1])
|
113
|
-
|
114
|
-
h = image[:height]
|
115
|
-
if w < h
|
116
|
-
m = new_w.to_f/w
|
117
|
-
new_size = new_w.to_s + 'x' + (h*m).to_i.to_s
|
118
|
-
else
|
119
|
-
m = new_h.to_f/h
|
120
|
-
new_size = (w*m).to_i.to_s + 'x' + new_h.to_s
|
121
|
-
end
|
122
|
-
|
123
|
-
image.resize new_size
|
124
|
-
image.crop size + '+0+0' unless new_size == size
|
115
|
+
image.resize_to_fill! new_w, new_h
|
125
116
|
image.write directory + '/' + tag + size + '.png'
|
126
117
|
end
|
127
118
|
|
data/lib/longbow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: longbow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Intermark Interactive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|