dubai 0.1.2 → 0.2.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: 10e0f07b5292faf076a3eeed56dc601cabf4261e
4
- data.tar.gz: d5e99e10840f743b022b05b37bc25ef89539041e
3
+ metadata.gz: 43d49980ee92e90d8d9ee6bb7d11eed359aea9b9
4
+ data.tar.gz: 77bbff4dd70a002eb247d99f38e2e809d3efa6f4
5
5
  SHA512:
6
- metadata.gz: 8375888bcaf2e30a7e5e25b248702d04563345b116c430cd47bfb8a339f21e066174caf0b441db8c3b8fb1320ab5438c1055e228a158005e52a7ecf08717f8ed
7
- data.tar.gz: f2b9bb9da6d95070ca8af5b29aa64e38053342059f84c5d3ab3d897dde5ff14302c7719eb30e0d23ad71acb60b1665378fac85c176bfa210a7c28569ee54b159
6
+ metadata.gz: bf34869df8e436cae3e3e275c999250f64086d76543d3718047da7814c6dde6e34b475f78a02fa00b51808e01c1afd5734a71a65e3dc50cdf70146fc77556aeb
7
+ data.tar.gz: 6a993da4ebb9478285ba168371384033dcee985979df83071af57576d3edb17916e18e799c4058a9dd36a9b3dd53c6e5ae1ea86b69b12f9de6c56227745c6255
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
5
  gemspec
@@ -0,0 +1,65 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dubai (0.2.0)
5
+ commander (~> 4.1)
6
+ json
7
+ rubyzip (~> 1.0)
8
+ sinatra (>= 1.3, < 2.0.0)
9
+ terminal-table (~> 1.4)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ commander (4.4.7)
15
+ highline (~> 2.0.0)
16
+ diff-lcs (1.3)
17
+ docile (1.3.2)
18
+ highline (2.0.2)
19
+ json (2.2.0)
20
+ rack (1.6.11)
21
+ rack-protection (1.5.5)
22
+ rack
23
+ rack-test (1.1.0)
24
+ rack (>= 1.0, < 3)
25
+ rake (12.3.2)
26
+ rspec (3.8.0)
27
+ rspec-core (~> 3.8.0)
28
+ rspec-expectations (~> 3.8.0)
29
+ rspec-mocks (~> 3.8.0)
30
+ rspec-core (3.8.2)
31
+ rspec-support (~> 3.8.0)
32
+ rspec-expectations (3.8.4)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.8.0)
35
+ rspec-mocks (3.8.1)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.8.0)
38
+ rspec-support (3.8.2)
39
+ rubyzip (1.2.3)
40
+ simplecov (0.17.0)
41
+ docile (~> 1.1)
42
+ json (>= 1.8, < 3)
43
+ simplecov-html (~> 0.10.0)
44
+ simplecov-html (0.10.2)
45
+ sinatra (1.4.8)
46
+ rack (~> 1.5)
47
+ rack-protection (~> 1.4)
48
+ tilt (>= 1.3, < 3)
49
+ terminal-table (1.8.0)
50
+ unicode-display_width (~> 1.1, >= 1.1.1)
51
+ tilt (2.0.9)
52
+ unicode-display_width (1.6.0)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ dubai!
59
+ rack-test
60
+ rake
61
+ rspec
62
+ simplecov
63
+
64
+ BUNDLED WITH
65
+ 2.0.1
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -1,32 +1,33 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
1
+ # frozen_string_literal: true
3
2
 
4
- require "dubai/version"
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ require 'dubai/version'
5
6
 
6
7
  Gem::Specification.new do |s|
7
- s.name = "dubai"
8
- s.authors = ["Mattt Thompson"]
9
- s.email = "m@mattt.me"
10
- s.license = "MIT"
11
- s.homepage = "http://nomad-cli.com"
8
+ s.name = 'dubai'
9
+ s.authors = ['Mattt']
10
+ s.email = 'mattt@me.com'
11
+ s.license = 'MIT'
12
+ s.homepage = 'http://nomad-cli.com'
12
13
  s.version = Dubai::VERSION
13
14
  s.platform = Gem::Platform::RUBY
14
- s.summary = "Dubai"
15
- s.description = "Passbook pass generation and preview."
15
+ s.summary = 'Dubai'
16
+ s.description = 'Passbook pass generation and preview.'
16
17
 
17
- s.add_dependency "json"
18
- s.add_dependency "commander", "~> 4.1"
19
- s.add_dependency "terminal-table", "~> 1.4"
20
- s.add_dependency "sinatra", [">= 1.3", "<= 2.0.0"]
21
- s.add_dependency "rubyzip", "~> 1.0"
18
+ s.add_dependency 'commander', '~> 4.1'
19
+ s.add_dependency 'json'
20
+ s.add_dependency 'rubyzip', '~> 1.0'
21
+ s.add_dependency 'sinatra', ['>= 1.3', '< 2.0.0']
22
+ s.add_dependency 'terminal-table', '~> 1.4'
22
23
 
23
- s.add_development_dependency "rspec"
24
- s.add_development_dependency "rake"
25
- s.add_development_dependency "simplecov"
26
- s.add_development_dependency "rack-test"
24
+ s.add_development_dependency 'rack-test'
25
+ s.add_development_dependency 'rake'
26
+ s.add_development_dependency 'rspec'
27
+ s.add_development_dependency 'simplecov'
27
28
 
28
- s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|log|pkg|script|spec|test|vendor)/ }
29
+ s.files = Dir['./**/*'].reject { |file| file =~ %r{\./(bin|log|pkg|script|spec|test|vendor)} }
29
30
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
30
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
31
- s.require_paths = ["lib"]
31
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
32
+ s.require_paths = ['lib']
32
33
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dubai/pass'
2
4
  require 'dubai/server'
3
5
  require 'dubai/version'
@@ -1,4 +1,6 @@
1
- $:.push File.expand_path('../', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path(__dir__)
2
4
 
3
5
  require 'commands/build'
4
6
  require 'commands/generate'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  command :build do |c|
2
4
  c.syntax = 'pk build [PASSNAME]'
3
5
  c.summary = 'Creates a .pkpass archive'
@@ -18,20 +20,21 @@ command :build do |c|
18
20
  @certificate = options.certificate
19
21
  validate_certificate!
20
22
 
21
- @password = ask("Enter certificate password:"){|q| q.echo = false} if options.password
23
+ @password = ask('Enter certificate password:') { |q| q.echo = false } if options.password
22
24
 
23
- Dubai::Passbook.certificate, Dubai::Passbook.password = @certificate, @password
25
+ Dubai::Passbook.certificate = @certificate
26
+ Dubai::Passbook.password = @password
24
27
 
25
28
  begin
26
29
  File.open(@filepath, 'w') do |f|
27
30
  f.write Dubai::Passbook::Pass.new(@directory).pkpass.string
28
31
  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
+ rescue OpenSSL::PKCS12::PKCS12Error => e
33
+ say_error "Error: #{e.message}"
34
+ say_warning 'You may be getting this error because the certificate password is either incorrect or missing'
32
35
  abort
33
- rescue => error
34
- say_error "Error: #{error.message}" and abort
36
+ rescue StandardError => e
37
+ say_error("Error: #{e.message}") && abort
35
38
  end
36
39
  end
37
40
  end
@@ -42,6 +45,6 @@ alias_command :b, :build
42
45
  private
43
46
 
44
47
  def validate_output_filepath!
45
- say_error "Filepath required" and abort if @filepath.nil? or @filepath.empty?
46
- say_error "#{@filepath} already exists" and abort if File.exist?(@filepath)
48
+ say_error('Filepath required') && abort if @filepath.nil? || @filepath.empty?
49
+ say_error("#{@filepath} already exists") && abort if File.exist?(@filepath)
47
50
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fileutils'
2
4
 
3
5
  command :generate do |c|
@@ -10,11 +12,11 @@ command :generate do |c|
10
12
 
11
13
  c.action do |args, options|
12
14
  @directory = args.first
13
- @directory ||= ask "Enter a passbook name: "
15
+ @directory ||= ask 'Enter a passbook name: '
14
16
 
15
- say_error "Missing pass name" and abort if @directory.nil? or @directory.empty?
16
- say_error "Directory #{@directory} already exists" and abort if File.directory?(@directory)
17
- say_error "File exists at #{@directory}" and abort if File.exist?(@directory)
17
+ say_error('Missing pass name') && abort if @directory.nil? || @directory.empty?
18
+ say_error("Directory #{@directory} already exists") && abort if File.directory?(@directory)
19
+ say_error("File exists at #{@directory}") && abort if File.exist?(@directory)
18
20
 
19
21
  @type = options.type
20
22
  determine_type! unless @type
@@ -36,9 +38,9 @@ alias_command :g, :generate
36
38
  private
37
39
 
38
40
  def determine_type!
39
- @type ||= choose "Select a pass type", *Dubai::Passbook::Pass::TYPES
41
+ @type ||= choose 'Select a pass type', *Dubai::Passbook::Pass::TYPES
40
42
  end
41
43
 
42
44
  def validate_type!
43
- say_error %{Invalid type: "#{@type}", expected one of: [#{Dubai::Passbook::Pass::TYPES.join(', ')}]} unless Dubai::Passbook::Pass::TYPES.include?(@type)
45
+ say_error %(Invalid type: "#{@type}", expected one of: [#{Dubai::Passbook::Pass::TYPES.join(', ')}]) unless Dubai::Passbook::Pass::TYPES.include?(@type)
44
46
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  command :serve do |c|
2
4
  c.syntax = 'pk serve [PASSNAME]'
3
5
  c.summary = 'Serves a .pkpass archive from a webserver'
@@ -15,9 +17,10 @@ command :serve do |c|
15
17
  @certificate = options.certificate
16
18
  validate_certificate!
17
19
 
18
- @password = ask("Enter certificate password:"){|q| q.echo = false} if options.password
20
+ @password = ask('Enter certificate password:') { |q| q.echo = false } if options.password
19
21
 
20
- Dubai::Passbook.certificate, Dubai::Passbook.password = @certificate, @password
22
+ Dubai::Passbook.certificate = @certificate
23
+ Dubai::Passbook.password = @password
21
24
 
22
25
  Dubai::Server.set :directory, @directory
23
26
 
@@ -38,16 +41,16 @@ def determine_directory!
38
41
  when 0 then nil
39
42
  when 1 then File.dirname(files.first)
40
43
  else
41
- @directory = choose "Select a directory:", *files.collect{|f| File.dirname(f)}
44
+ @directory = choose 'Select a directory:', *files.collect { |f| File.dirname(f) }
42
45
  end
43
46
  end
44
47
 
45
48
  def validate_directory!
46
- say_error "Missing argument" and abort if @directory.nil?
47
- say_error "Directory #{@directory} does not exist" and abort unless File.directory?(@directory)
48
- say_error "Directory #{@directory} is not valid pass" and abort unless File.exist?(File.join(@directory, "pass.json"))
49
+ say_error('Missing argument') && abort if @directory.nil?
50
+ say_error("Directory #{@directory} does not exist") && abort unless File.directory?(@directory)
51
+ say_error("Directory #{@directory} is not valid pass") && abort unless File.exist?(File.join(@directory, 'pass.json'))
49
52
  end
50
53
 
51
54
  def validate_certificate!
52
- say_error "Missing or invalid certificate file" and abort if @certificate.nil? or not File.exist?(@certificate)
55
+ say_error('Missing or invalid certificate file') && abort if @certificate.nil? || !File.exist?(@certificate)
53
56
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'digest/sha1'
2
4
  require 'openssl'
3
5
  require 'base64'
@@ -6,32 +8,32 @@ require 'zip'
6
8
 
7
9
  module Dubai
8
10
  module Passbook
9
- WWDR_CERTIFICATE = <<-EOF
10
- -----BEGIN CERTIFICATE-----
11
- MIIEIjCCAwqgAwIBAgIIAd68xDltoBAwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UE
12
- BhMCVVMxEzARBgNVBAoTCkFwcGxlIEluYy4xJjAkBgNVBAsTHUFwcGxlIENlcnRp
13
- ZmljYXRpb24gQXV0aG9yaXR5MRYwFAYDVQQDEw1BcHBsZSBSb290IENBMB4XDTEz
14
- MDIwNzIxNDg0N1oXDTIzMDIwNzIxNDg0N1owgZYxCzAJBgNVBAYTAlVTMRMwEQYD
15
- VQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBX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rAgMBAAGjgaYwgaMw
26
+ HQYDVR0OBBYEFIgnFwmpthhgi+zruvZHWcVSVKO3MA8GA1UdEwEB/wQFMAMBAf8w
27
+ HwYDVR0jBBgwFoAUK9BpR5R2Cf70a40uQKb3R01/CF4wLgYDVR0fBCcwJTAjoCGg
28
+ H4YdaHR0cDovL2NybC5hcHBsZS5jb20vcm9vdC5jcmwwDgYDVR0PAQH/BAQDAgGG
29
+ MBAGCiqGSIb3Y2QGAgEEAgUAMA0GCSqGSIb3DQEBBQUAA4IBAQBPz+9Zviz1smwv
30
+ j+4ThzLoBTWobot9yWkMudkXvHcs1Gfi/ZptOllc34MBvbKuKmFysa/Nw0Uwj6OD
31
+ Dc4dR7Txk4qjdJukw5hyhzs+r0ULklS5MruQGFNrCk4QttkdUGwhgAqJTleMa1s8
32
+ Pab93vcNIx0LSiaHP7qRkkykGRIZbVf1eliHe2iK5IaMSuviSRSqpd1VAKmuu0sw
33
+ ruGgsbwpgOYJd+W+NKIByn/c4grmO7i77LpilfMFY0GCzQ87HUyVpNur+cmV6U/k
34
+ TecmmYHpvPm0KdIBembhLoz2IYrF+Hjhga6/05Cdqa3zr/04GpZnMBxRpVzscYqC
35
+ tGwPDBUf
36
+ -----END CERTIFICATE-----
35
37
  EOF
36
38
 
37
39
  class << self
@@ -41,11 +43,11 @@ tGwPDBUf
41
43
  class Pass
42
44
  attr_reader :pass, :assets
43
45
 
44
- TYPES = ['boarding-pass', 'coupon', 'event-ticket', 'store-card', 'generic']
46
+ TYPES = ['boarding-pass', 'coupon', 'event-ticket', 'store-card', 'generic'].freeze
45
47
 
46
48
  def initialize(directory)
47
49
  @assets = Dir[File.join(directory, '*')]
48
- @pass = File.read(@assets.delete(@assets.detect{|file| File.basename(file) == 'pass.json'}))
50
+ @pass = File.read(@assets.delete(@assets.detect { |file| File.basename(file) == 'pass.json' }))
49
51
  end
50
52
 
51
53
  def manifest
@@ -53,7 +55,7 @@ tGwPDBUf
53
55
  checksums['pass.json'] = Digest::SHA1.hexdigest(@pass)
54
56
 
55
57
  @assets.each do |file|
56
- checksums[File.basename(file)] = Digest::SHA1.file(file).hexdigest
58
+ checksums[File.basename(file)] = Digest::SHA1.file(file).hexdigest
57
59
  end
58
60
 
59
61
  checksums.to_json
@@ -61,12 +63,12 @@ tGwPDBUf
61
63
 
62
64
  def pkpass
63
65
  Zip::OutputStream.write_buffer do |zip|
64
- zip.put_next_entry 'pass.json' and zip.write @pass
65
- zip.put_next_entry 'manifest.json' and zip.write manifest
66
- zip.put_next_entry 'signature' and zip.write signature(manifest)
66
+ zip.put_next_entry('pass.json') && zip.write(@pass)
67
+ zip.put_next_entry('manifest.json') && zip.write(manifest)
68
+ zip.put_next_entry('signature') && zip.write(signature(manifest))
67
69
 
68
70
  @assets.each do |file|
69
- zip.put_next_entry File.basename(file) and zip.print IO.read(file)
71
+ zip.put_next_entry(File.basename(file)) && zip.print(IO.read(file))
70
72
  end
71
73
  end
72
74
  end
@@ -77,7 +79,7 @@ tGwPDBUf
77
79
  pk7 = OpenSSL::PKCS7.sign(p12.certificate, p12.key, manifest, [wwdr], OpenSSL::PKCS7::BINARY | OpenSSL::PKCS7::DETACHED)
78
80
  data = OpenSSL::PKCS7.write_smime(pk7)
79
81
 
80
- start = %{filename=\"smime.p7s"\n\n}
82
+ start = %(filename=\"smime.p7s"\n\n)
81
83
  finish = "\n\n------"
82
84
  data = data[(data.index(start) + start.length)...(data.rindex(finish) + finish.length)]
83
85
 
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sinatra/base'
2
4
 
3
5
  module Dubai
4
6
  class Server < Sinatra::Base
5
7
  get '/pass.pkpass' do
6
8
  content_type 'application/vnd.apple.pkpass'
7
- attachment "pass.pkpass"
9
+ attachment 'pass.pkpass'
8
10
 
9
11
  Passbook::Pass.new(settings.directory).pkpass.string
10
12
  end
@@ -1,56 +1,56 @@
1
1
  {
2
- "formatVersion" : 1,
3
- "passTypeIdentifier" : "pass.com.example.boarding-pass",
4
- "description" : "Example Boarding Pass",
5
- "teamIdentifier": "Example",
6
- "organizationName": "Example",
7
- "serialNumber" : "123456",
8
- "foregroundColor": "#866B23",
9
- "backgroundColor": "#FFD248",
10
- "boardingPass" : {
11
- "primaryFields" : [
12
- {
13
- "key" : "origin",
14
- "label" : "San Francisco",
15
- "value" : "SFO"
16
- },
17
- {
18
- "key" : "destination",
19
- "label" : "London",
20
- "value" : "LHR"
21
- }
22
- ],
23
- "secondaryFields" : [
24
- {
25
- "key" : "boarding-gate",
26
- "label" : "Gate",
27
- "value" : "F12"
28
- }
29
- ],
30
- "auxiliaryFields" : [
31
- {
32
- "key" : "seat",
33
- "label" : "Seat",
34
- "value" : "7A"
35
- },
36
- {
37
- "key" : "passenger-name",
38
- "label" : "Passenger",
39
- "value" : "John Appleseed"
40
- }
41
- ],
42
- "transitType" : "PKTransitTypeAir",
43
- "barcode" : {
44
- "message" : "ABC123",
45
- "format" : "PKBarcodeFormatQR",
46
- "messageEncoding" : "iso-8859-1"
47
- },
48
- "backFields" : [
49
- {
50
- "key" : "terms",
51
- "label" : "Terms and Conditions",
52
- "value" : "Lorem ipsum dolar sit amet"
53
- }
54
- ]
55
- }
2
+ "formatVersion": 1,
3
+ "passTypeIdentifier": "pass.com.example.boarding-pass",
4
+ "description": "Example Boarding Pass",
5
+ "teamIdentifier": "Example",
6
+ "organizationName": "Example",
7
+ "serialNumber": "123456",
8
+ "foregroundColor": "#866B23",
9
+ "backgroundColor": "#FFD248",
10
+ "boardingPass": {
11
+ "primaryFields": [
12
+ {
13
+ "key": "origin",
14
+ "label": "San Francisco",
15
+ "value": "SFO"
16
+ },
17
+ {
18
+ "key": "destination",
19
+ "label": "London",
20
+ "value": "LHR"
21
+ }
22
+ ],
23
+ "secondaryFields": [
24
+ {
25
+ "key": "boarding-gate",
26
+ "label": "Gate",
27
+ "value": "F12"
28
+ }
29
+ ],
30
+ "auxiliaryFields": [
31
+ {
32
+ "key": "seat",
33
+ "label": "Seat",
34
+ "value": "7A"
35
+ },
36
+ {
37
+ "key": "passenger-name",
38
+ "label": "Passenger",
39
+ "value": "John Appleseed"
40
+ }
41
+ ],
42
+ "transitType": "PKTransitTypeAir",
43
+ "barcode": {
44
+ "message": "ABC123",
45
+ "format": "PKBarcodeFormatQR",
46
+ "messageEncoding": "iso-8859-1"
47
+ },
48
+ "backFields": [
49
+ {
50
+ "key": "terms",
51
+ "label": "Terms and Conditions",
52
+ "value": "Lorem ipsum dolar sit amet"
53
+ }
54
+ ]
55
+ }
56
56
  }
@@ -1,33 +1,27 @@
1
1
  {
2
- "formatVersion" : 1,
3
- "passTypeIdentifier" : "pass.com.example.coupon",
4
- "description" : "Example Coupon",
5
- "teamIdentifier": "Example",
6
- "organizationName": "Example",
7
- "serialNumber" : "123456",
8
- "foregroundColor": "#FFFFFF",
9
- "backgroundColor": "#C799FF",
10
- "generic" : {
11
- "primaryFields" : [
12
-
13
- ],
14
- "secondaryFields" : [
15
-
16
- ],
17
- "auxiliaryFields" : [
18
-
19
- ],
20
- "barcode" : {
21
- "message" : "ABCD 123 EFGH 456 IJKL 789 MNOP",
22
- "format" : "PKBarcodeFormatPDF417",
23
- "messageEncoding" : "iso-8859-1"
24
- },
25
- "backFields" : [
26
- {
27
- "key" : "terms",
28
- "label" : "Terms and Conditions",
29
- "value" : "Lorem ipsum dolar sit amet"
30
- }
31
- ]
32
- }
2
+ "formatVersion": 1,
3
+ "passTypeIdentifier": "pass.com.example.coupon",
4
+ "description": "Example Coupon",
5
+ "teamIdentifier": "Example",
6
+ "organizationName": "Example",
7
+ "serialNumber": "123456",
8
+ "foregroundColor": "#FFFFFF",
9
+ "backgroundColor": "#C799FF",
10
+ "generic": {
11
+ "primaryFields": [],
12
+ "secondaryFields": [],
13
+ "auxiliaryFields": [],
14
+ "barcode": {
15
+ "message": "ABCD 123 EFGH 456 IJKL 789 MNOP",
16
+ "format": "PKBarcodeFormatPDF417",
17
+ "messageEncoding": "iso-8859-1"
18
+ },
19
+ "backFields": [
20
+ {
21
+ "key": "terms",
22
+ "label": "Terms and Conditions",
23
+ "value": "Lorem ipsum dolar sit amet"
24
+ }
25
+ ]
26
+ }
33
27
  }
@@ -1,33 +1,27 @@
1
1
  {
2
- "formatVersion" : 1,
3
- "passTypeIdentifier" : "pass.com.example.event-ticket",
4
- "description" : "Example Event Ticket",
5
- "teamIdentifier": "Example",
6
- "organizationName": "Example",
7
- "serialNumber" : "123456",
8
- "foregroundColor": "#FFFFFF",
9
- "backgroundColor": "#FF5453",
10
- "generic" : {
11
- "primaryFields" : [
12
-
13
- ],
14
- "secondaryFields" : [
15
-
16
- ],
17
- "auxiliaryFields" : [
18
-
19
- ],
20
- "barcode" : {
21
- "message" : "ABCD 123 EFGH 456 IJKL 789 MNOP",
22
- "format" : "PKBarcodeFormatPDF417",
23
- "messageEncoding" : "iso-8859-1"
24
- },
25
- "backFields" : [
26
- {
27
- "key" : "terms",
28
- "label" : "Terms and Conditions",
29
- "value" : "Lorem ipsum dolar sit amet"
30
- }
31
- ]
32
- }
2
+ "formatVersion": 1,
3
+ "passTypeIdentifier": "pass.com.example.event-ticket",
4
+ "description": "Example Event Ticket",
5
+ "teamIdentifier": "Example",
6
+ "organizationName": "Example",
7
+ "serialNumber": "123456",
8
+ "foregroundColor": "#FFFFFF",
9
+ "backgroundColor": "#FF5453",
10
+ "generic": {
11
+ "primaryFields": [],
12
+ "secondaryFields": [],
13
+ "auxiliaryFields": [],
14
+ "barcode": {
15
+ "message": "ABCD 123 EFGH 456 IJKL 789 MNOP",
16
+ "format": "PKBarcodeFormatPDF417",
17
+ "messageEncoding": "iso-8859-1"
18
+ },
19
+ "backFields": [
20
+ {
21
+ "key": "terms",
22
+ "label": "Terms and Conditions",
23
+ "value": "Lorem ipsum dolar sit amet"
24
+ }
25
+ ]
26
+ }
33
27
  }
@@ -1,33 +1,27 @@
1
1
  {
2
- "formatVersion" : 1,
3
- "passTypeIdentifier" : "pass.com.example.generic",
4
- "description" : "Example Generic Pass",
5
- "teamIdentifier": "Example",
6
- "organizationName": "Example",
7
- "serialNumber" : "123456",
8
- "foregroundColor": "#FFFFFF",
9
- "backgroundColor": "#444444",
10
- "generic" : {
11
- "primaryFields" : [
12
-
13
- ],
14
- "secondaryFields" : [
15
-
16
- ],
17
- "auxiliaryFields" : [
18
-
19
- ],
20
- "barcode" : {
21
- "message" : "ABCD 123 EFGH 456 IJKL 789 MNOP",
22
- "format" : "PKBarcodeFormatPDF417",
23
- "messageEncoding" : "iso-8859-1"
24
- },
25
- "backFields" : [
26
- {
27
- "key" : "terms",
28
- "label" : "Terms and Conditions",
29
- "value" : "Lorem ipsum dolar sit amet"
30
- }
31
- ]
32
- }
2
+ "formatVersion": 1,
3
+ "passTypeIdentifier": "pass.com.example.generic",
4
+ "description": "Example Generic Pass",
5
+ "teamIdentifier": "Example",
6
+ "organizationName": "Example",
7
+ "serialNumber": "123456",
8
+ "foregroundColor": "#FFFFFF",
9
+ "backgroundColor": "#444444",
10
+ "generic": {
11
+ "primaryFields": [],
12
+ "secondaryFields": [],
13
+ "auxiliaryFields": [],
14
+ "barcode": {
15
+ "message": "ABCD 123 EFGH 456 IJKL 789 MNOP",
16
+ "format": "PKBarcodeFormatPDF417",
17
+ "messageEncoding": "iso-8859-1"
18
+ },
19
+ "backFields": [
20
+ {
21
+ "key": "terms",
22
+ "label": "Terms and Conditions",
23
+ "value": "Lorem ipsum dolar sit amet"
24
+ }
25
+ ]
26
+ }
33
27
  }
@@ -1,33 +1,27 @@
1
1
  {
2
- "formatVersion" : 1,
3
- "passTypeIdentifier" : "pass.com.example.store-card",
4
- "description" : "Example Store Card",
5
- "teamIdentifier": "Example",
6
- "organizationName": "Example",
7
- "serialNumber" : "123456",
8
- "foregroundColor": "#FFFFFF",
9
- "backgroundColor": "#AFC1E3",
10
- "generic" : {
11
- "primaryFields" : [
12
-
13
- ],
14
- "secondaryFields" : [
15
-
16
- ],
17
- "auxiliaryFields" : [
18
-
19
- ],
20
- "barcode" : {
21
- "message" : "ABCD 123 EFGH 456 IJKL 789 MNOP",
22
- "format" : "PKBarcodeFormatPDF417",
23
- "messageEncoding" : "iso-8859-1"
24
- },
25
- "backFields" : [
26
- {
27
- "key" : "terms",
28
- "label" : "Terms and Conditions",
29
- "value" : "Lorem ipsum dolar sit amet"
30
- }
31
- ]
32
- }
2
+ "formatVersion": 1,
3
+ "passTypeIdentifier": "pass.com.example.store-card",
4
+ "description": "Example Store Card",
5
+ "teamIdentifier": "Example",
6
+ "organizationName": "Example",
7
+ "serialNumber": "123456",
8
+ "foregroundColor": "#FFFFFF",
9
+ "backgroundColor": "#AFC1E3",
10
+ "generic": {
11
+ "primaryFields": [],
12
+ "secondaryFields": [],
13
+ "auxiliaryFields": [],
14
+ "barcode": {
15
+ "message": "ABCD 123 EFGH 456 IJKL 789 MNOP",
16
+ "format": "PKBarcodeFormatPDF417",
17
+ "messageEncoding": "iso-8859-1"
18
+ },
19
+ "backFields": [
20
+ {
21
+ "key": "terms",
22
+ "label": "Terms and Conditions",
23
+ "value": "Lorem ipsum dolar sit amet"
24
+ }
25
+ ]
26
+ }
33
27
  }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dubai
2
- VERSION = '0.1.2'
4
+ VERSION = '0.2.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'rack/test'
3
5
  require_relative '../lib/dubai/server'
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  unless ENV['CI']
2
4
  require 'simplecov'
3
-
5
+
4
6
  SimpleCov.start do
5
7
  add_filter 'spec'
6
8
  add_filter '.bundle'
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dubai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Mattt Thompson
7
+ - Mattt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: json
14
+ name: commander
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '4.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '4.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: commander
28
+ name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.1'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '4.1'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: terminal-table
42
+ name: rubyzip
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.4'
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.4'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sinatra
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.3'
62
- - - "<="
62
+ - - "<"
63
63
  - !ruby/object:Gem::Version
64
64
  version: 2.0.0
65
65
  type: :runtime
@@ -69,25 +69,25 @@ dependencies:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '1.3'
72
- - - "<="
72
+ - - "<"
73
73
  - !ruby/object:Gem::Version
74
74
  version: 2.0.0
75
75
  - !ruby/object:Gem::Dependency
76
- name: rubyzip
76
+ name: terminal-table
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.0'
81
+ version: '1.4'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.0'
88
+ version: '1.4'
89
89
  - !ruby/object:Gem::Dependency
90
- name: rspec
90
+ name: rack-test
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
@@ -115,7 +115,7 @@ dependencies:
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  - !ruby/object:Gem::Dependency
118
- name: simplecov
118
+ name: rspec
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - ">="
@@ -129,7 +129,7 @@ dependencies:
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  - !ruby/object:Gem::Dependency
132
- name: rack-test
132
+ name: simplecov
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - ">="
@@ -143,13 +143,14 @@ dependencies:
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  description: Passbook pass generation and preview.
146
- email: m@mattt.me
146
+ email: mattt@me.com
147
147
  executables:
148
148
  - pk
149
149
  extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
152
  - "./Gemfile"
153
+ - "./Gemfile.lock"
153
154
  - "./LICENSE"
154
155
  - "./README.md"
155
156
  - "./Rakefile"
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  version: '0'
191
192
  requirements: []
192
193
  rubyforge_project:
193
- rubygems_version: 2.6.11
194
+ rubygems_version: 2.6.14
194
195
  signing_key:
195
196
  specification_version: 4
196
197
  summary: Dubai