mortar 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mortar/command/local.rb +36 -0
- data/lib/mortar/version.rb +1 -1
- data/spec/mortar/command/local_spec.rb +5 -0
- metadata +138 -129
data/lib/mortar/command/local.rb
CHANGED
@@ -26,7 +26,17 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
26
26
|
#
|
27
27
|
# Install dependencies for running this mortar project locally - other mortar:local commands will also perform this step automatically.
|
28
28
|
#
|
29
|
+
# --project-root PROJECTDIR # The root directory of the project if not the CWD
|
30
|
+
#
|
29
31
|
def configure
|
32
|
+
|
33
|
+
# cd into the project root
|
34
|
+
project_root = options[:project_root] ||= Dir.getwd
|
35
|
+
unless File.directory?(project_root)
|
36
|
+
error("No such directory #{project_root}")
|
37
|
+
end
|
38
|
+
Dir.chdir(project_root)
|
39
|
+
|
30
40
|
ctrl = Mortar::Local::Controller.new
|
31
41
|
ctrl.install_and_configure
|
32
42
|
end
|
@@ -37,6 +47,7 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
37
47
|
#
|
38
48
|
# -p, --parameter NAME=VALUE # Set a pig parameter value in your script.
|
39
49
|
# -f, --param-file PARAMFILE # Load pig parameter values from a file.
|
50
|
+
# --project-root PROJECTDIR # The root directory of the project if not the CWD
|
40
51
|
#
|
41
52
|
#Examples:
|
42
53
|
#
|
@@ -48,6 +59,14 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
48
59
|
error("Usage: mortar local:run SCRIPT\nMust specify SCRIPT.")
|
49
60
|
end
|
50
61
|
validate_arguments!
|
62
|
+
|
63
|
+
# cd into the project root
|
64
|
+
project_root = options[:project_root] ||= Dir.getwd
|
65
|
+
unless File.directory?(project_root)
|
66
|
+
error("No such directory #{project_root}")
|
67
|
+
end
|
68
|
+
Dir.chdir(project_root)
|
69
|
+
|
51
70
|
script = validate_script!(script_name)
|
52
71
|
ctrl = Mortar::Local::Controller.new
|
53
72
|
ctrl.run(script, pig_parameters)
|
@@ -63,6 +82,7 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
63
82
|
# -p, --parameter NAME=VALUE # Set a pig parameter value in your script.
|
64
83
|
# -f, --param-file PARAMFILE # Load pig parameter values from a file.
|
65
84
|
# --no_browser # Don't open the illustrate results automatically in the browser.
|
85
|
+
# --project-root PROJECTDIR # The root directory of the project if not the CWD
|
66
86
|
#
|
67
87
|
# Examples:
|
68
88
|
#
|
@@ -77,6 +97,13 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
77
97
|
error("Usage: mortar local:illustrate PIGSCRIPT [ALIAS]\nMust specify PIGSCRIPT.")
|
78
98
|
end
|
79
99
|
|
100
|
+
# cd into the project root
|
101
|
+
project_root = options[:project_root] ||= Dir.getwd
|
102
|
+
unless File.directory?(project_root)
|
103
|
+
error("No such directory #{project_root}")
|
104
|
+
end
|
105
|
+
Dir.chdir(project_root)
|
106
|
+
|
80
107
|
validate_arguments!
|
81
108
|
pigscript = validate_pigscript!(pigscript_name)
|
82
109
|
|
@@ -91,6 +118,7 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
91
118
|
#
|
92
119
|
# -p, --parameter NAME=VALUE # Set a pig parameter value in your script.
|
93
120
|
# -f, --param-file PARAMFILE # Load pig parameter values from a file.
|
121
|
+
# --project-root PROJECTDIR # The root directory of the project if not the CWD
|
94
122
|
#
|
95
123
|
#Examples:
|
96
124
|
#
|
@@ -102,6 +130,14 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
102
130
|
error("Usage: mortar local:validate SCRIPT\nMust specify SCRIPT.")
|
103
131
|
end
|
104
132
|
validate_arguments!
|
133
|
+
|
134
|
+
# cd into the project root
|
135
|
+
project_root = options[:project_root] ||= Dir.getwd
|
136
|
+
unless File.directory?(project_root)
|
137
|
+
error("No such directory #{project_root}")
|
138
|
+
end
|
139
|
+
Dir.chdir(project_root)
|
140
|
+
|
105
141
|
script = validate_script!(script_name)
|
106
142
|
ctrl = Mortar::Local::Controller.new
|
107
143
|
ctrl.validate(script, pig_parameters)
|
data/lib/mortar/version.rb
CHANGED
@@ -106,6 +106,11 @@ STDERR
|
|
106
106
|
|
107
107
|
context("configure") do
|
108
108
|
|
109
|
+
it "errors if the project root doesn't exist or we can't cd there" do
|
110
|
+
stderr, stdout = execute("local:configure --project-root /foo/baz")
|
111
|
+
stderr.should == " ! No such directory /foo/baz\n"
|
112
|
+
end
|
113
|
+
|
109
114
|
it "errors if java can't be found" do
|
110
115
|
any_instance_of(Mortar::Local::Java) do |j|
|
111
116
|
stub(j).check_install.returns(false)
|
metadata
CHANGED
@@ -1,167 +1,164 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mortar
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 53
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 8
|
9
|
+
- 5
|
10
|
+
version: 0.8.5
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Mortar Data
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-06-10 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: mortar-api-ruby
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.6.3
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
|
-
requirements:
|
25
|
+
requirements:
|
27
26
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 1
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 6
|
32
|
+
- 3
|
29
33
|
version: 0.6.3
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: netrc
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0.7'
|
38
34
|
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: netrc
|
39
38
|
prerelease: false
|
40
|
-
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
|
-
requirements:
|
41
|
+
requirements:
|
43
42
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
requirements:
|
51
|
-
- - ~>
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '2.1'
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 5
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 7
|
48
|
+
version: "0.7"
|
54
49
|
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: launchy
|
55
53
|
prerelease: false
|
56
|
-
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
55
|
none: false
|
58
|
-
requirements:
|
56
|
+
requirements:
|
59
57
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 1
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 1
|
63
|
+
version: "2.1"
|
64
|
+
type: :runtime
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
63
67
|
name: excon
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0.15'
|
70
|
-
type: :development
|
71
68
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0.15'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: fakefs
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
81
70
|
none: false
|
82
|
-
requirements:
|
71
|
+
requirements:
|
83
72
|
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 21
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
- 15
|
78
|
+
version: "0.15"
|
86
79
|
type: :development
|
80
|
+
version_requirements: *id004
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: fakefs
|
87
83
|
prerelease: false
|
88
|
-
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
85
|
none: false
|
90
|
-
requirements:
|
86
|
+
requirements:
|
91
87
|
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 11
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
- 4
|
93
|
+
- 2
|
93
94
|
version: 0.4.2
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: gem-release
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
95
|
type: :development
|
96
|
+
version_requirements: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: gem-release
|
103
99
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: rake
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
113
101
|
none: false
|
114
|
-
requirements:
|
115
|
-
- -
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
118
109
|
type: :development
|
110
|
+
version_requirements: *id006
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
119
113
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ! '>='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: rr
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
129
115
|
none: false
|
130
|
-
requirements:
|
131
|
-
- -
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
134
123
|
type: :development
|
124
|
+
version_requirements: *id007
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rr
|
135
127
|
prerelease: false
|
136
|
-
|
128
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
137
129
|
none: false
|
138
|
-
requirements:
|
139
|
-
- -
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
none: false
|
146
|
-
requirements:
|
147
|
-
- - ! '>='
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 3
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
version: "0"
|
150
137
|
type: :development
|
138
|
+
version_requirements: *id008
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
151
141
|
prerelease: false
|
152
|
-
|
142
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
153
143
|
none: false
|
154
|
-
requirements:
|
155
|
-
- -
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
version: "0"
|
151
|
+
type: :development
|
152
|
+
version_requirements: *id009
|
158
153
|
description: Client library and command-line tool to interact with the Mortar service.
|
159
154
|
email: support@mortardata.com
|
160
|
-
executables:
|
155
|
+
executables:
|
161
156
|
- mortar
|
162
157
|
extensions: []
|
158
|
+
|
163
159
|
extra_rdoc_files: []
|
164
|
-
|
160
|
+
|
161
|
+
files:
|
165
162
|
- README.md
|
166
163
|
- bin/mortar
|
167
164
|
- css/illustrate.css
|
@@ -252,26 +249,38 @@ files:
|
|
252
249
|
- spec/support/display_message_matcher.rb
|
253
250
|
homepage: http://mortardata.com/
|
254
251
|
licenses: []
|
252
|
+
|
255
253
|
post_install_message:
|
256
254
|
rdoc_options: []
|
257
|
-
|
255
|
+
|
256
|
+
require_paths:
|
258
257
|
- lib
|
259
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
258
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
260
259
|
none: false
|
261
|
-
requirements:
|
262
|
-
- -
|
263
|
-
- !ruby/object:Gem::Version
|
260
|
+
requirements:
|
261
|
+
- - ">="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
hash: 57
|
264
|
+
segments:
|
265
|
+
- 1
|
266
|
+
- 8
|
267
|
+
- 7
|
264
268
|
version: 1.8.7
|
265
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
266
270
|
none: false
|
267
|
-
requirements:
|
268
|
-
- -
|
269
|
-
- !ruby/object:Gem::Version
|
270
|
-
|
271
|
+
requirements:
|
272
|
+
- - ">="
|
273
|
+
- !ruby/object:Gem::Version
|
274
|
+
hash: 3
|
275
|
+
segments:
|
276
|
+
- 0
|
277
|
+
version: "0"
|
271
278
|
requirements: []
|
279
|
+
|
272
280
|
rubyforge_project:
|
273
|
-
rubygems_version: 1.8.
|
281
|
+
rubygems_version: 1.8.24
|
274
282
|
signing_key:
|
275
283
|
specification_version: 3
|
276
284
|
summary: Client library and CLI to interact with the Mortar service.
|
277
285
|
test_files: []
|
286
|
+
|