push_package 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzMyYmUwZDI3OTNhMjQ5ZmMzYTljZDk0M2Y1YmU0NTUwM2M3MTA2OA==
4
+ ZjE5YzE1ZWIwZGY2OGQxNDM3YmE1NWIwN2U4ZGFiZTgxMDY3ZTk1Ng==
5
5
  data.tar.gz: !binary |-
6
- YmQwOGVjMjRiMTUwZTYzMGM0MGEzM2I1MzcxODczMGRkNGQ0ZGU4Zg==
6
+ NDJlZTBmM2ZlNmY5NTAzM2NjY2MxYWZhN2MxN2FiMmI0ODNhMzQ4OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWQzY2NkYzBhZjhjMGI3MzJkMjg4YTZkYzUwYTNiMmE4NzQ5MmJiZDE4NDJi
10
- MTdkZGQyY2I0ZDUzZjdmMzc0MjJmYzI4MTk4YjBkMjY0NjU4M2RkZmUyNzJi
11
- NzJhNTJkOGVkN2JkODkzYWMyNDQxMDgyYmEwMGE0ZjUyZmZjMTg=
9
+ ZGFhYzJmYWM3YWZkZWUwMGUwNWUxNjFiNGI5NWZhZDQ3NTljMmQ4ZDAwZWY4
10
+ NWRmMDcwYmViZGI5ZTQ5OTkwZjIwNzY5ZjU0MTkzNTBiNmUyOWY1MDUwMGMw
11
+ NDk4MGQ4YWNjYzQzMjA1MWRjOWMyYjkwMTJlNDNjY2Y0M2E5MzA=
12
12
  data.tar.gz: !binary |-
13
- ZmZjYjNkYWFmOWQxMmY0ZmJmMDIyNDExZDU0MmExMDliZjEzMjM4MWQzOGZl
14
- Y2Y1N2I1MDRiNDIzNjIwYmYwMDFmMDdlOWU3MDJhYTdiMmFmMjMxZTUyMDFk
15
- NWRkMDk2ZGE0NTVjZjYyZGI4NWNmYjAxMjdkZWVmNzk1YTRjMTY=
13
+ ZDg3ZTUxZDRlZTFlM2VjNTFmZGY5YTgxN2JjZjk3ZWIxYjZlODAxZjNlMDY1
14
+ OGMzNWRlNTIyNTI3ODcxMzExZWEyZTRjMTI2YjE0NWM1YWIwZGUwNjJiNzRl
15
+ MTAxYWIxMTljMTQ5NjVlZmU1NWVkZDdiMjYzNWIyZTRiM2VmODg=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- push_package (0.0.2)
4
+ push_package (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/bin/push_package ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'json'
4
+ require 'optparse'
5
+ require 'push_package'
6
+
7
+ # $> push_package --website-json=./website.json --iconset=~/project/iconset --certificate=./Certificate.p12 --output-dir=./
8
+ options = {}
9
+ options_parser = OptionParser.new do |opts|
10
+ opts.banner = 'Usage: push_package [options]'
11
+
12
+ opts.on('-w', '--website-json required', 'The path to the file containing the website.json') do |opt|
13
+ options[:website_json_path] = opt
14
+ end
15
+
16
+ opts.on('-i', '--iconset-path required', 'The path to the directory containing the iconset') do |opt|
17
+ options[:iconset_path] = opt
18
+ end
19
+
20
+ opts.on('-c', '--certificate required', 'The path to the p12 file that will be used to sign the manifest.json') do |opt|
21
+ options[:certificate_path] = opt
22
+ end
23
+
24
+ opts.on('-o', '--output-dir optional', 'The desired output path for the pushPackage.zip file') do |opt|
25
+ options[:output_directory] = opt
26
+ end
27
+ end
28
+
29
+ options_parser.parse!
30
+
31
+ # check the required options
32
+ [:website_json_path, :certificate_path].each do |opt|
33
+ unless File.file?(options[opt].to_s)
34
+ puts options_parser.help
35
+ exit 1
36
+ end
37
+ end
38
+
39
+ unless File.directory?(options[:iconset_path].to_s)
40
+ puts options_parser.help
41
+ exit 1
42
+ end
43
+
44
+ options[:output_directory] = `pwd`.strip unless options[:output_directory]
45
+
46
+ website_params = JSON.load(File.open(options[:website_json_path], 'r'))
47
+
48
+ packager = PushPackage.new(website_params, options[:iconset_path], options[:certificate_path])
49
+
50
+ packager.save(options[:output_directory] + '/pushPackage.zip')
51
+
52
+
@@ -1,3 +1,3 @@
1
1
  class PushPackage
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: push_package
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-13 00:00:00.000000000 Z
12
+ date: 2013-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -57,7 +57,8 @@ description: As of OSX 10.9 Safari can receive push notifications when it is clo
57
57
  email:
58
58
  - stefan.natchev@gmail.com
59
59
  - adam.v.duke@gmail.com
60
- executables: []
60
+ executables:
61
+ - push_package
61
62
  extensions: []
62
63
  extra_rdoc_files: []
63
64
  files:
@@ -67,6 +68,7 @@ files:
67
68
  - LICENSE.txt
68
69
  - README.md
69
70
  - Rakefile
71
+ - bin/push_package
70
72
  - lib/push_package.rb
71
73
  - lib/push_package/version.rb
72
74
  - push_package.gemspec