crafterm-sprinkle 0.2.5 → 0.2.6
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.
@@ -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: crafterm-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
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- tasks/rspec.rake
|
144
144
|
has_rdoc: true
|
145
145
|
homepage: http://sprinkle.rubyforge.org
|
146
|
+
licenses:
|
146
147
|
post_install_message:
|
147
148
|
rdoc_options:
|
148
149
|
- --main
|
@@ -164,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
165
|
requirements: []
|
165
166
|
|
166
167
|
rubyforge_project: sprinkle
|
167
|
-
rubygems_version: 1.
|
168
|
+
rubygems_version: 1.3.5
|
168
169
|
signing_key:
|
169
170
|
specification_version: 2
|
170
171
|
summary: Ruby DSL based software provisioning tool
|