code-ruby 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/code/object/http.rb +4 -3
- data/lib/code/object/list.rb +13 -0
- metadata +2 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aa07641fb5e7daf2c529f4ec5abb083d9401de81e49b1f18b01124cab01d82e
|
4
|
+
data.tar.gz: 7e40438c2b564a9f6e97f334a32509759fdfae25f6b81930431ba6ff0297ade3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3cb329cbc9ec183c8c15e9cc07256411a56d4b10af3219c2fceb1b55e2ec64c5ad31248f46a4e7a52c374b1cf1e3f68193e12ae15d45a06bf27ba396d4b013a
|
7
|
+
data.tar.gz: 7953bf969f8f53321260ad044936e2d02f864f1c65361cd87da81d573d7c91ff2c5ebacb6435fb33de134322ed94aaefed23fc0111280cbcfdacf7c8c96516d4
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/lib/code/object/http.rb
CHANGED
@@ -11,7 +11,7 @@ class Code
|
|
11
11
|
body: String.maybe,
|
12
12
|
username: String.maybe,
|
13
13
|
password: String.maybe,
|
14
|
-
data: Dictionary.maybe
|
14
|
+
data: Dictionary.maybe
|
15
15
|
}
|
16
16
|
].freeze
|
17
17
|
|
@@ -175,8 +175,9 @@ class Code
|
|
175
175
|
http.use_ssl = true if uri.scheme == "https"
|
176
176
|
|
177
177
|
if username.present? || password.present?
|
178
|
-
headers[
|
179
|
-
"
|
178
|
+
headers[
|
179
|
+
"Authorization"
|
180
|
+
] = "Basic #{::Base64.strict_encode64("#{username}:#{password}")}"
|
180
181
|
end
|
181
182
|
|
182
183
|
request_class =
|
data/lib/code/object/list.rb
CHANGED
@@ -42,6 +42,9 @@ class Code
|
|
42
42
|
when "first"
|
43
43
|
sig(args) { Integer.maybe }
|
44
44
|
code_first(code_value)
|
45
|
+
when "sample"
|
46
|
+
sig(args) { Integer.maybe }
|
47
|
+
code_sample(code_value)
|
45
48
|
when "flatten"
|
46
49
|
sig(args) { Integer.maybe }
|
47
50
|
code_flatten
|
@@ -167,6 +170,16 @@ class Code
|
|
167
170
|
end
|
168
171
|
end
|
169
172
|
|
173
|
+
def code_sample(value = nil)
|
174
|
+
code_value = value.to_code
|
175
|
+
|
176
|
+
if code_value.nothing?
|
177
|
+
raw.sample || Nothing.new
|
178
|
+
else
|
179
|
+
List.new(raw.sample(code_value.raw))
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
170
183
|
def code_flatten(level = nil)
|
171
184
|
code_level = level.to_code
|
172
185
|
code_level = Integer.new(-1) if code_level.nothing?
|
metadata
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
10
|
date: 2025-01-03 00:00:00.000000000 Z
|
@@ -315,7 +314,6 @@ licenses:
|
|
315
314
|
- MIT
|
316
315
|
metadata:
|
317
316
|
rubygems_mfa_required: 'true'
|
318
|
-
post_install_message:
|
319
317
|
rdoc_options: []
|
320
318
|
require_paths:
|
321
319
|
- lib
|
@@ -330,8 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
330
328
|
- !ruby/object:Gem::Version
|
331
329
|
version: '0'
|
332
330
|
requirements: []
|
333
|
-
rubygems_version: 3.
|
334
|
-
signing_key:
|
331
|
+
rubygems_version: 3.6.2
|
335
332
|
specification_version: 4
|
336
333
|
summary: a programming language for the internet
|
337
334
|
test_files: []
|