runfile 0.6.3 → 0.6.4
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.
- checksums.yaml +4 -4
- data/lib/runfile/runfile_helper.rb +10 -0
- data/lib/runfile/runner.rb +14 -0
- data/lib/runfile/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e1e4b811b20fb3a6a072a25ad05c6cabada1191
|
4
|
+
data.tar.gz: 225f4622994b215a2f8528608e8979efca08da0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80d1173e587d084821f875e2c2ce7e2b530503d8dd01909b5516cb7adfe28acc7d8eaf379fdf0bd0409b53c09835bedc130dbdcbe0da7344ad0d584d7a4eb98f
|
7
|
+
data.tar.gz: ebac3b2ea0e53e8f7f39ac6d32c874a5617d4bb66169a4f4912d9b79ab79121b73ab6af69f0643eda467f6efcc205e83433d11581e9e731271ccf8ec63d98762
|
@@ -131,6 +131,16 @@ module Runfile
|
|
131
131
|
say "#{settings.intro}\n" if settings.intro
|
132
132
|
say "Usage: run <file>"
|
133
133
|
say word_wrap(message, width)
|
134
|
+
|
135
|
+
show_shortcuts if settings.shortcuts
|
136
|
+
end
|
137
|
+
|
138
|
+
def show_shortcuts
|
139
|
+
say "\nShortcuts:"
|
140
|
+
max = settings.shortcuts.keys.max_by(&:length).length
|
141
|
+
settings.shortcuts.each_pair do |shortcut, command|
|
142
|
+
say " #{shortcut.rjust max} : #{command}"
|
143
|
+
end
|
134
144
|
end
|
135
145
|
|
136
146
|
end
|
data/lib/runfile/runner.rb
CHANGED
@@ -32,7 +32,9 @@ module Runfile
|
|
32
32
|
# Load and execute a Runfile call.
|
33
33
|
def execute(argv, filename='Runfile')
|
34
34
|
@ignore_settings = !filename
|
35
|
+
argv = expand_shortcuts argv
|
35
36
|
filename and File.file?(filename) or handle_no_runfile argv
|
37
|
+
|
36
38
|
begin
|
37
39
|
load settings.helper if settings.helper
|
38
40
|
load filename
|
@@ -147,5 +149,17 @@ module Runfile
|
|
147
149
|
end
|
148
150
|
exit
|
149
151
|
end
|
152
|
+
|
153
|
+
def expand_shortcuts(argv)
|
154
|
+
possible_candidate = argv[0]
|
155
|
+
if settings.shortcuts and settings.shortcuts[possible_candidate]
|
156
|
+
shortcut_value = settings.shortcuts[argv[0]]
|
157
|
+
expanded = shortcut_value.split ' '
|
158
|
+
say "!txtblu!# #{possible_candidate} > #{shortcut_value}"
|
159
|
+
argv.shift
|
160
|
+
argv = expanded + argv
|
161
|
+
end
|
162
|
+
argv
|
163
|
+
end
|
150
164
|
end
|
151
165
|
end
|
data/lib/runfile/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runfile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|