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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b75cc7758690fb971b56d5165e28d94905aee46e
4
- data.tar.gz: 09b2a63296a6371d22c6539bbaeeaac92d562a9a
3
+ metadata.gz: d43af3b87d707e6e42eb6c765663b0d5bb4f7d4b
4
+ data.tar.gz: a366b616187163c072131a2820595cb739856294
5
5
  SHA512:
6
- metadata.gz: df6e5dc9eaa748011b70f43571c935636f88b0c42cbafaca10fb9ba2ef05113c4cffc5cebf567c705b0260f43e7cc178d655f279a41c481a98ba25dfb5bde912
7
- data.tar.gz: ae58a7cd28f9408737aae00e92ad9e90efb240cb2c79b18009622b44c89298de521ce21ab757ab9fd8cd61840cc973e09c47c017126ead9b7de25f3b950a2f7d
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, "/", overwrite?)
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
@@ -2,7 +2,7 @@ Gem::Specification.new do |spec|
2
2
  files = `git ls-files`.split("\n")
3
3
 
4
4
  spec.name = "pleaserun"
5
- spec.version = "0.0.8"
5
+ spec.version = "0.0.9"
6
6
  spec.summary = "pleaserun"
7
7
  spec.description = "pleaserun"
8
8
  spec.license = "Apache 2.0"
@@ -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.8
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