sprinkle 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,7 @@ module Sprinkle
|
|
37
37
|
protected
|
38
38
|
|
39
39
|
def install_commands #:nodoc:
|
40
|
-
"echo -e '#{@text.gsub("\n", '\n')}' |#{'sudo' if option?(:sudo)}
|
40
|
+
"echo -e '#{@text.gsub("'", "'\\\\''").gsub("\n", '\n')}' |#{'sudo ' if option?(:sudo)}tee -a #{@path}"
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
data/lib/sprinkle/version.rb
CHANGED
@@ -32,23 +32,34 @@ describe Sprinkle::Installers::PushText do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should invoke the push text installer for all specified packages' do
|
35
|
-
@install_commands.should
|
35
|
+
@install_commands.should == %q[echo -e 'another-hair-brained-idea' |tee -a /dev/mind/late-night]
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should automatically insert pre/post commands for the specified package' do
|
39
|
-
@installer.send(:install_sequence).should == [ 'op1', "echo -e 'another-hair-brained-idea' |
|
39
|
+
@installer.send(:install_sequence).should == [ 'op1', "echo -e 'another-hair-brained-idea' |tee -a /dev/mind/late-night", 'op2' ]
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
43
43
|
|
44
44
|
describe 'running with sudo' do
|
45
45
|
before do
|
46
|
-
@installer = create_text "
|
46
|
+
@installer = create_text "a special user", "/dev/mind/the-day-after", :sudo => true
|
47
47
|
@install_commands = @installer.send :install_commands
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should invoke the push installer with sudo" do
|
51
|
-
@install_commands.should
|
51
|
+
@install_commands.should == %q[echo -e 'a special user' |sudo tee -a /dev/mind/the-day-after]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'sending a string with single quotes' do
|
56
|
+
before do
|
57
|
+
@installer = create_text "I'm a string with a single quote", "/dev/mind/the-day-after"
|
58
|
+
@install_commands = @installer.send :install_commands
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should correctly encode the single quote character" do
|
62
|
+
@install_commands.should == %q[echo -e 'I'\''m a string with a single quote' |tee -a /dev/mind/the-day-after]
|
52
63
|
end
|
53
64
|
end
|
54
65
|
|
data/sprinkle.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprinkle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Crafter
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-12 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|