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 +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/code/object/global.rb +7 -0
- data/lib/code/object/url.rb +26 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 863226aa89094a7ba1eaff88e1dbb209e93a09149e12f60849ea90122fdcf750
|
|
4
|
+
data.tar.gz: 84c2dbfcf70ba9ecd4bcbf5f7a5b9cabe1ccaaf2173d69648907b3da723b3968
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8026a99f580dacac3bc10d30a97b0e3ee2a34d94e1a61773a0ed55f1b79981076255308fdf9aeabbafbdd77cde5ad884275d5b542f6b785937576f0b3bff8896
|
|
7
|
+
data.tar.gz: b474157be88e84ef3661f17ba1b73447ec16f8c140d478e3def89f7471c57b3958f3d1a30dcbfd7391935628c4a0d4103dfab709df25cd44e3099dbc5b8ceac0
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.7.
|
|
1
|
+
1.7.8
|
data/lib/code/object/global.rb
CHANGED
|
@@ -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.
|
|
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
|