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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c31c3efba197d6e75b171793488febecb26807d
4
- data.tar.gz: a0ab54ab090f98198997347867ac66e60fc71fc5
3
+ metadata.gz: b2d4ada9203e20a3ef73173397c696dd9c02b6ae
4
+ data.tar.gz: 3bedd049af7d8a93882d9be3572f8f7cd3e49ca9
5
5
  SHA512:
6
- metadata.gz: 378b396e21d81769b3f141797deaa00f048848b1165ba7a5156706b1cfa20353a153056248218e022ea7ac5b220833c461b2b52359c7a2fd38e2ee49960324f3
7
- data.tar.gz: 992f77a63add2a20e6ece005da0583b5d72403afa7180c10527e1402302547b41632e963958b1de7d015bb49172e371b851c1d86ea20e73d49bfd0909e1c63d1
6
+ metadata.gz: bd93e8e95cbb2ee94843ce2ed30377a45e3a79a52794511639dd8752b2e840e0100f0b6509b2c7a7862200cb6f9f928c7a894648d34f20ff7decf4752d9925a6
7
+ data.tar.gz: 80197edcae90dfd91e4eeacebeaaf1d1e4c6d876aae0a7f9854a86487d6531a2388b619b2fade6e322322bfcbb0ceb4d9adad9c08629e470a339e666a5250c2b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- longbow (0.1.3)
4
+ longbow (0.1.5)
5
5
  bundler (~> 1.3)
6
6
  commander (~> 4.1)
7
7
  dotenv (~> 0.7)
@@ -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 .longbow.json file.\n"
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
@@ -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 = MiniMagick::Image.open(img_path)
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 = MiniMagick::Image.open(img_path)
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
- w = image[:width]
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
 
@@ -2,7 +2,7 @@ $:.push File.expand_path('../', __FILE__)
2
2
  require 'colors'
3
3
 
4
4
  module Longbow
5
- VERSION = '0.1.4'
5
+ VERSION = '0.1.5'
6
6
 
7
7
  def self.check_for_newer_version
8
8
  unless Gem.latest_version_for('longbow').to_s == VERSION
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
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-23 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler