rails-sh 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.4
1
+ 1.2.5
data/lib/rails/sh.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'readline'
2
- require 'rails/sh/patch_for_kernel'
3
2
  require 'rails/sh/rake'
4
3
  require 'rails/sh/command'
5
4
  require 'rails/sh/commands'
@@ -52,17 +51,13 @@ module Rails
52
51
  end
53
52
 
54
53
  def execute_rails_command(line)
55
- ENV.delete("RAILS_ENV")
56
- ARGV.clear
57
- ARGV.concat line.split(/\s+/)
58
- puts "\e[42m$ rails #{ARGV.join(" ")}\e[0m"
59
- clear_dependencies
60
- load 'rails/commands.rb'
61
- end
62
-
63
- def clear_dependencies
64
- ActiveSupport::DescendantsTracker.clear
65
- ActiveSupport::Dependencies.clear
54
+ pid = fork do
55
+ ARGV.clear
56
+ ARGV.concat line.split(/\s+/)
57
+ puts "\e[42m$ rails #{ARGV.join(" ")}\e[0m"
58
+ require 'rails/commands'
59
+ end
60
+ Process.waitpid(pid)
66
61
  end
67
62
  end
68
63
  end
@@ -34,9 +34,9 @@ end
34
34
 
35
35
  Command.define 'restart' do
36
36
  puts 'restarting...'
37
- _exec File.expand_path('../../../../bin/rails-sh', __FILE__)
37
+ exec File.expand_path('../../../../bin/rails-sh', __FILE__)
38
38
  end
39
39
 
40
40
  Command.define 'exit' do
41
- _exit
41
+ exit
42
42
  end
data/rails-sh.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails-sh}
8
- s.version = "1.2.4"
8
+ s.version = "1.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jugyo"]
@@ -31,7 +31,6 @@ Gem::Specification.new do |s|
31
31
  "lib/rails/sh.rb",
32
32
  "lib/rails/sh/command.rb",
33
33
  "lib/rails/sh/commands.rb",
34
- "lib/rails/sh/patch_for_kernel.rb",
35
34
  "lib/rails/sh/rake.rb",
36
35
  "rails-sh.gemspec",
37
36
  "spec/rails/sh/command_spec.rb",
@@ -23,17 +23,4 @@ describe Rails::Sh do
23
23
  end
24
24
  end
25
25
  end
26
-
27
- ['console', 'g --help'].each do |line|
28
- before do
29
- Rails::Sh.stub(:clear_dependencies)
30
- end
31
-
32
- it "a rails's command should be executed if the line is #{line}" do
33
- Rails::Sh.should_receive(:load).with("rails/commands.rb") do
34
- ARGV.should eq(line.split(/\s+/))
35
- end
36
- Rails::Sh.execute(line)
37
- end
38
- end
39
26
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rails-sh
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.4
5
+ version: 1.2.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - jugyo
@@ -79,7 +79,6 @@ files:
79
79
  - lib/rails/sh.rb
80
80
  - lib/rails/sh/command.rb
81
81
  - lib/rails/sh/commands.rb
82
- - lib/rails/sh/patch_for_kernel.rb
83
82
  - lib/rails/sh/rake.rb
84
83
  - rails-sh.gemspec
85
84
  - spec/rails/sh/command_spec.rb
@@ -99,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
98
  requirements:
100
99
  - - ">="
101
100
  - !ruby/object:Gem::Version
102
- hash: -4433203662375037067
101
+ hash: -4208403511275198265
103
102
  segments:
104
103
  - 0
105
104
  version: "0"
@@ -1,21 +0,0 @@
1
- module Kernel
2
- alias_method :_require, :require
3
- def require(name)
4
- name = name.to_path if name.respond_to?(:to_path)
5
- if name =~ /^rails\/commands\//
6
- load "#{name}.rb"
7
- else
8
- _require(name)
9
- end
10
- end
11
-
12
- alias_method :_exec, :exec
13
- def exec(*args)
14
- system(*args)
15
- end
16
-
17
- alias_method :_exit, :exit
18
- def exit(*args)
19
- irb_exit if caller.first =~ /irb_binding/
20
- end
21
- end