crystal-repl 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51b31700645ffc9c351f1f7571b643831bd073de
4
- data.tar.gz: 99fb88646914199394ccf5f356c4de4de0c2b685
3
+ metadata.gz: ed4dc4586738ee6d30202af07cbe373f08570b05
4
+ data.tar.gz: cfc301d6c4acfab0eeaae69c8b6af8faf054ca75
5
5
  SHA512:
6
- metadata.gz: 7096934040a45f9ae7f2f23293fe8034ca54730485edddcc867d31956a937c971dded61cd0d65709ab83ebfae121c01cd6e3d65656c148cf5f99b0393d789775
7
- data.tar.gz: 85ff54f0607a0e84b26f41b568a40a9c6fa5f4e143aff6fc73854bf0c1cb1e884cad3e006f00c5417e983d7e3c1828f9b88e1072cd4047d4affb7e7a333fe6a7
6
+ metadata.gz: c5efd6205b725c0b62909cbaf7439dbb4b8222ec00341aebdee4a0c731fb615e59ee7bc200beccb4b06091da3e3a9b28e41bcb3d22a8e1a11e8a13e0044eeae9
7
+ data.tar.gz: 059c03f81c7e153989b47105699ea310d1a93b89b4868ef43633868ad9e7792bdbc4d02efec18338faf343c5cc5dde1978682c4ff625043e21df5e9e463df6be
data/bin/crepl CHANGED
@@ -6,8 +6,15 @@ require "tempfile"
6
6
  require "open3"
7
7
  PRINT_WARNINGS = false
8
8
 
9
+ def process_code(crystal)
10
+ lines = crystal.split(";")
11
+ last_line = lines[-1]
12
+ lines[-1] = "p((#{last_line}))"
13
+ lines.join(";")
14
+ end
15
+
9
16
  def crystal_eval(crystal, scratch)
10
- scratch.write("p((#{crystal}))")
17
+ scratch.write(process_code(crystal))
11
18
  scratch.flush
12
19
  Open3.popen3("crystal #{scratch.path}") do |stdin, stdout, stderr, wait_thr|
13
20
  begin
@@ -1,5 +1,5 @@
1
1
  module Crystal
2
2
  module Repl
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crystal-repl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karthik T