passkit 0.5.0 → 0.5.2

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: 6c3d8db0fdcb21bf1c79f1894074ba1bc36838e5d4ebf78076769cbcf28fb6ad
4
- data.tar.gz: 6338ff436da5f1dffc1b23078c98e74a14f25f2dd7f522491529ea2828ca76a4
3
+ metadata.gz: ac37924f38a30e3ab41fa5e0c8829498c292e3054972b3784de757235c70a994
4
+ data.tar.gz: 580a91cd365943dfdbe93fe5e50150a6aeb70b14b5aef8819db0b1d14eba28cb
5
5
  SHA512:
6
- metadata.gz: 3fb31540b3b4212b0a75dd3d162622efcef24a7e3fe128d45ed78bda2abced5274cf750d555d46559c1549e9773a7e95cd02135bc334540c6fdfbc245a1b6511
7
- data.tar.gz: 1780c34f7c9b7b1b8f6174898cede7a0a7a012c978172d134ebf12ce6e9bb895db89fe053eb590df76472ebb2f5999404fd02a2042686678434a392e87ec0c26
6
+ metadata.gz: 066e8d8391544da7b331210dc43d6eb7754bbf2b894c136c0887e6fefcdf2413affbac33b3e238ef809ab3d952e54bbdb708891f704156b1b92dea1aeb48962a
7
+ data.tar.gz: 168b4f31c4e1f1ac99d6c69323ad3d59f37151bc9ecb1bb912b8f16289523688696a85cbc49afb0b39041f22594e57e9b4da8b341988ca4f85277c2a741c0bbf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [0.5.2]
2
+
3
+ - [#14](https://github.com/coorasse/passkit/pull/14): Send correct headers with previews so it auto-adds on iOS
4
+
5
+ ## [0.5.1]
6
+
7
+ - [#13](https://github.com/coorasse/passkit/pull/13): Added sharingProhibited
8
+ - [#13](https://github.com/coorasse/passkit/pull/13): Added maxDistance
9
+ - [#13](https://github.com/coorasse/passkit/pull/13): Allow custom files with add_other_files
10
+
1
11
  ## [0.5.0]
2
12
 
3
13
  - Allow configuring labelColor
@@ -6,7 +6,9 @@ module Passkit
6
6
 
7
7
  def show
8
8
  builder = Passkit.configuration.available_passes[params[:class_name]]
9
- send_file Factory.create_pass(params[:class_name].constantize, builder.call)
9
+ path = Factory.create_pass(params[:class_name].constantize, builder.call)
10
+
11
+ send_file path, type: 'application/vnd.apple.pkpass', disposition: 'attachment', filename: 'pass.pkpass'
10
12
  end
11
13
  end
12
14
  end
@@ -29,6 +29,8 @@ module Passkit
29
29
  :secondary_fields,
30
30
  :auxiliary_fields,
31
31
  :back_fields,
32
+ :sharing_prohibited,
33
+ :max_distance,
32
34
  to: :instance
33
35
 
34
36
  before_validation on: :create do
@@ -75,6 +75,14 @@ module Passkit
75
75
  false
76
76
  end
77
77
 
78
+ # After base files are copied this is called to allow for adding custom images
79
+ def add_other_files(path)
80
+ end
81
+
82
+ # Distance in meters from locations; if blank uses pass default
83
+ def max_distance
84
+ end
85
+
78
86
  def file_name
79
87
  @file_name ||= SecureRandom.uuid
80
88
  end
@@ -119,6 +127,10 @@ module Passkit
119
127
  []
120
128
  end
121
129
 
130
+ def sharing_prohibited
131
+ false
132
+ end
133
+
122
134
  private
123
135
 
124
136
  def folder_name
@@ -13,6 +13,7 @@ module Passkit
13
13
  check_necessary_files
14
14
  create_temporary_directory
15
15
  copy_pass_to_tmp_location
16
+ @pass.instance.add_other_files(@temporary_path)
16
17
  clean_ds_store_files
17
18
  I18n.with_locale(@pass.language) do
18
19
  generate_json_pass
@@ -56,14 +57,14 @@ module Passkit
56
57
  description: @pass.description,
57
58
  logoText: @pass.logo_text,
58
59
  locations: @pass.locations,
59
- labelColor: @pass.label_color
60
- }
61
-
62
- pass = pass.merge({
60
+ labelColor: @pass.label_color,
61
+ sharingProhibited: @pass.sharing_prohibited,
63
62
  serialNumber: @pass.serial_number,
64
63
  passTypeIdentifier: @pass.pass_type_identifier,
65
64
  authenticationToken: @pass.authentication_token
66
- })
65
+ }
66
+
67
+ pass[:maxDistance] = @pass.max_distance if @pass.max_distance
67
68
 
68
69
  pass[@pass.pass_type] = {
69
70
  headerFields: @pass.header_fields,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Passkit
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-06 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
239
  requirements: []
240
- rubygems_version: 3.4.1
240
+ rubygems_version: 3.2.22
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: Serve Wallet Passes for iOS and Android directly from your Rails app