rails-sh 1.2.7 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rails/sh.rb +4 -4
- data/lib/rails/sh/commands.rb +13 -11
- data/rails-sh.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/lib/rails/sh.rb
CHANGED
@@ -55,21 +55,21 @@ module Rails
|
|
55
55
|
Readline.completion_proc = lambda do |word|
|
56
56
|
(
|
57
57
|
Command.command_names.map { |name| name.to_s } +
|
58
|
-
RAILS_SUB_COMMANDS +
|
58
|
+
RAILS_SUB_COMMANDS.map { |name| "rails #{name}" } +
|
59
59
|
Rails::Sh::Rake.task_names.map { |name| "rake #{name}" }
|
60
60
|
).grep(/#{Regexp.quote(word)}/)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
def execute(line)
|
65
|
-
start = Time.now
|
66
65
|
if command = Command.find(line)
|
66
|
+
start = Time.now
|
67
67
|
arg = line.split(/\s+/, 2)[1] rescue nil
|
68
68
|
command.call(arg)
|
69
|
+
puts "\e[34m#{Time.now - start}sec\e[0m"
|
69
70
|
else
|
70
|
-
|
71
|
+
puts "\e[41mCommand not found\e[0m"
|
71
72
|
end
|
72
|
-
puts "\e[34m#{Time.now - start}sec\e[0m"
|
73
73
|
end
|
74
74
|
|
75
75
|
def execute_rails_command(line)
|
data/lib/rails/sh/commands.rb
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
include Rails::Sh
|
2
2
|
|
3
3
|
Command.define 'help' do
|
4
|
-
Rails::Sh.execute_rails_command('--help')
|
5
4
|
puts <<HELP
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
eval eval as ruby script\e[0m
|
5
|
+
\e[36mhelp print help
|
6
|
+
rails ARG execute rails command
|
7
|
+
rake TASK execute rake task
|
8
|
+
t, tasks PATTERN print rake tasks
|
9
|
+
exit exit from rails-sh
|
10
|
+
restart restart rails-sh
|
11
|
+
reload reload the environment
|
12
|
+
!, system execute a system command
|
13
|
+
eval eval as ruby script\e[0m
|
16
14
|
HELP
|
17
15
|
end
|
18
16
|
|
17
|
+
Command.define 'rails' do |arg|
|
18
|
+
Rails::Sh.execute_rails_command(arg)
|
19
|
+
end
|
20
|
+
|
19
21
|
Command.define 'rake' do |arg|
|
20
22
|
Rails::Sh::Rake.invoke(arg || :default)
|
21
23
|
end
|
data/rails-sh.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rails-sh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.3.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- jugyo
|
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
hash: -
|
102
|
+
hash: -3249246770813538482
|
103
103
|
segments:
|
104
104
|
- 0
|
105
105
|
version: "0"
|