dubai 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5b8813005f42ca1e096f3bd925f507d9e056e669
4
+ data.tar.gz: 2d8e8602879ff9c301ce9f3452b1cd91844d6715
5
+ SHA512:
6
+ metadata.gz: d1602e056e7fc1b49641d9f9a6f66ba4eed55665917950ad0294397ad404266363b60223eba033b557c2d3d67a18010ba9c709b96d3db9a7afe8e4d33e508400
7
+ data.tar.gz: 2d2ef1545812da0e34a1c53543a430aee51d78304b8dbc05e8d5e3de94a3deaf5636062c8b689d0a74cba7a61b7b07d80c6a37cc712dea2800ee480169376250
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
data/Gemfile.lock CHANGED
@@ -1,45 +1,45 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dubai (0.0.1)
5
- commander (~> 4.1.2)
6
- json (~> 1.7.3)
4
+ dubai (0.0.3)
5
+ commander (~> 4.1)
6
+ json
7
7
  rubyzip
8
- sinatra
9
- terminal-table (~> 1.4.5)
8
+ sinatra (~> 1.3)
9
+ terminal-table (~> 1.4)
10
10
 
11
11
  GEM
12
- remote: http://rubygems.org/
12
+ remote: https://rubygems.org/
13
13
  specs:
14
14
  commander (4.1.3)
15
15
  highline (~> 1.6.11)
16
- diff-lcs (1.1.3)
17
- highline (1.6.15)
16
+ diff-lcs (1.2.4)
17
+ highline (1.6.18)
18
18
  json (1.7.7)
19
- multi_json (1.6.1)
19
+ multi_json (1.7.2)
20
20
  rack (1.5.2)
21
- rack-protection (1.3.2)
21
+ rack-protection (1.5.0)
22
22
  rack
23
- rake (10.0.3)
24
- rspec (2.12.0)
25
- rspec-core (~> 2.12.0)
26
- rspec-expectations (~> 2.12.0)
27
- rspec-mocks (~> 2.12.0)
28
- rspec-core (2.12.2)
29
- rspec-expectations (2.12.1)
30
- diff-lcs (~> 1.1.3)
31
- rspec-mocks (2.12.2)
23
+ rake (10.0.4)
24
+ rspec (2.13.0)
25
+ rspec-core (~> 2.13.0)
26
+ rspec-expectations (~> 2.13.0)
27
+ rspec-mocks (~> 2.13.0)
28
+ rspec-core (2.13.1)
29
+ rspec-expectations (2.13.0)
30
+ diff-lcs (>= 1.1.3, < 2.0)
31
+ rspec-mocks (2.13.1)
32
32
  rubyzip (0.9.9)
33
33
  simplecov (0.7.1)
34
34
  multi_json (~> 1.0)
35
35
  simplecov-html (~> 0.7.1)
36
36
  simplecov-html (0.7.1)
37
- sinatra (1.3.4)
38
- rack (~> 1.4)
39
- rack-protection (~> 1.3)
40
- tilt (~> 1.3, >= 1.3.3)
37
+ sinatra (1.4.2)
38
+ rack (~> 1.5, >= 1.5.2)
39
+ rack-protection (~> 1.4)
40
+ tilt (~> 1.3, >= 1.3.4)
41
41
  terminal-table (1.4.5)
42
- tilt (1.3.3)
42
+ tilt (1.3.7)
43
43
 
44
44
  PLATFORMS
45
45
  ruby
data/README.md CHANGED
@@ -1,19 +1,58 @@
1
1
  # Dubai
2
2
  **Generate and Preview Passbook Passes**
3
3
 
4
+ [Passbook](http://www.apple.com/ios/whats-new/#passbook) is an iOS 6 feature that manages boarding passes, movie tickets, retail coupons, & loyalty cards. Using the [PassKit API](https://developer.apple.com/library/prerelease/ios/#documentation/UserExperience/Reference/PassKit_Framework/_index.html), developers can register web services to automatically update content on the pass, such as gate changes on a boarding pass, or adding credit to a loyalty card.
5
+
6
+ Dubai makes it easy to generate `.pkpass` from a script or the command line, allowing you to rapidly iterate on the design and content of your passes, or generate one-offs on the fly.
7
+
8
+ Pairs nicely with [Rack::Passbook](https://github.com/mattt/rack-passbook).
9
+
10
+ > Dubai is named for [Dubai, UAE](http://en.wikipedia.org/wiki/Dubai), a center of commerce and trade (and as [Dave Rupert was all-too-eager to point out](https://twitter.com/davatron5000/status/304321180259721216), an unfortunate pun on "Do Buy!").
11
+ > It's part of a series of world-class command-line utilities for iOS development, which includes [Cupertino](https://github.com/mattt/cupertino) (Apple Dev Center management), [Shenzhen](https://github.com/mattt/shenzhen) (Building & Distribution), [Houston](https://github.com/mattt/houston) (Push Notifications), and [Venice](https://github.com/mattt/venice) (In-App Purchase Receipt Verification).
12
+
4
13
  ## Installation
5
14
 
6
15
  $ gem install dubai
7
16
 
17
+ ## Usage
18
+
19
+ ```ruby
20
+ require 'dubai'
21
+
22
+ Dubai::Passbook.certificate, Dubai::Passbook.password = "/path/to/certificate.p12, "..."
23
+
24
+ # Example.pass is a directory with files "pass.png", "icon.png" & "icon@2x.png"
25
+ File.open("Example.pkpass", 'w') do |f|
26
+ f.write Dubai::Passbook::Pass.new("Example.pass").pkpass.string
27
+ end
28
+ ```
29
+
30
+ <p align="center" >
31
+ <img src="http://f.cl.ly/items/1U3o0K2A1L1i0R2r3d2Z/dubai-screentshot.png" alt="Dubai Screenshot" title="Dubai Screenshot">
32
+ </p>
8
33
 
9
34
  ## Comand Line Interface
10
35
 
11
36
  Dubai also comes with the `pk` binary, which provides a convenient way to generate and preview passes
12
37
 
38
+ $ pk generate Example.pass -T boarding-pass
39
+
40
+ Dubai comes with templates for all of the different Passbook layouts:
41
+
42
+ - `boarding-pass`
43
+ - `coupon`
44
+ - `event-ticket`
45
+ - `store-card`
46
+ - `generic`
47
+
48
+ Build a `.pkpass` file (which can previewed with a drag-and-drop onto the iOS Simulator):
49
+
50
+ $ pk build Example.pass -c /path/to/certificate.p12
51
+
52
+ ...or serve them from a webserver (which can be previewed by visiting the address on a device or the simulator):
13
53
 
14
- $ pk generate mypass
15
- $ pk serve mypass
16
- $ open http://localhost:4000
54
+ $ pk serve Example.pass -c /path/to/certificate.p12
55
+ $ open http://localhost:4567
17
56
 
18
57
  ## Contact
19
58
 
data/dubai.gemspec CHANGED
@@ -1,21 +1,22 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "dubai"
3
+ require "dubai/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "dubai"
7
7
  s.authors = ["Mattt Thompson"]
8
8
  s.email = "m@mattt.me"
9
+ s.license = "MIT"
9
10
  s.homepage = "http://github.com/mattt/dubai"
10
11
  s.version = Dubai::VERSION
11
12
  s.platform = Gem::Platform::RUBY
12
- s.summary = "Passbook pass generation and preview"
13
- s.description = ""
13
+ s.summary = "Dubai"
14
+ s.description = "Passbook pass generation and preview."
14
15
 
15
- s.add_dependency "json", "~> 1.7.3"
16
- s.add_dependency "commander", "~> 4.1.2"
17
- s.add_dependency "terminal-table", "~> 1.4.5"
18
- s.add_dependency "sinatra"
16
+ s.add_dependency "json"
17
+ s.add_dependency "commander", "~> 4.1"
18
+ s.add_dependency "terminal-table", "~> 1.4"
19
+ s.add_dependency "sinatra", "~> 1.3"
19
20
  s.add_dependency "rubyzip"
20
21
 
21
22
  s.add_development_dependency "rspec"
@@ -22,18 +22,26 @@ command :build do |c|
22
22
 
23
23
  Dubai::Passbook.certificate, Dubai::Passbook.password = @certificate, @password
24
24
 
25
- File.open(@filepath, 'w') do |f|
26
- f.write Dubai::Passbook::Pass.new(@directory).pkpass.string
25
+ begin
26
+ File.open(@filepath, 'w') do |f|
27
+ f.write Dubai::Passbook::Pass.new(@directory).pkpass.string
28
+ end
29
+ rescue OpenSSL::PKCS12::PKCS12Error => error
30
+ say_error "Error: #{error.message}"
31
+ say_warning "You may be getting this error because the certificate password is either incorrect or missing"
32
+ abort
33
+ rescue => error
34
+ say_error "Error: #{error.message}" and abort
27
35
  end
28
36
  end
29
37
  end
30
38
 
31
- # alias_command :build, :archive
32
- # alias_command :build, :b
39
+ alias_command :archive, :build
40
+ alias_command :b, :build
33
41
 
34
42
  private
35
43
 
36
44
  def validate_output_filepath!
37
45
  say_error "Filepath required" and abort if @filepath.nil? or @filepath.empty?
38
46
  say_error "#{@filepath} already exists" and abort if File.exist?(@filepath)
39
- end
47
+ end
@@ -7,9 +7,9 @@ command :generate do |c|
7
7
 
8
8
  c.example 'description', 'pk generate mypass'
9
9
  c.option '-T', '--type [boardingPass|coupon|eventTicket|storeCard|generic]', 'Type of pass'
10
-
10
+
11
11
  c.action do |args, options|
12
- @directory = args.first
12
+ @directory = args.first
13
13
  @directory ||= ask "Enter a passbook name: "
14
14
 
15
15
  say_error "Missing pass name" and abort if @directory.nil? or @directory.empty?
@@ -30,8 +30,8 @@ command :generate do |c|
30
30
  end
31
31
  end
32
32
 
33
- # alias_command :generate, :new
34
- # alias_command :generate, :g
33
+ alias_command :new, :generate
34
+ alias_command :g, :generate
35
35
 
36
36
  private
37
37
 
@@ -0,0 +1,3 @@
1
+ module Dubai
2
+ VERSION = "0.0.3"
3
+ end
data/lib/dubai.rb CHANGED
@@ -1,6 +1,2 @@
1
- module Dubai
2
- VERSION = "0.0.1"
3
- end
4
-
5
1
  require 'dubai/pass'
6
2
  require 'dubai/server'
metadata CHANGED
@@ -1,105 +1,128 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dubai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mattt Thompson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-20 00:00:00.000000000 Z
11
+ date: 2013-04-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: json
16
- requirement: &70231892501860 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - ! '>='
20
18
  - !ruby/object:Gem::Version
21
- version: 1.7.3
19
+ version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70231892501860
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: commander
27
- requirement: &70231892497740 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ~>
31
32
  - !ruby/object:Gem::Version
32
- version: 4.1.2
33
+ version: '4.1'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70231892497740
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '4.1'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: terminal-table
38
- requirement: &70231892496260 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
45
  - - ~>
42
46
  - !ruby/object:Gem::Version
43
- version: 1.4.5
47
+ version: '1.4'
44
48
  type: :runtime
45
49
  prerelease: false
46
- version_requirements: *70231892496260
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.4'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: sinatra
49
- requirement: &70231884046780 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - ~>
53
60
  - !ruby/object:Gem::Version
54
- version: '0'
61
+ version: '1.3'
55
62
  type: :runtime
56
63
  prerelease: false
57
- version_requirements: *70231884046780
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: rubyzip
60
- requirement: &70231884045400 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
73
  - - ! '>='
64
74
  - !ruby/object:Gem::Version
65
75
  version: '0'
66
76
  type: :runtime
67
77
  prerelease: false
68
- version_requirements: *70231884045400
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rspec
71
- requirement: &70231884044780 !ruby/object:Gem::Requirement
72
- none: false
85
+ requirement: !ruby/object:Gem::Requirement
73
86
  requirements:
74
87
  - - ! '>='
75
88
  - !ruby/object:Gem::Version
76
89
  version: '0'
77
90
  type: :development
78
91
  prerelease: false
79
- version_requirements: *70231884044780
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
80
97
  - !ruby/object:Gem::Dependency
81
98
  name: rake
82
- requirement: &70231884043820 !ruby/object:Gem::Requirement
83
- none: false
99
+ requirement: !ruby/object:Gem::Requirement
84
100
  requirements:
85
101
  - - ! '>='
86
102
  - !ruby/object:Gem::Version
87
103
  version: '0'
88
104
  type: :development
89
105
  prerelease: false
90
- version_requirements: *70231884043820
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
91
111
  - !ruby/object:Gem::Dependency
92
112
  name: simplecov
93
- requirement: &70231884042620 !ruby/object:Gem::Requirement
94
- none: false
113
+ requirement: !ruby/object:Gem::Requirement
95
114
  requirements:
96
115
  - - ! '>='
97
116
  - !ruby/object:Gem::Version
98
117
  version: '0'
99
118
  type: :development
100
119
  prerelease: false
101
- version_requirements: *70231884042620
102
- description: ''
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Passbook pass generation and preview.
103
126
  email: m@mattt.me
104
127
  executables:
105
128
  - pk
@@ -120,6 +143,7 @@ files:
120
143
  - ./lib/dubai/templates/event-ticket.json
121
144
  - ./lib/dubai/templates/generic.json
122
145
  - ./lib/dubai/templates/store-card.json
146
+ - ./lib/dubai/version.rb
123
147
  - ./lib/dubai.rb
124
148
  - ./LICENSE
125
149
  - ./Rakefile
@@ -127,34 +151,28 @@ files:
127
151
  - spec/spec_helper.rb
128
152
  - bin/pk
129
153
  homepage: http://github.com/mattt/dubai
130
- licenses: []
154
+ licenses:
155
+ - MIT
156
+ metadata: {}
131
157
  post_install_message:
132
158
  rdoc_options: []
133
159
  require_paths:
134
160
  - lib
135
161
  required_ruby_version: !ruby/object:Gem::Requirement
136
- none: false
137
162
  requirements:
138
163
  - - ! '>='
139
164
  - !ruby/object:Gem::Version
140
165
  version: '0'
141
- segments:
142
- - 0
143
- hash: -3634839724726580605
144
166
  required_rubygems_version: !ruby/object:Gem::Requirement
145
- none: false
146
167
  requirements:
147
168
  - - ! '>='
148
169
  - !ruby/object:Gem::Version
149
170
  version: '0'
150
- segments:
151
- - 0
152
- hash: -3634839724726580605
153
171
  requirements: []
154
172
  rubyforge_project:
155
- rubygems_version: 1.8.15
173
+ rubygems_version: 2.0.3
156
174
  signing_key:
157
- specification_version: 3
158
- summary: Passbook pass generation and preview
175
+ specification_version: 4
176
+ summary: Dubai
159
177
  test_files:
160
178
  - spec/spec_helper.rb