rails-sh 1.2.4 → 1.2.5
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.
- data/VERSION +1 -1
- data/lib/rails/sh.rb +7 -12
- data/lib/rails/sh/commands.rb +2 -2
- data/rails-sh.gemspec +1 -2
- data/spec/rails/sh_spec.rb +0 -13
- metadata +2 -3
- data/lib/rails/sh/patch_for_kernel.rb +0 -21
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
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
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
data/lib/rails/sh/commands.rb
CHANGED
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.
|
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",
|
data/spec/rails/sh_spec.rb
CHANGED
@@ -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.
|
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: -
|
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
|