theine 0.0.5 → 0.0.6

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.
@@ -30,6 +30,12 @@ class IOUndumpedProxy
30
30
  end
31
31
  end
32
32
 
33
+ def readline_arity
34
+ method(:readline).arity
35
+ rescue NameError
36
+ 0
37
+ end
38
+
33
39
  def gets(*args)
34
40
  @obj.gets(*args)
35
41
  end
@@ -122,9 +128,10 @@ module Theine
122
128
  end
123
129
 
124
130
  def redirect_io
125
- @worker.stdin = IOUndumpedProxy.new($stdin)
126
- @worker.stdout = IOUndumpedProxy.new($stdout)
127
- @worker.stderr = IOUndumpedProxy.new($stderr)
131
+ # Need to be careful that these don't get garbage collected
132
+ $stdin_undumped = @worker.stdin = IOUndumpedProxy.new($stdin)
133
+ $stdout_undumped = @worker.stdout = IOUndumpedProxy.new($stdout)
134
+ $stderr_undumped = @worker.stderr = IOUndumpedProxy.new($stderr)
128
135
  end
129
136
 
130
137
  def connect_worker
@@ -24,9 +24,7 @@ module Theine
24
24
  end
25
25
 
26
26
  def readline_arity
27
- input.method_missing(:method, :readline).arity
28
- rescue NameError
29
- 0
27
+ input.readline_arity
30
28
  end
31
29
 
32
30
  def gets(*args)
@@ -45,7 +43,7 @@ module Theine
45
43
  ARGV.concat(argv)
46
44
 
47
45
  require 'pry'
48
- ::Rails.application.config.console = Pry
46
+ ::Rails.application.config.console = ::Pry
49
47
  pry_setup
50
48
 
51
49
  require 'rails/commands'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: theine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jan Berdajs