code-ruby 0.3.1 → 0.4.0
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/CHANGELOG.md +5 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +8 -8
- data/code-ruby.gemspec +0 -3
- data/lib/code/error.rb +3 -0
- data/lib/code/node/call.rb +1 -0
- data/lib/code/node/chained_call.rb +4 -2
- data/lib/code/node/list.rb +2 -3
- data/lib/code/node/name.rb +7 -34
- data/lib/code/node/statement.rb +1 -1
- data/lib/code/node/string.rb +9 -4
- data/lib/code/node/string_component.rb +6 -6
- data/lib/code/node.rb +2 -2
- data/lib/code/object/argument.rb +1 -1
- data/lib/code/object/decimal.rb +99 -27
- data/lib/code/object/dictionnary.rb +29 -13
- data/lib/code/object/function.rb +11 -9
- data/lib/code/object/global.rb +37 -0
- data/lib/code/object/integer.rb +99 -35
- data/lib/code/object/list.rb +62 -89
- data/lib/code/object/range.rb +33 -46
- data/lib/code/object/ruby_function.rb +25 -0
- data/lib/code/object/string.rb +25 -15
- data/lib/code/object.rb +51 -49
- data/lib/code/parser/function.rb +3 -1
- data/lib/code/parser/if.rb +1 -1
- data/lib/code/parser/string.rb +8 -8
- data/lib/code/ruby.rb +161 -0
- data/lib/code-ruby.rb +6 -0
- data/lib/code.rb +20 -6
- data/lib/template/version.rb +1 -1
- data/lib/template-ruby.rb +6 -0
- data/lib/template.rb +24 -9
- data/spec/code/parser/string_spec.rb +1 -1
- data/spec/code_spec.rb +63 -1
- data/spec/template_spec.rb +25 -6
- data/template-ruby.gemspec +0 -3
- metadata +5 -30
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -52,34 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.6'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: prettier
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '3'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '3'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3'
|
83
55
|
description: 'A programming language, like Code.evaluate("1 + 1") # => 2'
|
84
56
|
email: dorian@dorianmarie.fr
|
85
57
|
executables: []
|
@@ -160,11 +132,13 @@ files:
|
|
160
132
|
- lib/code/object/decimal.rb
|
161
133
|
- lib/code/object/dictionnary.rb
|
162
134
|
- lib/code/object/function.rb
|
135
|
+
- lib/code/object/global.rb
|
163
136
|
- lib/code/object/integer.rb
|
164
137
|
- lib/code/object/list.rb
|
165
138
|
- lib/code/object/nothing.rb
|
166
139
|
- lib/code/object/number.rb
|
167
140
|
- lib/code/object/range.rb
|
141
|
+
- lib/code/object/ruby_function.rb
|
168
142
|
- lib/code/object/string.rb
|
169
143
|
- lib/code/parser.rb
|
170
144
|
- lib/code/parser/addition.rb
|
@@ -201,6 +175,7 @@ files:
|
|
201
175
|
- lib/code/parser/ternary.rb
|
202
176
|
- lib/code/parser/unary_minus.rb
|
203
177
|
- lib/code/parser/while.rb
|
178
|
+
- lib/code/ruby.rb
|
204
179
|
- lib/template-ruby.rb
|
205
180
|
- lib/template.rb
|
206
181
|
- lib/template/node.rb
|