superscript 0.3.1 → 0.3.2

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: a307ec40be3a538d131d9bcc98eed552b4d4318df120b2b0dac7b3b387cf50f8
4
- data.tar.gz: 7663714b269ca22e4f6c4dde355a650a1c57b7526186fcdbd0165b0fc2178c0d
3
+ metadata.gz: da0938c14b75842785ca944b6eba56a8cd6fcc3fc8115ebadc83214b4ec1680d
4
+ data.tar.gz: d1a5292fe31e969c292cbb918052353bae36bddab88854920ab1fac1c1b45e96
5
5
  SHA512:
6
- metadata.gz: 2d14ace71b92ee1edd52fb40be33497e5aa47528953d1236068200cd613e3295c7b0754dcd7d0e9ee865988e64900cc505846c10dd441de72788cd7a35087c94
7
- data.tar.gz: 97af0884ab8a8633a592d42a8546c0313751e074fe967525ce4b1846f0c7901513f30a2b258cfda756c76bba87c130e60d78e12d0b42f4f60c8762acb0d2e789
6
+ metadata.gz: e69ed11b7c8ef043e071afbe91046fd6300dc150730abbcf36ee21d9b91d2eba3d61b8a3f115848383316bcba475cf43f47d683ce4ce3b9102b2466c3a9f88f9
7
+ data.tar.gz: def954e7c30ee3ace175f207e52cbb078cd5e33f5cb31124e7cd344ab275f08001d4e7dd93d2a1fe538c6ff4c48ee2f2dde01dd0e1984250cc6e83021d47947e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superscript (0.3.1)
4
+ superscript (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,13 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ $stdout.sync = true
4
+
3
5
  require "bundler/setup"
4
6
  require "superscript"
5
7
 
6
- unless ARGV.length < 1
8
+ unless ARGV.length < 2
7
9
  puts "USAGE: superscript dsl.rb script.rb"
8
10
  exit 1
9
11
  end
10
- require "./#{ARGV[0]}"
12
+
13
+ best_guess_path = if ARGV[0].start_with? "/"
14
+ ARGV[0]
15
+ else
16
+ File.join(".", ARGV[0])
17
+ end
18
+
19
+ require best_guess_path
11
20
 
12
21
  ctx_classname = File.basename(ARGV[0]).split(".").first.capitalize
13
22
  ctx = (eval "#{ctx_classname}").new
@@ -19,7 +28,7 @@ else
19
28
  runner = Superscript::Runner.new
20
29
  loop do
21
30
  print "> "
22
- contents = gets
31
+ contents = STDIN.gets
23
32
  value = runner.run! ctx, contents: contents
24
33
  puts " => #{value.inspect}"
25
34
  end
@@ -1,3 +1,3 @@
1
1
  module Superscript
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula