as2 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/lib/as2/version.rb +1 -1
  4. data/lib/as2.rb +11 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96ec1c65d6997fc278267320f6228096129a87752c52127fdf2c9a6d6b1a8b43
4
- data.tar.gz: b9305a892d2833a59ee286567132cee1b060936ae1f87f80d0de36a6660a6d2b
3
+ metadata.gz: e5d44130a76edfd15f3938df800fd0b82a0a14446ed064844250c33f0ba28c0c
4
+ data.tar.gz: b2436bd0539cefe5387e08042ba5bf1798282515c17d6c884eda08c7e9abd913
5
5
  SHA512:
6
- metadata.gz: 0c0aab2fb5d4282559cd0938d0bc540f0061a65d1a5eba7aa8f067a1f85fa746e599afeac5a9a4567456a737f2242bb73748b8460e4e398d612410536a3cafb8
7
- data.tar.gz: 480ecc3810c376168a5778612c67c2db4eac48c0ea2da2fb782ba247ff0bc6400765b9b98b2835a7da9cd62d7cfdc37043dbee5b1278d3618c7782cd150b2182
6
+ metadata.gz: c7ec66eff025813c21849d375933cef2e06c70ae658363ffce640d22ea72be73650908862307380e70da03510765016b99bf60a65f6f56f432d4e3381eab8ee4
7
+ data.tar.gz: 5f9747317e5675e292ea80f02b01de73a0d14e78c60236970f81a8a68a3cefb0535b2bd9c4d2b6fee7e95399746fd773f40de5481db2975fe2f21c9ce5c7178e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.9.0, August 28, 2023
2
+
3
+ * Bugfix for quoting AS2-From/AS2-To identifiers
4
+ * Add utility method for un-quoting identifiers
5
+
6
+ both implemented in [#33](https://github.com/alexdean/as2/pull/33)
7
+
1
8
  ## 0.8.0, August 25, 2023
2
9
 
3
10
  * Quote AS2-From/AS2-To identifiers which contain spaces. [#30](https://github.com/alexdean/as2/pull/30)
data/lib/as2/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module As2
2
- VERSION = "0.8.0"
2
+ VERSION = "0.9.0"
3
3
  end
data/lib/as2.rb CHANGED
@@ -38,10 +38,20 @@ module As2
38
38
 
39
39
  # surround an As2-From/As2-To value with double-quotes, if it contains a space.
40
40
  def self.quoted_system_identifier(name)
41
- if name.to_s.include?(' ')
41
+ if name.to_s.include?(' ') && !name.to_s.start_with?('"')
42
42
  "\"#{name}\""
43
43
  else
44
44
  name
45
45
  end
46
46
  end
47
+
48
+ # remove double-quotes from an As2-From/As2-To value, if it contains any.
49
+ # this is useful in client code which may not automatically strip these quotes from a header value.
50
+ def self.unquoted_system_identifier(name)
51
+ if !name.is_a?(String)
52
+ return name
53
+ end
54
+
55
+ name.delete_prefix('"').delete_suffix('"').gsub('\"', '"')
56
+ end
47
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: as2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OfficeLuv
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-08-25 00:00:00.000000000 Z
12
+ date: 2023-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mail