intent 0.8.0 → 0.8.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eceb2c98af31fff1168ee446ea327a674c510e96d5bcfb948cae895e391a8399
4
- data.tar.gz: a8225ec76a08ba859b7f8abff5729527e0426e51fff1757c26e00a63f5b5a9af
3
+ metadata.gz: d27acb8a39aba726f83801c1477900d07367459a79056db3b1b92488429f5283
4
+ data.tar.gz: 6d2bb8282844c7b4523712adfe8a4fe318ad0d778974d3734ee9c61df1cf9db4
5
5
  SHA512:
6
- metadata.gz: 7151b6b4e09485ade42fc3dc8756aeaf933d72b96acdb5d216764866d9cf52dd04cfacb828bc4f8498e2a5d90397d7db30add5ae44f3370afb0f9c5916f24765
7
- data.tar.gz: fb6b9209b34d67417a232b68e2a02dea9faf99e822252becc5d1b7dfc5a6fad5c8885ba4050258a587abc6e7afdc366e97afaf10be0ebbb768e45f2ba014987d
6
+ metadata.gz: 376368598f70ab20ecedf1ca9b3755a07c8c564b4ea860e6a1c3888472440f1f0084accaf6fef4edcd94c1bbc74437096b3e56d49535fd1a1fb5308d4326856f
7
+ data.tar.gz: 77d2f59d3dadeecc4842a452154781457fc6c62d9417f0641754a0ff80ce307b5675c73a49293efa5c298b911800e0b18a672e56b24b390071f5fcd601c3fa98
@@ -68,12 +68,20 @@ module Intent
68
68
  symbolic_path = File.join(documents.working_directory.path, 'NOTES.md')
69
69
  File.symlink(target_path, symbolic_path)
70
70
 
71
- # ignore_path = File.join(documents.working_directory.path, '.gitignore')
72
- # if File.exist?(ignore_path)
73
- # unless File.read(ignore_path).to_s.include?('NOTES.md')
74
- # File.write(ignore_path, "NOTES.md\n", mode: 'a+')
75
- # end
76
- # end
71
+ ignore_path = File.join(documents.working_directory.path, '.gitignore')
72
+ if File.exist?(ignore_path)
73
+ ignore_contents = File.read(ignore_path)
74
+ unless ignore_contents.include?('NOTES.md')
75
+ File.open(ignore_path, 'a+') do |file|
76
+ if ignore_contents[-1] == "\n"
77
+ # preserve new line at eof
78
+ file.puts('NOTES.md')
79
+ else
80
+ file.write("\nNOTES.md")
81
+ end
82
+ end
83
+ end
84
+ end
77
85
  else
78
86
  output.puts "#{project} does not have notes"
79
87
  end
@@ -1,3 +1,3 @@
1
1
  module Intent
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rickerby