passkit 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 113677b120a24b0f9b64e2ca133a9a668bb30d042d3939c9b0ba65fef38b8407
4
- data.tar.gz: e070e3b7fd30e589772bc3c1e850cdfbe5f9ecbe2a56237f6fd163e69c4ddcee
3
+ metadata.gz: 0ba766112a286c8570851338476fee913b5eff4575cfc2fc6eeb91fb2617e5b0
4
+ data.tar.gz: 7b28c2c662b071529705a5fa409da39d42442eb702547a25ad960369d0c8500d
5
5
  SHA512:
6
- metadata.gz: a0bdbaaff31652f167dd8d9db7f122f21035bc3b0076192bd208fcb62e8b03824fb3057e15a51b0ab3c5208a746cb715e9fd77b243f74a8113994d2f8dc2aa82
7
- data.tar.gz: 97f160e5f66ce8cc780049044ede60887cc616f337550c3b252fd42bf55cb3d30fd0355d2a7d0460869ebbcf4306ebff947bf7ccb275d2a227dd1c83d0c54753
6
+ metadata.gz: 53782d8dd386090a3fda13fa70ebf39a82d06afe3f00fd83cc54845cdeb59b5f0d0a414fe4e151e773451b4d18a3331720acfbd0ebd2e7eb6238effb1b8ab719
7
+ data.tar.gz: f37f52f4b3f105e1a5dde4c2613ffa35372d2c5734b8da28e3551f84bf978742c4d1a257ee380c46fa950fbba04e9f22fc37c67dfa05de7149c0c902735d91f7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.8.3]
2
+ - Exclude development and test files from the packaged gem.
3
+
4
+ ## [0.8.2]
5
+ - Set up the Semaphore CI pipeline with a manual promotion to release the gem.
6
+ - Self-signed certificates for the test suite, so it runs without an Apple Developer certificate.
7
+ - Code formatting cleanup (standardrb).
8
+ - Relax the `sqlite3` development dependency to `>= 1.4`.
9
+
1
10
  ## [0.8.1]
2
11
  - [#45](https://github.com/coorasse/passkit/pull/45): Fix broken build.
3
12
 
data/README.md CHANGED
@@ -188,9 +188,15 @@ or the certificate trust chain could not be verified." the certificate (p12) mig
188
188
 
189
189
  ## Development
190
190
 
191
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
191
+ After checking out the repo, run `bin/setup` to install dependencies and to generate the self-signed certificates
192
+ used to sign the passes in the test suite. Then, run `rake test` to run the tests and `rake test:system` to run the
193
+ system tests (they require Chrome). You can also run `bin/console` for an interactive prompt that will allow you to
194
+ experiment.
192
195
 
193
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
196
+ The test suite reads its configuration from `.env.test`, so no Apple Developer certificate is needed to run it.
197
+ Values defined in your own `.env` take precedence, in case you want to run the dummy app with real certificates.
198
+
199
+ To install this gem onto your local machine, run `bundle exec rake install`.
194
200
 
195
201
  ## Contributing
196
202
 
@@ -12,10 +12,10 @@ module Passkit
12
12
  Passkit::Factory.create_pass(@payload[:pass_class], collection_item)
13
13
  end
14
14
  file = Passkit::Generator.compress_passes_files(files)
15
- send_file(file, type: 'application/vnd.apple.pkpasses', disposition: 'attachment')
15
+ send_file(file, type: "application/vnd.apple.pkpasses", disposition: "attachment")
16
16
  else
17
17
  file = Passkit::Factory.create_pass(@payload[:pass_class], @generator)
18
- send_file(file, type: 'application/vnd.apple.pkpass', disposition: 'attachment')
18
+ send_file(file, type: "application/vnd.apple.pkpass", disposition: "attachment")
19
19
  end
20
20
  end
21
21
 
@@ -39,7 +39,7 @@ module Passkit
39
39
  :secondary_fields,
40
40
  :semantics,
41
41
  :sharing_prohibited,
42
- :strip_color
42
+ :strip_color,
43
43
  :suppress_strip_shine,
44
44
  :user_info,
45
45
  :voided,
@@ -189,10 +189,10 @@ module Passkit
189
189
 
190
190
  # QRCode by default
191
191
  def barcode
192
- { messageEncoding: "iso-8859-1",
193
- format: "PKBarcodeFormatQR",
194
- message: "https://github.com/coorasse/passkit",
195
- altText: "https://github.com/coorasse/passkit" }
192
+ {messageEncoding: "iso-8859-1",
193
+ format: "PKBarcodeFormatQR",
194
+ message: "https://github.com/coorasse/passkit",
195
+ altText: "https://github.com/coorasse/passkit"}
196
196
  end
197
197
 
198
198
  # Barcode example
@@ -231,7 +231,7 @@ module Passkit
231
231
  false
232
232
  end
233
233
 
234
- private
234
+ private
235
235
 
236
236
  def folder_name
237
237
  self.class.name.demodulize.underscore
@@ -39,10 +39,10 @@ module Passkit
39
39
  # QRCode by default
40
40
  def barcodes
41
41
  [
42
- { messageEncoding: "iso-8859-1",
43
- format: "PKBarcodeFormatQR",
44
- message: "https://github.com/coorasse/passkit",
45
- altText: "https://github.com/coorasse/passkit" }
42
+ {messageEncoding: "iso-8859-1",
43
+ format: "PKBarcodeFormatQR",
44
+ message: "https://github.com/coorasse/passkit",
45
+ altText: "https://github.com/coorasse/passkit"}
46
46
  ]
47
47
  end
48
48
 
@@ -59,12 +59,12 @@ module Passkit
59
59
  end
60
60
 
61
61
  def relevant_date
62
- Time.current.strftime('%Y-%m-%dT%H:%M:%S%:z')
62
+ Time.current.strftime("%Y-%m-%dT%H:%M:%S%:z")
63
63
  end
64
64
 
65
65
  def expiration_date
66
66
  # Expire the pass tomorrow
67
- (Time.current + 1.day).strftime('%Y-%m-%dT%H:%M:%S%:z')
67
+ (Time.current + 1.day).strftime("%Y-%m-%dT%H:%M:%S%:z")
68
68
  end
69
69
 
70
70
  def semantics
@@ -121,7 +121,7 @@ module Passkit
121
121
  }]
122
122
  end
123
123
 
124
- private
124
+ private
125
125
 
126
126
  def folder_name
127
127
  self.class.name.demodulize.underscore
@@ -36,7 +36,7 @@ module Passkit
36
36
  zip_path
37
37
  end
38
38
 
39
- private
39
+ private
40
40
 
41
41
  def check_necessary_files
42
42
  raise "icon.png is not present in #{@pass.pass_path}" unless File.exist?(File.join(@pass.pass_path, "icon.png"))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Passkit
4
- VERSION = "0.8.1"
4
+ VERSION = "0.8.3"
5
5
  end
data/lib/passkit.rb CHANGED
@@ -22,7 +22,7 @@ module Passkit
22
22
  end
23
23
 
24
24
  def self.configured?
25
- self.configuration&.configured?
25
+ configuration&.configured?
26
26
  end
27
27
 
28
28
  class Configuration
@@ -68,7 +68,7 @@ module Passkit
68
68
  # Optional
69
69
  @skip_verification = false
70
70
  @web_service_host = ENV["PASSKIT_WEB_SERVICE_HOST"] || "https://localhost:3000"
71
- @available_passes = { "Passkit::ExampleStoreCard" => -> {} }
71
+ @available_passes = {"Passkit::ExampleStoreCard" => -> {}}
72
72
  @format_version = ENV["PASSKIT_FORMAT_VERSION"] || 1
73
73
  @dashboard_username = ENV["PASSKIT_DASHBOARD_USERNAME"]
74
74
  @dashboard_password = ENV["PASSKIT_DASHBOARD_PASSWORD"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi
@@ -41,14 +41,14 @@ dependencies:
41
41
  name: sqlite3
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.4'
47
47
  type: :development
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '1.4'
54
54
  - !ruby/object:Gem::Dependency
@@ -143,14 +143,10 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".example.env"
147
- - ".standard.yml"
148
146
  - CHANGELOG.md
149
147
  - CODE_OF_CONDUCT.md
150
- - Gemfile
151
148
  - LICENSE.txt
152
149
  - README.md
153
- - Rakefile
154
150
  - app/assets/config/passkit_manifest.js
155
151
  - app/assets/images/passkit/add_to_apple_wallet_de.png
156
152
  - app/assets/images/passkit/add_to_apple_wallet_en.png
@@ -178,17 +174,7 @@ files:
178
174
  - app/views/passkit/dashboard/previews/index.html.erb
179
175
  - app/views/passkit/example_mailer/example_email.html.erb
180
176
  - app/views/shared/passkit/_navigation.html.erb
181
- - bin/console
182
- - bin/setup
183
177
  - config/routes.rb
184
- - docs/membership.png
185
- - docs/passkit_environment_variables.md
186
- - docs/step1.png
187
- - docs/step2.png
188
- - docs/step3.png
189
- - docs/step4.png
190
- - docs/step5.png
191
- - docs/wallet.png
192
178
  - lib/generators/passkit/install_generator.rb
193
179
  - lib/generators/templates/create_passkit_tables.rb.tt
194
180
  - lib/generators/templates/passkit.rb
@@ -235,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
221
  - !ruby/object:Gem::Version
236
222
  version: '0'
237
223
  requirements: []
238
- rubygems_version: 3.6.9
224
+ rubygems_version: 4.0.9
239
225
  specification_version: 4
240
226
  summary: Serve Wallet Passes for iOS and Android directly from your Rails app
241
227
  test_files: []
data/.example.env DELETED
@@ -1,8 +0,0 @@
1
- PASSKIT_WEB_SERVICE_HOST=https://localhost:3000
2
- PASSKIT_CERTIFICATE_KEY=theCertPassword
3
- PASSKIT_PRIVATE_P12_CERTIFICATE=path/to/certificate.p12
4
- PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE=path/to/AppleWWDRCA.cer
5
- PASSKIT_APPLE_TEAM_IDENTIFIER=XXXXXXXXXX
6
- PASSKIT_PASS_TYPE_IDENTIFIER=pass.com.example.pass
7
- PASSKIT_DASHBOARD_USERNAME=admin
8
- PASSKIT_DASHBOARD_PASSWORD=admin
data/.standard.yml DELETED
@@ -1,2 +0,0 @@
1
- # For available configuration options, see:
2
- # https://github.com/testdouble/standard
data/Gemfile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in passkit.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "minitest", "~> 5.0"
11
-
12
- gem "standard", "~> 1.3"
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rake/testtask"
5
-
6
- Rake::TestTask.new(:test) do |t|
7
- t.libs << "test"
8
- t.libs << "lib"
9
- t.test_files = FileList["test/**/test_*.rb"]
10
- end
11
-
12
- require "standard/rake"
13
-
14
- task default: %i[test standard]
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "passkit"
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require "irb"
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/docs/membership.png DELETED
Binary file
@@ -1,53 +0,0 @@
1
- # Setup Passkit Environment variables
2
-
3
- ### `PASSKIT_WEB_SERVICE_HOST`
4
-
5
- This is the host where your Rails app is running. It is used to generate the URLs for the passes.
6
- When the device wants to update the Pass, it will invoke services on this host.
7
- In production, it will simply be your domain name, but in development you can use [ngrok](https://ngrok.com/) to expose your local server to the internet.
8
-
9
- **Remember that it must always start with `https://`.**
10
-
11
- ### `PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE`
12
-
13
- This is the easy one.
14
- Head to https://www.apple.com/certificateauthority/ and download the latest Apple Intermediate Certificate Worldwide Developer Relations.
15
- You might want to choose the one with the longest expiration date. PASSKIT_APPLE_INTERMEDIATE_CERTIFICATE is the path to the certificate.
16
-
17
- ### `PASSKIT_APPLE_TEAM_IDENTIFIER`
18
-
19
- You find this in your Apple Developer dashboard, under Membership.
20
-
21
- ![Membership](membership.png)
22
-
23
- ### `PASSKIT_PASS_TYPE_IDENTIFIER`, `PASSKIT_PRIVATE_P12_CERTIFICATE` and `PASSKIT_CERTIFICATE_KEY`
24
-
25
- Head to your Apple Developers console and generate a new certificate.
26
-
27
- ![Step 1](step1.png)
28
-
29
- ![Step 2](step2.png)
30
-
31
- ![Step 3](step3.png)
32
-
33
- The identifier is the `PASSKIT_PASS_TYPE_IDENTIFIER` variable.
34
-
35
- **Note**: When renewing your certificate, make sure that this identifier stays the same as before. Changing this identifier will
36
- require existing passes to be regenerated, as they will otherwise no longer be updateable via the web service URL.
37
-
38
- Now, create a certificate signing request: https://developer.apple.com/help/account/create-certificates/create-a-certificate-signing-request/
39
-
40
- And create the certificate:
41
-
42
- ![Step 4](step4.png)
43
-
44
- At the end, you'll have a `pass.cer` file.
45
-
46
- Open it in the Keychain Access tool and export it (you must be in the My Certificates tab):
47
-
48
- ![Step 5](step5.png)
49
-
50
- Set a password and get your p12 file. The path to this file is the `PASSKIT_PRIVATE_P12_CERTIFICATE` variable.
51
- Save the password. This is the `PASSKIT_CERTIFICATE_KEY` variable.
52
-
53
- `PKCS12_parse: unsupported`: you might encounter this issue: https://help.heroku.com/88GYDTB2/how-do-i-configure-openssl-to-allow-the-use-of-legacy-cryptographic-algorithms
data/docs/step1.png DELETED
Binary file
data/docs/step2.png DELETED
Binary file
data/docs/step3.png DELETED
Binary file
data/docs/step4.png DELETED
Binary file
data/docs/step5.png DELETED
Binary file
data/docs/wallet.png DELETED
Binary file