Class: Ignorance::IgnoreFile
- Inherits:
-
Object
- Object
- Ignorance::IgnoreFile
show all
- Defined in:
- lib/ignorance/ignore_file.rb
Instance Method Summary
collapse
Instance Method Details
#exists? ⇒ Boolean
8
9
10
|
# File 'lib/ignorance/ignore_file.rb', line 8
def exists?
File.exists? ignore_file
end
|
#ignore!(token, comment = nil) ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/ignorance/ignore_file.rb', line 24
def ignore!(token, =nil)
return true if ignored?(token)
if
anchor =
if included? anchor
insert_after anchor, token
else
append "\n"
append anchor
append token
end
else append token
end
write_ignore_file
end
|
#ignored?(token) ⇒ Boolean
16
17
18
|
# File 'lib/ignorance/ignore_file.rb', line 16
def ignored?(token)
ignored.include? token
end
|
#included?(token) ⇒ Boolean
20
21
22
|
# File 'lib/ignorance/ignore_file.rb', line 20
def included?(token)
file_contents.include? token
end
|
#its_a_repo? ⇒ Boolean
12
13
14
|
# File 'lib/ignorance/ignore_file.rb', line 12
def its_a_repo?
Dir.exists? repo_dir
end
|
#name ⇒ Object
4
5
6
|
# File 'lib/ignorance/ignore_file.rb', line 4
def name
ignore_file
end
|