Module: GitCli::Ignore
- Included in:
- Gvcs::Workspace
- Defined in:
- lib/git_cli/ignore.rb
Instance Method Summary collapse
Instance Method Details
#ignore(val) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/git_cli/ignore.rb', line 22 def ignore(val) with_ignore_file do |f| f.puts val end log_debug ".gitignore file updated with line '#{val}'" [true,".gitignore file updated"] end |
#ignore_rules ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/git_cli/ignore.rb', line 30 def ignore_rules st, root = workspace_root root.strip! if st rulesFile = File.join(root,".gitignore") if File.exist?(rulesFile) File.open(rulesFile,"r") do |f| @cont = f.read end @cont else "" end else "" end end |
#update_ignore_rules(rules) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/git_cli/ignore.rb', line 48 def update_ignore_rules(rules) st, root = workspace_root root.strip! if st rulesFile = File.join(root,".gitignore") File.open(rulesFile,"w") do |f| f.write rules end end log_debug ".gitignore files is updated!" [true,".gitignore file is updated"] end |