flex_console 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/flex_console.rb +12 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7a7956f4562526bc47d90eafa21f04b8b74494d
4
- data.tar.gz: 4cd37f6e709fedb67b493db443d0f7fa657df30f
3
+ metadata.gz: 42c6c073973bdbf49119df9fc7aa43148bb2451b
4
+ data.tar.gz: c41740b12c33ee5a64aa7bd49d3e42159861b621
5
5
  SHA512:
6
- metadata.gz: 2a4edf69cf510eacbe558c7830a4b9ea67f96fd3c34a6f655a7b70fc9bdac21d034f105547ce1cd6b391179aa05009d7e729839f5c99401052479a47eae0ae15
7
- data.tar.gz: 2ccf8ebf4c152fe0a52e2d49ec6c0ba157e28f8d38e990fb78d4b5482124fbff173470343a8b128595060d75d5dd410f5179ce89d5e4f8b8a8c1c1442c47dfb6
6
+ metadata.gz: 6264581c88cfb3bee88fef7cbb03292bb3ef605daaebc46795a8e50d8dc01104b5554845aac2f7217f5791fbbe8ba094be04343f349caa612ebf625716c5f60f
7
+ data.tar.gz: 653760b733d9950d679f78d8ac34a5df94aed5b1254d2654a6f6b7a1d8a6a47dfb6fb79e46c6b1710f8bdf522bc0cdd08a0b70b18d7875492d468253485d0f64
data/lib/flex_console.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'flex_console/dummy'
2
+
1
3
  module FlexConsole
2
4
 
3
5
  class << self
@@ -5,24 +7,26 @@ module FlexConsole
5
7
  :test_args
6
8
 
7
9
  def bind(obj, binding)
10
+
11
+
8
12
  @plain_loop = ->(message) {
13
+ commands = []
9
14
  begin
10
15
  puts message
11
16
  quit = false
12
- counter = 0
13
17
  until quit
14
18
  response = gets.chomp
15
- if response == ''
16
- counter += 1
17
- if counter == 2
18
- quit = true
19
- end
20
- elsif response == 'exit'
19
+ commands << response
20
+ if response == 'q' || response == 'exit'
21
21
  quit = true
22
+ elsif response == ''
23
+ commands[-1] = commands[-2]
24
+ puts 'repeating'
25
+ binding.eval(commands[-2].strip.gsub("\n", ''))
26
+ puts '------------------'
22
27
  else
23
28
  binding.eval(response.strip.gsub("\n", ''))
24
29
  puts '------------------'
25
- counter = 0
26
30
  end
27
31
  end
28
32
  rescue Exception => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flex_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene Lai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2016-03-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: To do
14
14
  email: ejt.lai@gmail.com