longbow 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/longbow/commands/shoot.rb +5 -12
- data/lib/longbow/images.rb +10 -24
- data/lib/longbow/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05bd9d17c6b502aea639b84c1ebdece5bb04b9ec
|
4
|
+
data.tar.gz: b402bb6a47291e68c5530e24cf73755845f57d08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fbde0674131935d8aaa3af4a05c5f2dfc4e0cfc21a85bd444a6a1ac381ecf098884a1c22c85e8821d54e9541187985e418e112bc342237c7d70e5bb5f550edf
|
7
|
+
data.tar.gz: 3c246f41f7edc165bb9573e7974c81e370874a35427cb90c64ff350a2eeec0b7da945a75cca191fbf99474755874238ccb04df1813be157c891b1f5ff0846a99
|
data/Gemfile.lock
CHANGED
@@ -24,12 +24,8 @@ command :shoot do |c|
|
|
24
24
|
# Check for .longbow.json
|
25
25
|
@json_path = @directory + '/longbow.json'
|
26
26
|
if !File.exists?(@json_path)
|
27
|
-
|
28
|
-
|
29
|
-
puts
|
30
|
-
puts " Run this command to install the correct files:"
|
31
|
-
puts " longbow install"
|
32
|
-
puts
|
27
|
+
Longbow::red "\n Couldn't find longbow.json at #{@json_path}\n"
|
28
|
+
puts " Run this command to install the correct files:\n longbow install\n"
|
33
29
|
next
|
34
30
|
end
|
35
31
|
|
@@ -48,9 +44,7 @@ command :shoot do |c|
|
|
48
44
|
end
|
49
45
|
|
50
46
|
if @targets.length == 0
|
51
|
-
|
52
|
-
Longbow::red " Couldn't find a target named " + @target_name + " in the .longbow.json file."
|
53
|
-
puts
|
47
|
+
Longbow::red "\n Couldn't find a target named #{@target_name} in the .longbow.json file.\n"
|
54
48
|
next
|
55
49
|
end
|
56
50
|
else
|
@@ -65,8 +59,7 @@ command :shoot do |c|
|
|
65
59
|
launch = t['launch_phone_p_url'] || t['launch_phone_p_path'] || t['launch_phone_l_url'] || t['launch_phone_l_path'] || t['launch_tablet_p_url'] || t['launch_tablet_p_path'] || t['launch_tablet_l_url'] || t['launch_tablet_l_path']
|
66
60
|
Longbow::update_target @directory, t['name'], obj['global_info_keys'], t['info_plist'], icon, launch
|
67
61
|
Longbow::create_images @directory, t, obj
|
68
|
-
Longbow::green
|
69
|
-
puts unless $nolog
|
62
|
+
Longbow::green " Finished: #{t['name']}\n" unless $nolog
|
70
63
|
end
|
71
64
|
end
|
72
|
-
end
|
65
|
+
end
|
data/lib/longbow/images.rb
CHANGED
@@ -14,14 +14,8 @@ module Longbow
|
|
14
14
|
end
|
15
15
|
|
16
16
|
# Get Device Information
|
17
|
-
iPhone =
|
18
|
-
iPad =
|
19
|
-
if obj['devices']
|
20
|
-
obj['devices'].each do |d|
|
21
|
-
iPhone = true if d == 'iPhone'
|
22
|
-
iPad = true if d == 'iPad'
|
23
|
-
end
|
24
|
-
end
|
17
|
+
iPhone = obj['devices'].include? 'iPhone'
|
18
|
+
iPad = obj['devices'].include? 'iPad'
|
25
19
|
|
26
20
|
# Resize Icons
|
27
21
|
resize_icons directory, t, iPhone, iPad
|
@@ -54,22 +48,14 @@ module Longbow
|
|
54
48
|
# Make directory
|
55
49
|
img_dir = make_asset_directory directory, target, '.appiconset/'
|
56
50
|
|
57
|
-
#
|
58
|
-
|
51
|
+
# Resize
|
52
|
+
image_sizes = []
|
53
|
+
image_sizes += ['120x120', '114x114', '80x80', '58x58', '57x57', '29x29'] if iPhone
|
54
|
+
image_sizes += ['152x152', '144x144', '100x100', '80x80', '76x76', '72x72', '58x58', '50x50', '40x40', '29x29'] if iPad
|
55
|
+
image_sizes.uniq.each do |size|
|
59
56
|
image = MiniMagick::Image.open(img_path)
|
60
|
-
|
61
|
-
|
62
|
-
resize_image_to_directory img_dir, image, size, 'icon'
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# iPad
|
67
|
-
if iPad
|
68
|
-
image = MiniMagick::Image.open(img_path)
|
69
|
-
return false unless image
|
70
|
-
['152x152', '144x144', '100x100', '80x80', '76x76', '72x72', '58x58', '50x50', '40x40', '29x29'].each do |size|
|
71
|
-
resize_image_to_directory img_dir, image, size, 'icon'
|
72
|
-
end
|
57
|
+
next unless image
|
58
|
+
resize_image_to_directory img_dir, image, size, 'icon'
|
73
59
|
end
|
74
60
|
|
75
61
|
Longbow::green (' - Created Icon images for ' + target) unless $nolog
|
@@ -409,4 +395,4 @@ module Longbow
|
|
409
395
|
end
|
410
396
|
|
411
397
|
|
412
|
-
end
|
398
|
+
end
|
data/lib/longbow/version.rb
CHANGED