Class: ReadabilityImporter::Loader::InstapaperCsvLoader

Inherits:
Base
  • Object
show all
Defined in:
lib/readability_importer/loader.rb

Constant Summary collapse

NON_ASCII_REGEXP =
/[^\x00-\x7f]/u

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

type

Constructor Details

#initialize(path) ⇒ InstapaperCsvLoader

Returns a new instance of InstapaperCsvLoader.



61
62
63
# File 'lib/readability_importer/loader.rb', line 61

def initialize(path)
  @path = path
end

Class Method Details

.descObject



57
58
59
# File 'lib/readability_importer/loader.rb', line 57

def self.desc
  "Path to CSV file"
end

Instance Method Details

#loadObject



65
66
67
68
69
# File 'lib/readability_importer/loader.rb', line 65

def load
  CSV.read(@path).map do |line|
    URI.escape(line[0], NON_ASCII_REGEXP)
  end.reverse
end