high_five 0.3.14 → 0.3.15

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: 268b866e15618cbd95e2eba2653172044070d506
4
- data.tar.gz: a2a2627530532f1744cd23b2ad822917fe6e25d6
3
+ metadata.gz: ce120807357b8c42d5ceea9c97a63113ba738bab
4
+ data.tar.gz: 809fe86d85b8da73e3a169a58eca923b438d2d54
5
5
  SHA512:
6
- metadata.gz: 2d6763ec68dcbff7b02f65f84ab463a19f24832e559d228f76b2e09a77203674ed96cbfb35f6daf25cf645692d2999f7f52f6568375a72a4122dfacdc6de2623
7
- data.tar.gz: c035de8ba3f935ff3c67fcb10140b151c6330e68f6feb53d9aad7d598195cc36994424c9fe929ae2f0eacd2da1319fdd5c66cf5774d6c69726db6cbe6cdcb963
6
+ metadata.gz: 35d774449fd23bb9427965a7642192e50c9868fed24b9351fbc55c0ef0600c83f96538654766f025b48c269ed97d2a89124a2a41633e0885ecc87d7a91a4ed0d
7
+ data.tar.gz: 5ff881e17bdf6010174fc0d4f0b937b86537980109ce11abbb9f49db3a6439c880e8b9fb71e53c88aa79aaedf6b54f3f2b958d4f012f7bd2d423b76eddfc101e
@@ -40,20 +40,22 @@ module HighFive
40
40
  mdpi: 48,
41
41
  hdpi: 72,
42
42
  xhdpi: 96,
43
+ xxhdpi: 144,
44
+ xxxhdpi: 192,
43
45
  drawable: 512
44
46
  }
45
47
  end
46
48
 
47
- def parse_resolution(dir)
48
- dir.gsub(/.*\//, '').gsub('drawable-', '').to_sym
49
+ def parse_resolution(dir, prefix="drawable")
50
+ dir.gsub(/.*\//, '').gsub("#{prefix}-", '').to_sym
49
51
  end
50
52
 
51
53
  # drawable_dir: The directory containing drawable/, drawable-hdpi, drawable-mdpi, etc
52
54
  # Returns directories which are present & whose resolutions are supported
53
- def valid_directories(drawable_dir)
55
+ def valid_directories(drawable_dir, prefix="drawable")
54
56
  valid_dirs = []
55
- Dir.glob(File.join drawable_dir, "drawable*") do |dir|
56
- res = parse_resolution(dir)
57
+ Dir.glob(File.join drawable_dir, "#{prefix}*") do |dir|
58
+ res = parse_resolution(dir, prefix)
57
59
  size = res_map[res]
58
60
  valid_dirs << dir unless size.nil?
59
61
  end
@@ -60,10 +60,15 @@ module HighFive
60
60
 
61
61
  manifest = File.read(android_manifest_path)
62
62
  puts "Using android manifest: #{android_manifest_path}"
63
- icon_name = manifest.match(/android:icon="@drawable\/(.*?)"/)[1] + '.png'
63
+ if match = manifest.match(/android:icon="@drawable\/(.*?)"/)
64
+ prefix = "drawable"
65
+ elsif match = manifest.match(/android:icon="@mipmap\/(.*?)"/)
66
+ prefix = "mipmap"
67
+ end
68
+ icon_name = match[1] + '.png'
64
69
 
65
70
  drawable_dir = File.join File.dirname(android_manifest_path), 'res'
66
- valid_directories(drawable_dir).each do |dir|
71
+ valid_directories(drawable_dir, prefix).each do |dir|
67
72
  res = parse_resolution(dir)
68
73
  size = res_map[res]
69
74
  icon_path = File.join(dir, icon_name)
@@ -1,3 +1,3 @@
1
1
  module HighFive
2
- VERSION = "0.3.14"
2
+ VERSION = "0.3.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: high_five
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Samson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json