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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e76cc8afa937c6f3e48a31d58fc1b6e9b15aacaea6781fe80426cc081a22df7
4
- data.tar.gz: f49f9bd9d36deb5b9d827b07ce0aa828ef348cd0d86a4f88d3d06c052be280ca
3
+ metadata.gz: 1aa07641fb5e7daf2c529f4ec5abb083d9401de81e49b1f18b01124cab01d82e
4
+ data.tar.gz: 7e40438c2b564a9f6e97f334a32509759fdfae25f6b81930431ba6ff0297ade3
5
5
  SHA512:
6
- metadata.gz: 4719bc78b263558b72bb9071de558cc632e6fc52723029c9d24975ffcf2262e8264dbce9038b6442aa060e1c4b8851bc4fae3f488ee5748113a0ae081d2dbde4
7
- data.tar.gz: 49ed1a4e9423d54f3a8c38d4dc32a93a7807638acd87f4be4a71a2ba2ac7f53cf5c44b40647b85cbff34e222a8867e578cf751bbf9a981325cbb3a00e47c2886
6
+ metadata.gz: f3cb329cbc9ec183c8c15e9cc07256411a56d4b10af3219c2fceb1b55e2ec64c5ad31248f46a4e7a52c374b1cf1e3f68193e12ae15d45a06bf27ba396d4b013a
7
+ data.tar.gz: 7953bf969f8f53321260ad044936e2d02f864f1c65361cd87da81d573d7c91ff2c5ebacb6435fb33de134322ed94aaefed23fc0111280cbcfdacf7c8c96516d4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code-ruby (1.2.1)
4
+ code-ruby (1.2.2)
5
5
  activesupport
6
6
  base64
7
7
  bigdecimal
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.2.2
@@ -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["Authorization"] =
179
- "Basic #{::Base64.strict_encode64("#{username}:#{password}")}"
178
+ headers[
179
+ "Authorization"
180
+ ] = "Basic #{::Base64.strict_encode64("#{username}:#{password}")}"
180
181
  end
181
182
 
182
183
  request_class =
@@ -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.1
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.5.16
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: []