superscript 0.7.1 → 0.12.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/Gemfile.lock +1 -1
- data/e2e/dsls/go.rb +11 -0
- data/e2e/test.rb +2 -0
- data/exe/superscript +12 -2
- data/lib/superscript/runner.rb +15 -13
- data/lib/superscript/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d539fcca3e8c2289be387553d9e838050b37c4f23fe16826c1252c60724715d
|
4
|
+
data.tar.gz: 74270a76bae0a76dc0c1c569e80083b1f049f43e35740e0b9d92c32fec867df7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53662b74f3ddb16684de30ecb1564dae655263b6a6d51a31e4d4555142b9e295242b141de52dfedb4e4787ae172816733ab7f837a3130d13ddcd91825339ed37
|
7
|
+
data.tar.gz: 0feeeccbb253a01a46183a1dee7be29a2e389dc25e9656d9bea018e6fb1ba5bfd14e1e0e16acf53e5d33f80e7a22662db45079ae082f273d85d46a5216765fa5
|
data/Gemfile.lock
CHANGED
data/e2e/dsls/go.rb
CHANGED
@@ -3,6 +3,13 @@ class Go < Superscript::Dsl
|
|
3
3
|
self.say "Go #{args.join(" ")}!"
|
4
4
|
end
|
5
5
|
|
6
|
+
def loop &block
|
7
|
+
::Kernel.loop do
|
8
|
+
block.call
|
9
|
+
sleep 1
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
6
13
|
def hang
|
7
14
|
sleep 9999
|
8
15
|
end
|
@@ -23,6 +30,10 @@ class Go < Superscript::Dsl
|
|
23
30
|
asdf
|
24
31
|
end
|
25
32
|
|
33
|
+
def raise!
|
34
|
+
raise "raising!"
|
35
|
+
end
|
36
|
+
|
26
37
|
def exit
|
27
38
|
Kernel.exit
|
28
39
|
end
|
data/e2e/test.rb
CHANGED
data/exe/superscript
CHANGED
@@ -32,10 +32,20 @@ if ARGV[1]
|
|
32
32
|
runner = Superscript::Runner.new ARGV[1], options
|
33
33
|
runner.run! ctx
|
34
34
|
else
|
35
|
+
require "readline"
|
36
|
+
|
35
37
|
runner = Superscript::Runner.new nil, options
|
36
38
|
loop do
|
37
|
-
|
38
|
-
contents
|
39
|
+
contents = Readline.readline "> ", true
|
40
|
+
next if contents == ""
|
41
|
+
|
42
|
+
if contents == nil
|
43
|
+
puts "\n-- press ^D to end input"
|
44
|
+
contents = $stdin.readlines.join("\n")
|
45
|
+
end
|
46
|
+
|
47
|
+
next if contents == ""
|
48
|
+
|
39
49
|
value = runner.run! ctx, contents: contents
|
40
50
|
puts " => #{value.inspect}"
|
41
51
|
end
|
data/lib/superscript/runner.rb
CHANGED
@@ -18,27 +18,29 @@ module Superscript
|
|
18
18
|
|
19
19
|
def error!(where, *args)
|
20
20
|
puts "-- [ superscript error ] --"
|
21
|
-
error_message =
|
22
|
-
case where
|
21
|
+
exception, error_message = case where
|
23
22
|
when :exception
|
24
|
-
|
25
|
-
|
23
|
+
ex = args.first
|
24
|
+
[ex.class, ex.message]
|
26
25
|
when :tp_call_superscript, :tp_call_superscript_global
|
27
|
-
|
26
|
+
[:internal, "Can't touch this"]
|
28
27
|
when :ctx_method_missing, :tp_singleton_method_added, :tp_command_not_found
|
29
|
-
|
28
|
+
[:internal, args.first]
|
30
29
|
when :tp_class_define, :tp_module_define
|
31
|
-
|
30
|
+
[:internal, args.first]
|
32
31
|
else
|
33
32
|
pp [:unknown_where, where, args]
|
34
|
-
|
33
|
+
[:uknown, args.join(" ")]
|
35
34
|
end
|
36
35
|
|
37
|
-
puts error_message
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
puts "#{exception}: #{error_message}"
|
37
|
+
|
38
|
+
# caller.each do |c|
|
39
|
+
# puts c
|
40
|
+
# end
|
41
|
+
system @on_error_exec, error_message if @on_error_exec
|
42
|
+
|
43
|
+
exit 1 unless @path == "<interactive>"
|
42
44
|
end
|
43
45
|
|
44
46
|
def arm!(reason=nil)
|
data/lib/superscript/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superscript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matti Paksula
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -85,7 +85,7 @@ homepage: https://github.com/matti/superscript
|
|
85
85
|
licenses:
|
86
86
|
- MIT
|
87
87
|
metadata: {}
|
88
|
-
post_install_message:
|
88
|
+
post_install_message:
|
89
89
|
rdoc_options: []
|
90
90
|
require_paths:
|
91
91
|
- lib
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubygems_version: 3.0.8
|
104
|
-
signing_key:
|
104
|
+
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: superscript
|
107
107
|
test_files: []
|