Last active
March 28, 2018 21:53
Revisions
-
allaire revised this gist
Mar 23, 2018 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ def template(from, to, options = {}) template_path = File.expand_path("../../templates/#{from}", __FILE__) template = ERB.new(File.new(template_path).read).result(binding) upload! StringIO.new(template), to, mode: 0644 # Otherwise it's set to 0640, which is not readable by other users (https://github.com/net-ssh/net-scp/blob/master/lib/net/scp/upload.rb#L63) sudo "chown root:root #{to}" if options[:as_root] end -
allaire revised this gist
Mar 23, 2018 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,5 @@ def template(from, to, as_root = false) template = ERB.new(File.new(template_path).read).result(binding) upload! StringIO.new(template), to sudo "chown root:root #{to}" if as_root == true end -
allaire revised this gist
Dec 7, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ def template(from, to, as_root = false) template_path = File.expand_path("../../templates/#{from}", __FILE__) template = ERB.new(File.new(template_path).read).result(binding) upload! StringIO.new(template), to -
allaire renamed this gist
Jan 14, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
allaire created this gist
Jan 14, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ def template(from, to, as_root = false) template_path = File.expand_path("../templates/#{from}", __FILE__) template = ERB.new(File.new(template_path).read).result(binding) upload! StringIO.new(template), to sudo "chmod 644 #{to}" # ensure default file chmod sudo "chown root:root #{to}" if as_root == true end