drain 0.4 → 0.5

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: 879680e62956b55119d14b0c5c334c1836c26b8922db6eaf12539c21fd1ccd76
4
- data.tar.gz: 00134a0c8b8cb4e79aa8e2be089244864e46084c338917890caed1ae1e9abfc7
3
+ metadata.gz: d31dbf8873c5769a2f758b783609b0b593a0991b8aa7711756ccb196fa4d3f39
4
+ data.tar.gz: 29dfad85aa000d62587676bc0ae64bb0a13d84d4b239f78575e00f7a6082a835
5
5
  SHA512:
6
- metadata.gz: 5a9f6e1b457a54666f1fc2441d2104322811fc8c87f1857079092fdea94c1d819aadd63ee839b6a55c1ecb2c90a4260f53b3f6c3ecfd9e98a017a85c698e2107
7
- data.tar.gz: c01a56879bf4e5558f461ad5c1a35582db768d6d62421cb62142061774a3bfbf8e8c3460fbdee6c0c26b816d7effd864b1cd0ab3be01bf3b541b4d2e6dc093bd
6
+ metadata.gz: 21f21f6b9da3da37e89766eaf44291f4d2d75d5392867051e664659deaeeef54e30cbdd3f158e37ae9218b8cd42205a88118c837480662c74f1fcf0960892ebc
7
+ data.tar.gz: 79f1917f7626dfd13b083e8f9f7be32bbbf619e36d18e4e69cc8e3e9586f9057dfe9547d92666d768388f88b8a5c4ac2e13c3dc9de420e872a7e7bcc435c0f82
@@ -1,4 +1,4 @@
1
- Copyright © 2015–2018 Damien Robert
1
+ Copyright © 2015–2020 Damien Robert
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -226,7 +226,7 @@ module DR
226
226
 
227
227
  # allow a hash too
228
228
  def |(graph)
229
- graph=Graph.new(graph) unless Graph===graph
229
+ graph=Graph.new(graph, **{}) unless Graph===graph
230
230
  build(*graph.all, recursive: false)
231
231
  end
232
232
  def +(graph)
@@ -55,7 +55,7 @@ module URI
55
55
  class Generic < ::URI::Generic
56
56
  # check_host returns `false` for 'foo_bar'
57
57
  # but in ssh config this can be a valid host
58
- def check_host(v)
58
+ def check_host(_v)
59
59
  return true
60
60
  end
61
61
  # @example
@@ -83,6 +83,19 @@ module DR
83
83
  # TODO: wrap to= to add user= and host=
84
84
  end
85
85
 
86
+ # reimplement deprecated escape and unescape methods since
87
+ # URI.encode_www_form_component does not encode the same way
88
+ # cf the source code of URI::DEFAULT_PARSER.escape
89
+ module URI
90
+ extend self
91
+ def escape(*arg)
92
+ URI::DEFAULT_PARSER.escape(*arg)
93
+ end
94
+ def unescape(*arg)
95
+ URI::DEFAULT_PARSER.unescape(*arg)
96
+ end
97
+ end
98
+
86
99
  module URIlikeWrapper
87
100
  def to_h
88
101
  h = { uri: uri }
@@ -172,10 +185,12 @@ module DR
172
185
  uri.define_singleton_method(m) do
173
186
  r = super()
174
187
  r && r.is_a?(String) ? URI.unescape(r) : r
188
+ # r && r.is_a?(String) ? ::URI.decode_www_form_component(r) : r
175
189
  end
176
190
  uri.define_singleton_method(:"#{m}=") do |v|
177
191
  begin
178
192
  super(v && v.is_a?(String) ? URI.escape(v) : v)
193
+ # super(v && v.is_a?(String) ? ::URI.encode_www_form_component(v) : v)
179
194
  rescue URI::InvalidURIError => e
180
195
  warn "#{e} in (#{self}).#{m}=#{v}"
181
196
  # require 'pry'; binding.pry
@@ -1,4 +1,4 @@
1
1
  module DR
2
2
  # drain version
3
- VERSION = "0.4"
3
+ VERSION = "0.5"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drain
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.4'
4
+ version: '0.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Robert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-13 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.0.6
146
+ rubygems_version: 3.1.2
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Use a drain for a dryer ruby!