superscript 0.7.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/e2e/dsls/go.rb +15 -0
- data/e2e/test.rb +2 -0
- data/exe/superscript +12 -2
- data/lib/superscript/runner.rb +19 -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: b19663dfb05a7fbb830364787958acddcd1b3775b34602037859dbb68a760478
|
4
|
+
data.tar.gz: 6e5629534d4f07dfc6e66700d70ac3822ca981989b8e5c2e428e8a03139dc227
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03abe4121ccef1debd13a861b7c78eab5217390a8fe2a3c9be73b7be4508bb3e961bb66c5c87d7d876772ed084ad5596af7f826eba68bc3117f491712db1f867
|
7
|
+
data.tar.gz: 90369ee7481e75cacf420ea3b756ecd7dc1f47c276164649c3e7f695ec0a92e5d94ec37898e5145f811a4c72a33e6a16f6391e675158fb6bb230cf7fdf482d6e
|
data/Gemfile.lock
CHANGED
data/e2e/dsls/go.rb
CHANGED
@@ -3,6 +3,17 @@ 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
|
+
|
13
|
+
def hang
|
14
|
+
sleep 9999
|
15
|
+
end
|
16
|
+
|
6
17
|
def say(message)
|
7
18
|
puts message
|
8
19
|
end
|
@@ -19,6 +30,10 @@ class Go < Superscript::Dsl
|
|
19
30
|
asdf
|
20
31
|
end
|
21
32
|
|
33
|
+
def raise!
|
34
|
+
raise "raising!"
|
35
|
+
end
|
36
|
+
|
22
37
|
def exit
|
23
38
|
Kernel.exit
|
24
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
@@ -1,3 +1,7 @@
|
|
1
|
+
Signal.trap "TERM" do
|
2
|
+
exit 0
|
3
|
+
end
|
4
|
+
|
1
5
|
module Superscript
|
2
6
|
class Runner
|
3
7
|
def initialize path=nil, opts={}
|
@@ -14,27 +18,29 @@ module Superscript
|
|
14
18
|
|
15
19
|
def error!(where, *args)
|
16
20
|
puts "-- [ superscript error ] --"
|
17
|
-
error_message =
|
18
|
-
case where
|
21
|
+
exception, error_message = case where
|
19
22
|
when :exception
|
20
|
-
|
21
|
-
|
23
|
+
ex = args.first
|
24
|
+
[ex.class, ex]
|
22
25
|
when :tp_call_superscript, :tp_call_superscript_global
|
23
|
-
|
26
|
+
[:internal, "Can't touch this"]
|
24
27
|
when :ctx_method_missing, :tp_singleton_method_added, :tp_command_not_found
|
25
|
-
|
28
|
+
[:internal, args.first]
|
26
29
|
when :tp_class_define, :tp_module_define
|
27
|
-
|
30
|
+
[:internal, args.first]
|
28
31
|
else
|
29
32
|
pp [:unknown_where, where, args]
|
30
|
-
|
33
|
+
[:uknown, args.join(" ")]
|
31
34
|
end
|
32
35
|
|
33
|
-
puts error_message
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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>"
|
38
44
|
end
|
39
45
|
|
40
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.11.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-01-18 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: []
|