Pathnames to iterate over lines, check existence
This commit is contained in:
		
							parent
							
								
									4ceb065cae
								
							
						
					
					
						commit
						179f110b8a
					
				@ -1,3 +1,5 @@
 | 
				
			|||||||
 | 
					require 'pathname'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module GitHubChangelogGenerator
 | 
					module GitHubChangelogGenerator
 | 
				
			||||||
  ParserError = Class.new(StandardError)
 | 
					  ParserError = Class.new(StandardError)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -7,15 +9,15 @@ module GitHubChangelogGenerator
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def parse!
 | 
					    def parse!
 | 
				
			||||||
      return unless File.exist?(file)
 | 
					      return unless file.exist?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      File.readlines(file).each { |line| parse_line!(line) }
 | 
					      file.each_line { |line| parse_line!(line) }
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private
 | 
					    private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def file
 | 
					    def file
 | 
				
			||||||
      @file ||= File.expand_path(@options[:params_file] || ".github_changelog_generator")
 | 
					      @file ||= Pathname(File.expand_path(@options[:params_file] || ".github_changelog_generator"))
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def parse_line!(line)
 | 
					    def parse_line!(line)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user