datauris 1.1.0 → 1.2.0

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: 7709f8cf824f237c4aed38259191ecb6fd4cf39d3b29664a93ea1ee16902f492
4
- data.tar.gz: 8961a0856b232df9c7a5995db91e4f4ae08c072e7d4d655d51ae0be6b8226009
3
+ metadata.gz: ab2d170cf6bfa2e0cfac039e523acb19fe18fad89fd297185a1047f1819ffdc5
4
+ data.tar.gz: '0419a2803baa32773809ead98488fdf8dc5e5a7b4ec34413799008ee922692e7'
5
5
  SHA512:
6
- metadata.gz: 85584d023850013b98801c46775c5a43ea76d08eedef815457921684063081a0786517919190c1b9c0b2fbd2d9923773739c0f029338d78d44fcfe88513b9459
7
- data.tar.gz: e4a6796902329a3efb962f3733012bbce8b9dd2baf2f315f92b033e41c627630a4ef5c0981368c84526623ed9226bd573e7f079cae6b03c0beb3f0382cdc98d8
6
+ metadata.gz: 2bfc64e92ac81ff9cfe789069886482d19232e23899cd02e083abb52d0cc92ec30f94f9618506ff092b3143fbe0623881efaf9d938330603ef8d23efaaf1a898
7
+ data.tar.gz: 2c3ff3a3a2e31c588786aed7250e7eb107fac1fb5c506b3cc5d3b4f8a47a94db68bcbc2cbabf04423480020c9c0febe9aa4bf161cdbdf2b3b34386c781dfbe12
data/CHANGELOG.md CHANGED
@@ -1,4 +1,5 @@
1
- ### 1.1.0
1
+ ### 1.2.0
2
+ ### 1.1.1
2
3
  ### 0.0.1 / 2023-11-23
3
4
 
4
5
  * Everything is new. First release
data/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  datauris - helpers to parse (decode) and build (encode) data uris incl. (strict) base64-encoded/decoded images and more
4
4
 
5
- * home :: [github.com/s6ruby/rubidity](https://github.com/s6ruby/rubidity)
6
- * bugs :: [github.com/s6ruby/rubidity/issues](https://github.com/s6ruby/rubidity/issues)
5
+ * home :: [github.com/0xCompute/ethscribe](https://github.com/0xCompute/ethscribe)
6
+ * bugs :: [github.com/0xCompute/ethscribe/issues](https://github.com/0xCompute/ethscribe/issues)
7
7
  * gem :: [rubygems.org/gems/datauris](https://rubygems.org/gems/datauris)
8
8
  * rdoc :: [rubydoc.info/gems/datauris](http://rubydoc.info/gems/datauris)
9
9
 
@@ -167,7 +167,9 @@ at the ruby code commons (rubycocos) org.
167
167
 
168
168
  ## Questions? Comments?
169
169
 
170
- Join us in the [Rubidity (community) discord (chat server)](https://discord.gg/3JRnDUap6y). Yes you can.
170
+ Join us in the [0xCompute discord (chat server)](https://discord.gg/3JRnDUap6y)
171
+ (or in the more general Ethscription discord).
172
+ Yes you can.
171
173
  Your questions and commentary welcome.
172
174
 
173
175
  Or post them over at the [Help & Support](https://github.com/geraldb/help) page. Thanks.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ Hoe.spec 'datauris' do
8
8
  self.summary = "datauris gem - DataUri helpers to parse (decode) and build (encode) data uris incl. (strict) base64-encoded/decoded images and more"
9
9
  self.description = summary
10
10
 
11
- self.urls = { home: 'https://github.com/s6ruby/rubidity' }
11
+ self.urls = { home: 'https://github.com/0xCompute/ethscribe' }
12
12
 
13
13
  self.author = 'Gerald Bauer'
14
14
  self.email = 'gerald.bauer@gmail.com'
@@ -1,7 +1,7 @@
1
1
 
2
2
  module DataUri
3
- MAJOR = 1 ## todo: namespace inside version or something - why? why not??
4
- MINOR = 1
3
+ MAJOR = 1 ## todo: namespace inside version or something - why? why not??
4
+ MINOR = 2
5
5
  PATCH = 0
6
6
  VERSION = [MAJOR,MINOR,PATCH].join('.')
7
7
 
data/lib/datauris.rb CHANGED
@@ -57,9 +57,13 @@ module DataUri
57
57
  (?<extension>base64|utf8)
58
58
  )?
59
59
  ,
60
- (?<data>.*)
60
+ (?<data>
61
+ (?:.|[\n\r])*
62
+ )
61
63
  \z
62
64
  }x
65
+
66
+ ## note (?<data>.*) - . (dot) will NOT include newlines!!!
63
67
 
64
68
 
65
69
  def self._parse( str ) REGEX.match( str ); end
@@ -172,8 +176,8 @@ module DataUri
172
176
  ## utf8 - or force utf8 encoding (utf8: true)
173
177
  ## uri - or force STOPPING uri encoding (uri: false)
174
178
  def self.build( data, type=nil, base64: nil, utf8: nil, uri: nil )
175
- uri = "data:"
176
- uri += type if type ## note: allow optional / no type
179
+ str = "data:"
180
+ str += type if type ## note: allow optional / no type
177
181
 
178
182
  ## puts " type: #{type.inspect}, base64: #{base64.inspect}"
179
183
 
@@ -195,9 +199,9 @@ module DataUri
195
199
  end
196
200
 
197
201
  if base64
198
- uri += ";base64," + Base64.strict_encode64( data )
202
+ str += ";base64," + Base64.strict_encode64( data )
199
203
  elsif utf8
200
- uri += ";utf8," + data
204
+ str += ";utf8," + data
201
205
  else
202
206
  ## use encode_uri_component by default - why? why not?
203
207
  ## space becomes %20
@@ -205,7 +209,7 @@ module DataUri
205
209
  ## , becomes %2C and so on
206
210
  ##
207
211
  ## note: use uri: false to turn of uri encode!!!
208
- uri += "," + (uri == false ? data : encode_uri( data ))
212
+ str += "," + (uri == false ? data : encode_uri( data ))
209
213
  end
210
214
  end
211
215
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datauris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-27 00:00:00.000000000 Z
11
+ date: 2024-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '4.0'
39
+ version: '4.1'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '4.0'
46
+ version: '4.1'
47
47
  description: datauris gem - DataUri helpers to parse (decode) and build (encode)
48
48
  data uris incl. (strict) base64-encoded/decoded images and more
49
49
  email: gerald.bauer@gmail.com
@@ -61,7 +61,7 @@ files:
61
61
  - lib/datauri.rb
62
62
  - lib/datauris.rb
63
63
  - lib/datauris/version.rb
64
- homepage: https://github.com/s6ruby/rubidity
64
+ homepage: https://github.com/0xCompute/ethscribe
65
65
  licenses:
66
66
  - Public Domain
67
67
  metadata: {}