hss 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hss +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dda825118c5f2c9c9a23084aa370a2c04f50f19
|
4
|
+
data.tar.gz: b2ee054b0b03a8d111f1d18796f0a0611ff62f82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b35efa6f33d354e3f98655a6b92211a0b261b40b02db9ecfa05d8b456261398d4a019e5f8d7522a0be115f4e92f6b6e24c590729c67762fbad78c5260e4c0232
|
7
|
+
data.tar.gz: 1fedf809329f3288ad3d5009ec816d1b925a20193df10be2278f1039e5d0ec8a39050ad0e42b523296c0aced9f918469a6d31308d4d1e0d71b854c8e4a5f25a8
|
data/lib/hss
CHANGED
@@ -5,12 +5,12 @@ require 'pathname'
|
|
5
5
|
require 'erb'
|
6
6
|
|
7
7
|
def expand(input)
|
8
|
-
|
8
|
+
Conf['expansions'].each { |long, shorts| return long if shorts.include? input }
|
9
9
|
raise NameError, "No expansion found for: #{input}"
|
10
10
|
end
|
11
11
|
|
12
12
|
def shortcut(input)
|
13
|
-
return
|
13
|
+
return Conf['shortcuts'][input]
|
14
14
|
end
|
15
15
|
|
16
16
|
def command(input)
|
@@ -28,16 +28,16 @@ if possible_paths.empty?
|
|
28
28
|
exit 1
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
Conf = open(possible_paths[0]) { |file| YAML.load(file.read) }
|
32
32
|
Input = ARGV.pop
|
33
33
|
Args = ARGV.join(' ')
|
34
34
|
|
35
35
|
if Input.nil? or Input == 'help'
|
36
36
|
puts 'How to use:'
|
37
37
|
puts '(what you type) -> (where it takes you)'
|
38
|
-
|
38
|
+
Conf['patterns'].each { |pattern| puts pattern['example'] }
|
39
39
|
else
|
40
|
-
|
40
|
+
Conf['patterns'].each do |pattern|
|
41
41
|
next unless Input.match(pattern['short'])
|
42
42
|
long_form = eval '"' + pattern['long'] + '"'
|
43
43
|
#long_form = ERB.new('<%= "' + pattern['long'] + '" %>').result
|