djinni 1.3.0 → 1.3.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/djinni.rb +10 -3
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ea5e8f1cef093a7500f760b453448830ad92b0b
4
- data.tar.gz: a85a0322e73454913e284b02181e35bd0171fc93
3
+ metadata.gz: ba9a7aa0be1cacf772934737cb9229fbc02207b1
4
+ data.tar.gz: 39ae226e7127c943b5ae0cb493e6ed027aaaca28
5
5
  SHA512:
6
- metadata.gz: ad6db4b68eb697e3132cf9e558a367c30cd4155816282ab591921be7fcd98079ddb7277ae42904bd1cc5481c0758994cd2af70221daaca2d04e18890b92b049e
7
- data.tar.gz: 71bd1a4c5d022f289d36ca805544ffe553f12f79180c2dd2cd72cd7b6bd9712b4fb72c4d6df6761576a3161e7e5feb64541b7ab0970d33086b94da7eaa5d3dd6
6
+ metadata.gz: 46365265bcab6099effea42a362cd06094886b1ba8235a8e6ebc58b1b30289f01cc389a0a986fdfd18b8df67de89772326b265e63afbc25f1edec0d3fe78474d
7
+ data.tar.gz: 01f5aa57708f8a7da7abc528d91fcce53bde0a5a0a6025ed6e85c102656e8c1fbb5438c56395ba5a0182208543c316d68699538f511ca209b0dfab79a91fd23d
data/lib/djinni.rb CHANGED
@@ -71,9 +71,11 @@ class Djinni
71
71
  return nil
72
72
  when "\e" # Arrow keys
73
73
  code = "\e"
74
- Thread.new do
74
+ t = Thread.new do
75
75
  code += STDIN.getch + STDIN.getch
76
- end.join(0.001).kill
76
+ end
77
+ t.join(0.001) if (t)
78
+ t.kill if (t)
77
79
 
78
80
  case code
79
81
  when "\e[A" # Up arrow
@@ -158,7 +160,12 @@ class Djinni
158
160
  print "\r#{djinni_prompt}#{buff}"
159
161
 
160
162
  # Process input
161
- buff = grant_wish(buff + STDIN.getch, djinni_env)
163
+ begin
164
+ buff = grant_wish(buff + STDIN.getch, djinni_env)
165
+ rescue
166
+ puts if (@interactive)
167
+ return ""
168
+ end
162
169
 
163
170
  if (buff.nil?)
164
171
  puts "Command not found!"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: djinni
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-06 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -105,7 +105,7 @@ files:
105
105
  - lib/djinni/wish/help.rb
106
106
  - lib/djinni/wish/history.rb
107
107
  - lib/djinni/wish/quit.rb
108
- homepage: http://mjwhitta.github.io/djinni
108
+ homepage: https://mjwhitta.github.io/djinni
109
109
  licenses:
110
110
  - GPL-3.0
111
111
  metadata: {}
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.4.5.1
128
+ rubygems_version: 2.5.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: A Ruby command handler