code-ruby 1.7.7 → 1.7.8

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: 1d6e6133a4a8c1e64b606ebbb56c50041a94876bf1363f04a782db9e34bd4b8f
4
- data.tar.gz: 78a08f8aaf79aee31f2a0908f632493cb01040980503d53a20e4c0f004b1aa5a
3
+ metadata.gz: 863226aa89094a7ba1eaff88e1dbb209e93a09149e12f60849ea90122fdcf750
4
+ data.tar.gz: 84c2dbfcf70ba9ecd4bcbf5f7a5b9cabe1ccaaf2173d69648907b3da723b3968
5
5
  SHA512:
6
- metadata.gz: ba57b18b11ee5834b929d733abfa48e4eec7f7d4c7713f8ee9f82f96e2a81114cb58993d7e4fe3abcb1ec0634941b415aff3c9ba68b38286af1f59dcffa7c0e7
7
- data.tar.gz: f7a9b8613f16106c283323abb53ca1919c45fbf3480b2f4a41fa2aab522c1790ba6c9d63cac945a5ada25d09bd908f56a15cb8aa66f02d697e1644c7a28bfa11
6
+ metadata.gz: 8026a99f580dacac3bc10d30a97b0e3ee2a34d94e1a61773a0ed55f1b79981076255308fdf9aeabbafbdd77cde5ad884275d5b542f6b785937576f0b3bff8896
7
+ data.tar.gz: b474157be88e84ef3661f17ba1b73447ec16f8c140d478e3def89f7471c57b3958f3d1a30dcbfd7391935628c4a0d4103dfab709df25cd44e3099dbc5b8ceac0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code-ruby (1.7.7)
4
+ code-ruby (1.7.8)
5
5
  activesupport
6
6
  base64
7
7
  bigdecimal
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.7
1
+ 1.7.8
@@ -176,6 +176,13 @@ class Code
176
176
  else
177
177
  Class.new(Number)
178
178
  end
179
+ when "Url"
180
+ sig(args) { Object.repeat }
181
+ if code_arguments.any?
182
+ Url.new(*code_arguments.raw)
183
+ else
184
+ Class.new(Url)
185
+ end
179
186
  else
180
187
  code_context = code_context.code_lookup!(code_operator)
181
188
  code_result = code_context.code_fetch(code_operator)
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Code
4
+ class Object
5
+ class Url < Object
6
+ def self.call(**args)
7
+ code_operator = args.fetch(:operator, nil).to_code
8
+ code_arguments = args.fetch(:arguments, []).to_code
9
+
10
+ case code_operator.to_s
11
+ when "encode"
12
+ sig(args) { Object.maybe }
13
+ code_encode(*code_arguments.raw)
14
+ else
15
+ super
16
+ end
17
+ end
18
+
19
+ def self.code_encode(string = nil)
20
+ code_string = string.to_code
21
+
22
+ String.new(CGI.escape(string.to_s))
23
+ end
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7
4
+ version: 1.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
@@ -283,6 +283,7 @@ files:
283
283
  - lib/code/object/smtp.rb
284
284
  - lib/code/object/string.rb
285
285
  - lib/code/object/time.rb
286
+ - lib/code/object/url.rb
286
287
  - lib/code/parser.rb
287
288
  - lib/code/parser/addition.rb
288
289
  - lib/code/parser/and_operator.rb