hawk 1.2.0 → 1.3.0

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: ab3deafc194337b349ad8c93571940218715418c
4
- data.tar.gz: fab353ca3ce2398d263d84536b05f7ef47a93e98
3
+ metadata.gz: 7b05a47ba96ddfaad667c74f74763b610e451050
4
+ data.tar.gz: 2d857c9095aec321547cc170f780707706b82077
5
5
  SHA512:
6
- metadata.gz: f90c1d27935237c955abbfc05eb48fce7a44fd82650ef1f47e779e4da7aa748ba05b478d2176d5f4432268c2719b57cb6354e4e9240d37a383c5942964004141
7
- data.tar.gz: c06286c596b726884eab5860ca1b53836d3677068b012f3a5d643f6cde350183ac20b66fec45799077d0184c46d40b3a0a193050cf0038b25db7b6d79c6084f5
6
+ metadata.gz: f4aba4da0bc56168aef6fd77dc7e15584e20379c08c19f27562761956c3c8a5e40286a6e557a3660087af4f73be48bef616f067a88d192544eba0fa8e5d6fe61
7
+ data.tar.gz: d6d96883fd7410d5b4349762658f2f5f21223458a1e607d80fb2727e8b078920d108ea30cbdfd86739c294a762e0bfb6595b2adfaa4daff5944b8c90febb826a
data/lib/hawk/builder.rb CHANGED
@@ -24,6 +24,18 @@ module Hawk
24
24
  def configuration(configuration)
25
25
  @configuration = configuration
26
26
  end
27
+
28
+ def vendor_name(name)
29
+ @vendor_name = name
30
+ end
31
+
32
+ def icon_path(path)
33
+ @icon_path = path
34
+ end
35
+
36
+ def fullsize_image_path(path)
37
+ @fullsize_image_path = path
38
+ end
27
39
  end
28
40
 
29
41
  def app_name
@@ -42,6 +54,26 @@ module Hawk
42
54
  `git rev-parse --short HEAD`.chomp
43
55
  end
44
56
 
57
+ def vendor_name
58
+ @vendor_name
59
+ end
60
+
61
+ def icon_path
62
+ @icon_path
63
+ end
64
+
65
+ def escaped_icon_url
66
+ (icon_path)? CGI.escapeHTML(icon_url) : 'https://raw.githubusercontent.com/mtrudel/hawk/master/templates/icon.png'
67
+ end
68
+
69
+ def fullsize_image_path
70
+ @fullsize_image_path
71
+ end
72
+
73
+ def escaped_fullsize_image_url
74
+ (fullsize_image_path)? CGI.escapeHTML(fullsize_image_url) : 'https://raw.githubusercontent.com/mtrudel/hawk/master/templates/fullsize_image.png'
75
+ end
76
+
45
77
  def ipa_file
46
78
  if (!@ipa_file)
47
79
  output_dir = Dir.tmpdir
data/lib/hawk/cli.rb CHANGED
@@ -13,6 +13,11 @@ module Hawk
13
13
  options[:preserve_ipa] = true
14
14
  end
15
15
 
16
+ options[:preserve_manifest] = false
17
+ opts.on( '-m', '--preserve-manifest', 'Leave a copy of the manifest.plist file in the current directory' ) do
18
+ options[:preserve_manifest] = true
19
+ end
20
+
16
21
  opts.on( '-h', '--help', 'Display this screen' ) do
17
22
  puts opts
18
23
  exit
@@ -37,6 +37,7 @@ module Hawk
37
37
  if (!@plist_url)
38
38
  @plist_url = object('manifest.plist') do |obj|
39
39
  plist_data = build_plist
40
+ File.write(File.join(Dir.pwd, 'manifest.plist'), plist_data) if @options[:preserve_manifest]
40
41
  print 'Uploading plist to S3...'
41
42
  obj.write(plist_data, :content_type => 'application/xml')
42
43
  puts 'done'
@@ -58,6 +59,30 @@ module Hawk
58
59
  @webpage_url
59
60
  end
60
61
 
62
+ def icon_url
63
+ if (!@icon_url)
64
+ file = icon_path
65
+ @icon_url = object(File.basename(file)) do |obj|
66
+ print "Uploading #{File.basename(file)} to S3..."
67
+ obj.write(Pathname.new(file), :content_type => 'image/png')
68
+ puts 'done'
69
+ end
70
+ end
71
+ @icon_url
72
+ end
73
+
74
+ def fullsize_image_url
75
+ if (!@fullsize_image_url)
76
+ file = fullsize_image_path
77
+ @icon_url = object(File.basename(file)) do |obj|
78
+ print "Uploading #{File.basename(file)} to S3..."
79
+ obj.write(Pathname.new(file), :content_type => 'image/png')
80
+ puts 'done'
81
+ end
82
+ end
83
+ @fullsize_image_url
84
+ end
85
+
61
86
  private
62
87
 
63
88
  def object(name, &block)
data/lib/hawk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hawk
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
data/templates/Hawkfile CHANGED
@@ -37,6 +37,27 @@
37
37
  # How many days to wait before deleting the files from S3. Defaults to 30 days
38
38
  #delete_after 30
39
39
 
40
+ #
41
+ # Vendor name - an optional value to be displayed alongside the app name during
42
+ # the install process
43
+ #
44
+ #vendor_name "ABC Co"
45
+
46
+ #
47
+ # Icon path - the path (relative to this Hawkfile) that a 57x57px PNG formatted
48
+ # app icon can be found, to be used during the app install. This is optional,
49
+ # and if omitted a plain white icon will be used in its stead
50
+ #
51
+ #icon_path 'path/to/icon.png'
52
+
53
+ #
54
+ # Full size icon image path - the path (relative to this Hawkfile) that
55
+ # a 512x512x PNG formatted app icon can be found. to be used during the app
56
+ # install. This is optional, and if omitted a plain white icon will be used in
57
+ # its stead
58
+ #
59
+ #fullsize_image_path 'path/to/fullsize_image.png'
60
+
40
61
  #
41
62
  # User list - a list of users to send emails to upon successsful upload of a new
42
63
  # version of your app. Specified one email address per line, to keep diffs sane
Binary file
Binary file
@@ -13,6 +13,18 @@
13
13
  <key>url</key>
14
14
  <string><%= escaped_ipa_url %></string>
15
15
  </dict>
16
+ <dict>
17
+ <key>kind</key>
18
+ <string>display-image</string>
19
+ <key>url</key>
20
+ <string><%= escaped_icon_url %></string>
21
+ </dict>
22
+ <dict>
23
+ <key>kind</key>
24
+ <string>full-size-image</string>
25
+ <key>url</key>
26
+ <string><%= escaped_fullsize_image_url %></string>
27
+ </dict>
16
28
  </array>
17
29
  <key>metadata</key>
18
30
  <dict>
@@ -24,6 +36,10 @@
24
36
  <string>software</string>
25
37
  <key>title</key>
26
38
  <string><%= app_name %></string>
39
+ <% if vendor_name %>
40
+ <key>subtitle</key>
41
+ <string><%= vendor_name %></string>
42
+ <% end %>
27
43
  </dict>
28
44
  </dict>
29
45
  </array>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hawk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Trudel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-21 00:00:00.000000000 Z
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -78,6 +78,8 @@ files:
78
78
  - lib/hawk/s3_uploader.rb
79
79
  - lib/hawk/version.rb
80
80
  - templates/Hawkfile
81
+ - templates/fullsize_image.png
82
+ - templates/icon.png
81
83
  - templates/install.html.erb
82
84
  - templates/manifest.plist.erb
83
85
  homepage: http://github.com/mtrudel/hawk