rasel 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rasel-annotated +1 -1
- data/bin/rasel-convert +1 -1
- data/bin/rasel-ide +2 -2
- data/lib/rasel.rb +1 -3
- data/rasel.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e92dd9f5a432fbb27899756bf1909f832164feb1
|
4
|
+
data.tar.gz: f990523da0477ec508bfd9bf6d3df742beebab27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f452fb7e3fafed5b26e25537c84613d20d4d0ee8973b58235c8eb6ed9374a7005921fdfdb751084fa43024724554f05cbf3edd7510daebc4cd823ad1c1d94435
|
7
|
+
data.tar.gz: a053ad0ae04e1c706e80dff4258aef378702df871ec1226dc175ab3774f7e0872215e01bf502d4b41599f87ab0b347f982bd7e59bced5b6e13c8881944bd949e
|
data/bin/rasel-annotated
CHANGED
data/bin/rasel-convert
CHANGED
@@ -11,7 +11,7 @@ end
|
|
11
11
|
abort_usage.call unless ARGV[0] and File.file? ARGV[0]
|
12
12
|
abort_usage.call unless ARGV[0] and ARGV[1] and (!File.exist?(ARGV[1]) || puts("overwriting")) || File.file?(ARGV[1])
|
13
13
|
|
14
|
-
require "json"
|
14
|
+
require "json/pure"
|
15
15
|
case ARGV.map &File.method(:extname)
|
16
16
|
when %w{ .rasel .rasela }
|
17
17
|
require_relative "../lib/rasel"
|
data/bin/rasel-ide
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
abort "usage:\trasel-ide <file.rasela>" unless 1 == ARGV.size
|
4
4
|
abort "invalid directory" unless File.directory? File.dirname File.expand_path ARGV.first
|
5
|
-
require "json"
|
5
|
+
require "json/pure"
|
6
6
|
require_relative "../lib/rasel"
|
7
7
|
RASEL.write_pretty_json ARGV.first, [[0,0,"@"]] unless File.exist? ARGV.first
|
8
8
|
abort "the argument should be a file" unless File.file? ARGV.first if File.exist? ARGV.first
|
@@ -269,7 +269,7 @@ post "/run" do
|
|
269
269
|
RASEL::run_annotated \
|
270
270
|
JSON.load(File.read ARGV.first),
|
271
271
|
StringIO.new,
|
272
|
-
StringIO.new.tap{ |_| JSON.
|
272
|
+
StringIO.new.tap{ |_| JSON.parse(params.fetch("stdin"), quirks_mode: true).bytes.reverse_each &_.method(:ungetbyte) }
|
273
273
|
end
|
274
274
|
JSON.dump({status: :success, data: [result.stdout.string.split("\n"), result.exitcode]})
|
275
275
|
rescue Timeout::Error
|
data/lib/rasel.rb
CHANGED
@@ -56,7 +56,6 @@ module RASEL
|
|
56
56
|
when ?A..?Z ; stack.push byte - 55
|
57
57
|
when ?" ; stringmode ^= true
|
58
58
|
when ?# ; move[]
|
59
|
-
when ?$ ; pop[]
|
60
59
|
when ?: ; stack.concat [pop[]] * 2
|
61
60
|
when ?- ; stack.push -(pop[] - pop[])
|
62
61
|
when ?/ ; b, a = pop[], pop[]; stack.push b.zero? ? 0 : Rational(a) / b
|
@@ -116,7 +115,7 @@ module RASEL
|
|
116
115
|
define_singleton_method :puts do |str, reason|
|
117
116
|
next if prev == dump = JSON.dump([reason, str])
|
118
117
|
old_puts.call prev = dump
|
119
|
-
if
|
118
|
+
if ENV.fetch("IDE_LIMIT_PRINTED", "500000").to_i < stdout.pos - pos
|
120
119
|
old_puts.call JSON.dump [:abort, "printed size"]
|
121
120
|
error.call
|
122
121
|
end
|
@@ -160,7 +159,6 @@ module RASEL
|
|
160
159
|
when ?A..?Z ; stack.push StackItem.new byte - 55, annotation
|
161
160
|
when ?" ; stringmode ^= true
|
162
161
|
when ?# ; move[]
|
163
|
-
when ?$ ; pop[]
|
164
162
|
when ?: ; popped = pop[]; stack.push popped; stack.push StackItem.new popped, annotation
|
165
163
|
when ?- ; stack.push StackItem.new -(pop[] - pop[]), annotation
|
166
164
|
when ?/ ; b, a = pop[], pop[]; stack.push StackItem.new b.zero? ? 0 : Rational(a) / b, annotation
|
data/rasel.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Maslov aka Nakilon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_pure
|