Class: Seiton::Ignores
- Inherits:
-
Object
- Object
- Seiton::Ignores
- Defined in:
- lib/seiton/ignores.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(ignores_file, ignores_list) ⇒ Ignores
constructor
A new instance of Ignores.
Constructor Details
#initialize(ignores_file, ignores_list) ⇒ Ignores
Returns a new instance of Ignores.
3 4 5 6 |
# File 'lib/seiton/ignores.rb', line 3 def initialize(ignores_file, ignores_list) @file = ignores_file @list = ignores_list end |
Instance Method Details
#generate ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/seiton/ignores.rb', line 8 def generate ignores = [] begin File.open(@file) do |file| file.read.split("\n").each do |ignore| ignores << ignore end end rescue SystemCallError => e puts e. exit 1 rescue IOError => e puts e. exit 1 end unless @file.nil? ignores.concat(@list) unless @list.nil? ignores end |