superscript 0.7.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffe0b4ebe0293d4f1929e603f3398beaf595ee2d3ad6b614c59dc418326ffa99
4
- data.tar.gz: 672c01d8cfb4d6fec56a87c22e8c5b1e896c01e41d24938aa5dd6caed095ef02
3
+ metadata.gz: 7d539fcca3e8c2289be387553d9e838050b37c4f23fe16826c1252c60724715d
4
+ data.tar.gz: 74270a76bae0a76dc0c1c569e80083b1f049f43e35740e0b9d92c32fec867df7
5
5
  SHA512:
6
- metadata.gz: 657b3ce56e1e07133822ef98beaafdef6fad8d05313a1a2a2bf1d4f759d9e03943a186b2d9a39d883fd1263c2f58c792f94d6e423ab91a2081fbcee88a2d471c
7
- data.tar.gz: ac53cba3843bdcdd6a1ad5f8ee050c390a9a5f1deaede9bdbc051d6eb096f2a7eb45943745b3cf1116fd04c80b199ef304d9988d8c5f2b9e27b624b6dfef63ae
6
+ metadata.gz: 53662b74f3ddb16684de30ecb1564dae655263b6a6d51a31e4d4555142b9e295242b141de52dfedb4e4787ae172816733ab7f837a3130d13ddcd91825339ed37
7
+ data.tar.gz: 0feeeccbb253a01a46183a1dee7be29a2e389dc25e9656d9bea018e6fb1ba5bfd14e1e0e16acf53e5d33f80e7a22662db45079ae082f273d85d46a5216765fa5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superscript (0.7.1)
4
+ superscript (0.12.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -1,2 +1,4 @@
1
1
  a = struct
2
2
  go a.name
3
+
4
+ raise!
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
- print "> "
38
- contents = STDIN.gets
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
@@ -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
- exception = args.first
25
- error_message = exception
23
+ ex = args.first
24
+ [ex.class, ex.message]
26
25
  when :tp_call_superscript, :tp_call_superscript_global
27
- error_message = "Can't touch this"
26
+ [:internal, "Can't touch this"]
28
27
  when :ctx_method_missing, :tp_singleton_method_added, :tp_command_not_found
29
- error_message = args.first
28
+ [:internal, args.first]
30
29
  when :tp_class_define, :tp_module_define
31
- error_message = args.first
30
+ [:internal, args.first]
32
31
  else
33
32
  pp [:unknown_where, where, args]
34
- error_message = args.join(" ")
33
+ [:uknown, args.join(" ")]
35
34
  end
36
35
 
37
- puts error_message
38
- if @on_error_exec
39
- system("#{@on_error_exec} #{error_message}")
40
- end
41
- exit 1
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)
@@ -1,3 +1,3 @@
1
1
  module Superscript
2
- VERSION = "0.7.1"
2
+ VERSION = "0.12.0"
3
3
  end
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.7.1
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: 2020-05-24 00:00:00.000000000 Z
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: []