rake-sh 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rake/sh/command.rb +5 -3
- data/lib/rake/sh/commands.rb +9 -11
- data/rake-sh.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/lib/rake/sh/command.rb
CHANGED
@@ -6,8 +6,10 @@ module Rake
|
|
6
6
|
@commands ||= {}
|
7
7
|
end
|
8
8
|
|
9
|
-
def define(
|
10
|
-
|
9
|
+
def define(*names, &block)
|
10
|
+
names.each do |name|
|
11
|
+
commands[name.to_sym] = block
|
12
|
+
end
|
11
13
|
end
|
12
14
|
|
13
15
|
def find(line)
|
@@ -23,7 +25,7 @@ module Rake
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def [](name)
|
26
|
-
commands[name]
|
28
|
+
commands[name.to_sym]
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
data/lib/rake/sh/commands.rb
CHANGED
@@ -1,29 +1,27 @@
|
|
1
1
|
include Rake::Sh
|
2
2
|
|
3
|
-
Command.define 'help' do
|
3
|
+
Command.define 'help', 'h' do
|
4
4
|
puts <<HELP
|
5
|
-
|
6
|
-
|
5
|
+
h, help print help
|
6
|
+
t, tasks print tasks
|
7
|
+
!, system execute a system command
|
8
|
+
q, exit exit from rake-sh
|
7
9
|
HELP
|
8
10
|
end
|
9
11
|
|
10
|
-
Command.define 'tasks' do |arg|
|
12
|
+
Command.define 'tasks', 't' do |arg|
|
11
13
|
Rake.application.options.show_task_pattern = arg ? Regexp.new(arg) : //
|
12
14
|
Rake.application.display_tasks_and_comments
|
13
15
|
end
|
14
16
|
|
15
|
-
Command.define 'exit' do
|
17
|
+
Command.define 'exit', 'q' do
|
16
18
|
exit
|
17
19
|
end
|
18
20
|
|
19
|
-
Command.define 'rake' do |arg|
|
21
|
+
Command.define 'rake', 'r' do |arg|
|
20
22
|
Rake::Sh.invoke(arg || :default)
|
21
23
|
end
|
22
24
|
|
23
|
-
Command.define 'system' do |arg|
|
25
|
+
Command.define 'system', '!' do |arg|
|
24
26
|
system arg
|
25
27
|
end
|
26
|
-
|
27
|
-
Command.define '!' do |arg|
|
28
|
-
Command[:system].call(arg)
|
29
|
-
end
|
data/rake-sh.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rake-sh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- jugyo
|
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
hash: -
|
99
|
+
hash: -3276064031588402337
|
100
100
|
segments:
|
101
101
|
- 0
|
102
102
|
version: "0"
|