zatca 0.1.0 → 0.1.1
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 +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +3 -3
- data/README.md +7 -7
- data/lib/zatca/tag.rb +6 -3
- data/lib/zatca/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c25f54eab0d4d04d55d789f691e1143762a4a7e9a62448f57a8ff88571b443c4
|
|
4
|
+
data.tar.gz: 13ddbc1574fcccd916a0123a9b9fed53aa611dbcc26df917eaf478092aa74edd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abd3917c3ac3de9673f25c65628ab0e61c74da1a0ac9f9e253e87fe50ce4d6cfe284cd0ede5c0ad7e84e5b28fae5d84c6b1ae0921ad0c590d3cd912de2b99d3a
|
|
7
|
+
data.tar.gz: e5053c248cc3ba0121b6bb2be7145730ea1e862104cfdd845a67d20ff898061f81a5393b8ae83aa6335c4370f9dee7f0077571f1065bb84341a036a2a7bc33ac
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zatca
|
|
4
|
+
zatca (0.1.1)
|
|
5
5
|
dry-schema (~> 1.5)
|
|
6
6
|
rqrcode (~> 2.1.0)
|
|
7
7
|
zeitwerk (~> 2.4)
|
|
@@ -94,7 +94,7 @@ DEPENDENCIES
|
|
|
94
94
|
rake (~> 13.0)
|
|
95
95
|
rspec (~> 3.10)
|
|
96
96
|
standard (~> 1.3)
|
|
97
|
-
zatca
|
|
97
|
+
zatca!
|
|
98
98
|
|
|
99
99
|
BUNDLED WITH
|
|
100
|
-
2.2.
|
|
100
|
+
2.2.30
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# zatca
|
|
2
|
-
 
|
|
3
3
|
|
|
4
|
-
[🚧 Still being validated by ZATCA](https://github.com/mrsool/zatca
|
|
4
|
+
[🚧 Still being validated by ZATCA](https://github.com/mrsool/zatca/issues/3).
|
|
5
5
|
|
|
6
6
|
A Ruby library for generating QR Codes for the e-invoice standard by ZATCA in Saudi Arabia.
|
|
7
7
|
|
|
@@ -9,18 +9,18 @@ A Ruby library for generating QR Codes for the e-invoice standard by ZATCA in Sa
|
|
|
9
9
|
|
|
10
10
|
## Rubygems
|
|
11
11
|
```sh
|
|
12
|
-
gem install zatca
|
|
12
|
+
gem install zatca
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Bundler
|
|
16
16
|
```sh
|
|
17
|
-
bundle add zatca
|
|
17
|
+
bundle add zatca
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
# Usage
|
|
21
21
|
|
|
22
22
|
```rb
|
|
23
|
-
require "zatca
|
|
23
|
+
require "zatca"
|
|
24
24
|
|
|
25
25
|
tags = {
|
|
26
26
|
seller_name: "Mrsool",
|
|
@@ -38,7 +38,7 @@ ZATCA.render_qr_code(tags)
|
|
|
38
38
|
If you'd like to customize the size of the QR Code you can manually use the generator like so:
|
|
39
39
|
|
|
40
40
|
```rb
|
|
41
|
-
require "zatca
|
|
41
|
+
require "zatca"
|
|
42
42
|
|
|
43
43
|
tags = ZATCA::Tags.new({
|
|
44
44
|
seller_name: "Mrsool",
|
data/lib/zatca/tag.rb
CHANGED
|
@@ -22,10 +22,13 @@ module ZATCA
|
|
|
22
22
|
|
|
23
23
|
def to_tlv
|
|
24
24
|
# TLV should be concatenated together without any separator in the following
|
|
25
|
-
# format:
|
|
26
|
-
#
|
|
25
|
+
# format: character_value_of_id character_value_of_value_length value_itself
|
|
26
|
+
# All of this should be in 8-bit ASCII.
|
|
27
|
+
tlv = @id.chr + @value.length.chr + value
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
# We need to use force_encoding because encode will raise errors when
|
|
30
|
+
# trying to encode a string with utf-8 characters.
|
|
31
|
+
tlv.force_encoding("ASCII-8BIT")
|
|
29
32
|
end
|
|
30
33
|
end
|
|
31
34
|
end
|
data/lib/zatca/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zatca
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Omar Bahareth
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-11-
|
|
11
|
+
date: 2021-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: zeitwerk
|
|
@@ -116,13 +116,13 @@ files:
|
|
|
116
116
|
- lib/zatca/tags.rb
|
|
117
117
|
- lib/zatca/tags_schema.rb
|
|
118
118
|
- lib/zatca/version.rb
|
|
119
|
-
homepage: https://github.com/mrsool/zatca
|
|
119
|
+
homepage: https://github.com/mrsool/zatca
|
|
120
120
|
licenses: []
|
|
121
121
|
metadata:
|
|
122
122
|
allowed_push_host: https://rubygems.org
|
|
123
|
-
homepage_uri: https://github.com/mrsool/zatca
|
|
124
|
-
source_code_uri: https://github.com/mrsool/zatca
|
|
125
|
-
changelog_uri: https://github.com/mrsool/zatca
|
|
123
|
+
homepage_uri: https://github.com/mrsool/zatca
|
|
124
|
+
source_code_uri: https://github.com/mrsool/zatca
|
|
125
|
+
changelog_uri: https://github.com/mrsool/zatca/releases
|
|
126
126
|
post_install_message:
|
|
127
127
|
rdoc_options: []
|
|
128
128
|
require_paths:
|