pleaserun 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pleaserun/cli.rb +4 -2
- data/pleaserun.gemspec +1 -1
- data/spec/pleaserun/cli_spec.rb +23 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d43af3b87d707e6e42eb6c765663b0d5bb4f7d4b
|
4
|
+
data.tar.gz: a366b616187163c072131a2820595cb739856294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1fc69db2f7e5dfa749d40b5be26e688390c7b54c8f1d91d75d4eebfa53824c867b3826be19e1e7c6a5d01962ddcbeac2d4b01032e1c19a8341e317a49e42ae2
|
7
|
+
data.tar.gz: 9fa257a2ae34216e558fa0aafe090a019ffb1225122f960e579fe23b63dd3eec2a1bdba716673094c02545830dee79903176db03c9477f7fe234eade2d2f7039
|
data/lib/pleaserun/cli.rb
CHANGED
@@ -21,6 +21,8 @@ class PleaseRun::CLI < Clamp::Command # rubocop:disable ClassLength
|
|
21
21
|
option "--json", :flag, "Output a result in JSON. Intended to be consumed by other programs. This will emit the file contents and install actions as a JSON object."
|
22
22
|
|
23
23
|
option "--install", :flag, "Install the program on this system. This will write files to the correct location and execute any actions to make the program available to the system."
|
24
|
+
option "--[no-]install-actions", :flag, "Run installation actions after writing files", :default => true
|
25
|
+
option "--install-prefix", "DIRECTORY", "The path to prefix file paths with. This flag is generally intended for packagers, not for users installing directly on systems.", :default => "/"
|
24
26
|
|
25
27
|
option "--verbose", :flag, "More verbose logging"
|
26
28
|
option "--debug", :flag, "Debug-level logging"
|
@@ -167,8 +169,8 @@ are made. If it fails, nagios will not start. Yay!
|
|
167
169
|
|
168
170
|
def run_human(runner)
|
169
171
|
if install?
|
170
|
-
PleaseRun::Installer.install_files(runner,
|
171
|
-
PleaseRun::Installer.install_actions(runner)
|
172
|
+
PleaseRun::Installer.install_files(runner, install_prefix, overwrite?)
|
173
|
+
PleaseRun::Installer.install_actions(runner) if install_actions?
|
172
174
|
else
|
173
175
|
tmp = Stud::Temporary.directory
|
174
176
|
actions_script = File.join(tmp, "install_actions.sh")
|
data/pleaserun.gemspec
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "pleaserun/cli"
|
2
|
+
|
3
|
+
describe PleaseRun::CLI do
|
4
|
+
subject { PleaseRun::CLI.new("pleaserun") }
|
5
|
+
|
6
|
+
context "when setting --install-prefix" do
|
7
|
+
let(:output) { Stud::Temporary.directory }
|
8
|
+
let(:name) { rand(10).times.collect { (rand(26) + 97).chr }.join }
|
9
|
+
let(:args) { [ "--install", "--install-prefix", output, "--no-install-actions", "-p", "sysv", "-v", "lsb-3.1", "--name", name, "/some/example" ] }
|
10
|
+
|
11
|
+
before do
|
12
|
+
subject.run(args)
|
13
|
+
end
|
14
|
+
after do
|
15
|
+
FileUtils.rm_r(output) if File.directory?(output)
|
16
|
+
end
|
17
|
+
it "should write files there" do
|
18
|
+
[ "/etc", "/etc/init.d", "/etc/init.d/#{name}" ].each do |path|
|
19
|
+
expect(File).to be_exists(File.join(output, path))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pleaserun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Sissel
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- lib/pleaserun/platform/sysv.rb
|
128
128
|
- lib/pleaserun/platform/upstart.rb
|
129
129
|
- pleaserun.gemspec
|
130
|
+
- spec/pleaserun/cli_spec.rb
|
130
131
|
- spec/pleaserun/configurable_spec.rb
|
131
132
|
- spec/pleaserun/mustache_methods_spec.rb
|
132
133
|
- spec/pleaserun/platform/base_spec.rb
|