passkit 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: 6c3d8db0fdcb21bf1c79f1894074ba1bc36838e5d4ebf78076769cbcf28fb6ad
4
- data.tar.gz: 6338ff436da5f1dffc1b23078c98e74a14f25f2dd7f522491529ea2828ca76a4
3
+ metadata.gz: 7ae5fc20f42471a94fd3789e30d7da1a7f815d273ec2c4d5c8ebf06589065dd5
4
+ data.tar.gz: bf457cd34517e7abe73fe796ac830529124c355b96e7694008d9cc6f8ea658c2
5
5
  SHA512:
6
- metadata.gz: 3fb31540b3b4212b0a75dd3d162622efcef24a7e3fe128d45ed78bda2abced5274cf750d555d46559c1549e9773a7e95cd02135bc334540c6fdfbc245a1b6511
7
- data.tar.gz: 1780c34f7c9b7b1b8f6174898cede7a0a7a012c978172d134ebf12ce6e9bb895db89fe053eb590df76472ebb2f5999404fd02a2042686678434a392e87ec0c26
6
+ metadata.gz: 3408f1a7936e55f3a0b29332777951c78eb6a68d80f5189dc6b5a9a5ca908e7cce9d142f4bcb1df0ae0dbb33e68c6f78f5a2ed5c02a41b35571268e47bc489df
7
+ data.tar.gz: 493c69be73b1b37dbb56be7eb33008cf66893f865d98dbf9068c866ed042042e333cd0ca8e3ce82b6b28f57d372e75e0ab0f744651de39feec477cf297243f2c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.5.1]
2
+
3
+ - [#13](https://github.com/coorasse/passkit/pull/13): Added sharingProhibited
4
+ - [#13](https://github.com/coorasse/passkit/pull/13): Added maxDistance
5
+ - [#13](https://github.com/coorasse/passkit/pull/13): Allow custom files with add_other_files
6
+
1
7
  ## [0.5.0]
2
8
 
3
9
  - Allow configuring labelColor
@@ -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.1"
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.1
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-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails