Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for commenting out lines matching pattern
- Loading branch information
Geoff Williams
committed
Feb 15, 2017
1 parent
ac2a065
commit 63cf27c
Showing
12 changed files
with
106 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ Gemfile.lock | |
Puppetfile.lock | ||
.librarian | ||
.tmp | ||
/pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# @PDQTest | ||
comment_line { "/foo/bar baz": | ||
path => "/foo/bar", | ||
match => "bar", | ||
ensure => commented, | ||
path => "/foo/bar", | ||
match => "bar", | ||
} | ||
|
||
comment_line { "/foo/bar bas": | ||
ensure => commented, | ||
path => "/foo/bar", | ||
match => "bas", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# @PDQTest | ||
|
||
# needs uncommenting | ||
comment_line { "/foo/bar I went home": | ||
ensure => uncommented, | ||
path => "/foo/bar", | ||
match => "I went home", | ||
} | ||
|
||
# already uncommmented | ||
comment_line { "/foo/bar I had a drink": | ||
ensure => uncommented, | ||
path => "/foo/bar", | ||
match => "I had a drink", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# BATS test file to run after executing 'examples/init.pp' with puppet. | ||
# | ||
# For more info on BATS see https://github.com/sstephenson/bats | ||
|
||
# Tests are really easy! just the exit status of running a command... | ||
@test "bar left alone" { | ||
grep '^I went to the bar' /foo/bar | ||
} | ||
|
||
@test "bas left alone" { | ||
grep '^I programmed in basic' /foo/bar | ||
} | ||
|
||
@test "drink left alone" { | ||
grep '^I had a drink' /foo/bar | ||
} | ||
|
||
@test "line uncommented" { | ||
grep '^I went home' /foo/bar | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# BATS test file to run before executing 'examples/init.pp' with puppet. | ||
# | ||
# For more info on BATS see https://github.com/sstephenson/bats | ||
|
||
# Tests are really easy! just the exit status of running a command... | ||
@test "testcase installed" { | ||
grep '# I went home' /foo/bar | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
mkdir /foo/ -p | ||
cat > /foo/bar <<END | ||
I went to the bar | ||
I had a drink | ||
# I went home | ||
I programmed in basic | ||
END |