redis_vars 0.7.2 → 0.8.0
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/lib/redis_vars/cli.rb +15 -1
- data/lib/redis_vars/version.rb +1 -1
- metadata +1 -1
data/lib/redis_vars/cli.rb
CHANGED
@@ -4,7 +4,6 @@ require "thor"
|
|
4
4
|
|
5
5
|
module RedisVars
|
6
6
|
class CLI < Thor
|
7
|
-
default_task :list
|
8
7
|
|
9
8
|
desc "add KEY VALUE", "Add a new env var"
|
10
9
|
def add(key, value)
|
@@ -29,6 +28,12 @@ module RedisVars
|
|
29
28
|
desc "exec", "Runs a command with the stored env vars"
|
30
29
|
def exec(*args)
|
31
30
|
Kernel.exec(store.hash, *args)
|
31
|
+
rescue Errno::EACCES
|
32
|
+
puts "Not executable: #{args.first}"
|
33
|
+
rescue Errno::ENOENT => error
|
34
|
+
puts error
|
35
|
+
rescue ArgumentError
|
36
|
+
puts "redis_vars exec needs a command to run"
|
32
37
|
end
|
33
38
|
|
34
39
|
desc "version", "Displays gem version"
|
@@ -42,5 +47,14 @@ module RedisVars
|
|
42
47
|
@store ||= Store.new
|
43
48
|
end
|
44
49
|
|
50
|
+
def method_missing(*args)
|
51
|
+
if args
|
52
|
+
args[0] = args[0].to_s
|
53
|
+
exec(*args)
|
54
|
+
else
|
55
|
+
help
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
45
59
|
end
|
46
60
|
end
|
data/lib/redis_vars/version.rb
CHANGED