lib/git_cli/ignore.rb in git_cli-0.12.0 vs lib/git_cli/ignore.rb in git_cli-0.13.6

- old
+ new

@@ -30,55 +30,58 @@ log_debug ".gitignore file updated with line '#{val}'" [true,".gitignore file updated"] end def ignore_rules - st, root = workspace_root + #st, root = workspace_root + root = workspace_root root.strip! - if st + #if st rulesFile = File.join(root,".gitignore") if File.exist?(rulesFile) File.open(rulesFile,"r") do |f| @cont = f.read end #@cont @cont.each_line.to_a.delete_if { |l| l.strip.empty? } else [] end - else - [] - end + #else + # [] + #end end def update_ignore_rules(rules) - st, root = workspace_root + #st, root = workspace_root + root = workspace_root root.strip! - if st + #if st rulesFile = File.join(root,".gitignore") File.open(rulesFile,"w") do |f| f.write rules end - end + #end log_debug ".gitignore files is updated!" [true,".gitignore file is updated"] end private def with_ignore_file(mode = "a", &block) mode = "a" if is_empty?(mode) if block - st, root = workspace_root + #st, root = workspace_root + root = workspace_root root.strip! - if st + #if st igPath = File.join(root,".gitignore") FileUtils.touch(igPath) if not File.exist?(igPath) File.open(igPath,mode) do |f| block.call(f) end - else - raise GitCliException, "Cannot get workspace root. Probably not a GIT workspace?" - end + #else + # raise GitCliException, "Cannot get workspace root. Probably not a GIT workspace?" + #end end end end end