theine 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. data/lib/theine/client.rb +13 -2
  2. metadata +11 -11
data/lib/theine/client.rb CHANGED
@@ -110,13 +110,24 @@ module Theine
110
110
  @argv.shift
111
111
  @worker.command_rspec(@argv)
112
112
  else
113
- @argv.shift
113
+ if ["c", "console"].include?(@argv[0])
114
+ load_pry_history
115
+ end
114
116
  @worker.command_rails(@argv)
115
117
  end
116
118
  rescue DRb::DRbConnError
117
119
  $stderr.puts "\nTheine closed the connection."
118
120
  end
119
121
 
122
+ def load_pry_history
123
+ history_file = File.expand_path("~/.pry_history")
124
+ if File.exist?(history_file)
125
+ File.readlines(history_file).pop(100).each do |line|
126
+ Readline::HISTORY << line[0, line.size-1]
127
+ end
128
+ end
129
+ end
130
+
120
131
  def reset_argv!
121
132
  @argv = ARGV.dup
122
133
  ARGV.clear
@@ -129,7 +140,7 @@ module Theine
129
140
 
130
141
  def redirect_io
131
142
  # Need to be careful that these don't get garbage collected
132
- $stdin_undumped = @worker.stdin = IOUndumpedProxy.new($stdin)
143
+ $stdin_undumped = @worker.stdin = IOUndumpedProxy.new(Readline)
133
144
  $stdout_undumped = @worker.stdout = IOUndumpedProxy.new($stdout)
134
145
  $stderr_undumped = @worker.stderr = IOUndumpedProxy.new($stderr)
135
146
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theine
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.6
4
+ version: 0.0.7
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jan Berdajs
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-10-01 00:00:00.000000000 Z
@@ -31,26 +31,26 @@ files:
31
31
  homepage: https://github.com/mrbrdo/theine
32
32
  licenses:
33
33
  - MIT
34
- post_install_message:
34
+ post_install_message:
35
35
  rdoc_options: []
36
36
  require_paths:
37
37
  - lib
38
38
  required_ruby_version: !ruby/object:Gem::Requirement
39
+ none: false
39
40
  requirements:
40
- - - '>='
41
+ - - ! '>='
41
42
  - !ruby/object:Gem::Version
42
43
  version: '0'
43
- none: false
44
44
  required_rubygems_version: !ruby/object:Gem::Requirement
45
+ none: false
45
46
  requirements:
46
- - - '>='
47
+ - - ! '>='
47
48
  - !ruby/object:Gem::Version
48
49
  version: '0'
49
- none: false
50
50
  requirements: []
51
- rubyforge_project:
52
- rubygems_version: 1.8.24
53
- signing_key:
51
+ rubyforge_project:
52
+ rubygems_version: 1.8.25
53
+ signing_key:
54
54
  specification_version: 3
55
55
  summary: Theine
56
56
  test_files: []