grifter 0.0.9 → 0.0.10
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/bin/grift +14 -3
- data/grifter.gemspec +2 -2
- data/lib/grifter/configuration.rb +10 -1
- metadata +3 -3
data/bin/grift
CHANGED
@@ -52,14 +52,25 @@ def parse_cmd_line
|
|
52
52
|
end
|
53
53
|
options = parse_cmd_line
|
54
54
|
|
55
|
-
|
56
|
-
|
55
|
+
begin
|
56
|
+
grifter = Grifter.new options
|
57
|
+
rescue GrifterConfigFileMissing => e
|
58
|
+
Log.error e.message
|
59
|
+
Log.error <<-MSG
|
60
|
+
\n
|
61
|
+
Either use -c to specify the location of your grifter config file,
|
62
|
+
or create a file called grifter.yml in the current directory.
|
63
|
+
|
64
|
+
Review documentation on configuration here: https://github.com/Knewton/grifter/wiki/grifter.yml-configuration
|
65
|
+
MSG
|
66
|
+
Kernel.abort
|
67
|
+
end
|
57
68
|
|
58
69
|
if not(ARGV.empty?)
|
59
70
|
#a grift method has been specified on the command line
|
60
71
|
method = ARGV.shift
|
61
72
|
response = grifter.send(method.to_sym, *ARGV)
|
62
|
-
|
73
|
+
Log.info "Grift method #{method} returned:\n" + response.inspect
|
63
74
|
|
64
75
|
elsif not(options[:files].empty?)
|
65
76
|
#some grift files were specified on the command line?
|
data/grifter.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "grifter"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Robert Schultheis"]
|
12
|
-
s.date = "2013-06-
|
12
|
+
s.date = "2013-06-24"
|
13
13
|
s.description = "convention based approach to interfacing with an HTTP JSON API."
|
14
14
|
s.email = "rob@knewton.com"
|
15
15
|
s.executables = ["grift"]
|
@@ -23,7 +23,7 @@ class Grifter
|
|
23
23
|
}.merge(options)
|
24
24
|
Log.debug "Loading config file '#{options[:config_file]}'"
|
25
25
|
unless File.exist?(options[:config_file])
|
26
|
-
raise "No such config file: '#{options[:config_file]}'"
|
26
|
+
raise GrifterConfigFileMissing.new "No such config file: '#{options[:config_file]}'"
|
27
27
|
end
|
28
28
|
hash = YAML.load_file(options[:config_file])
|
29
29
|
symbolized = recursive_symbolize(hash)
|
@@ -81,6 +81,12 @@ class Grifter
|
|
81
81
|
config[:environment] = :undefined
|
82
82
|
end
|
83
83
|
|
84
|
+
#join the grift globs with the relative path to config file
|
85
|
+
if config[:grift_globs] && options[:config_file]
|
86
|
+
config_file_dir = File.dirname options[:config_file]
|
87
|
+
config[:grift_globs].map! {|glob| config_file_dir + '/' + glob.sub(/^\//,'')}
|
88
|
+
end
|
89
|
+
|
84
90
|
return config
|
85
91
|
end
|
86
92
|
end
|
@@ -88,3 +94,6 @@ end
|
|
88
94
|
|
89
95
|
class GrifterConfigurationError < Exception
|
90
96
|
end
|
97
|
+
|
98
|
+
class GrifterConfigFileMissing < Exception
|
99
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grifter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash:
|
130
|
+
hash: 3042146382165346613
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
none: false
|
133
133
|
requirements:
|