Top Level Namespace

Includes:
ActionView::Helpers::DateHelper, Curses, FileUtils

Defined Under Namespace

Modules: CharacterCleaner, EntryController, GPLType Classes: Autodiscovery, CommandParser, CommandWindow, CursesController, Display, Entry, EntryWindow, Fastreader, Feed, HTMLEntities, MenuPager, MenuWindow, OPMLImporter, String, VirtualFeed

Constant Summary collapse

LOGGER =

production mode

Logger.new(logfile)
FASTREADER_CONTROLLER =
Fastreader.new(:database => database,
:no_links => true, 
:simple => true, 
:curses => true, 
:width => 60)

Instance Method Summary collapse

Instance Method Details

#preprocess(command_string) ⇒ Object



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/fastreader.rb', line 231

def preprocess(command_string)
  
  # Preprocessing steps to make the command a valid Ruby statement:
 
  # If the command is simply a url, then subscribe to it
  if command_string.strip =~ /^http:/
    command_string = "subscribe " + command_string
  end
  
  
  # Surround any url with quotes:
  command_string = command_string.gsub(/(http:[^\s]*)/, '"\1"')

  # default action is list feeds
  if command_string.strip == ""
    command_string = "ls"
  end
  command_string
end

#reloadObject

for development



226
227
228
229
# File 'lib/fastreader.rb', line 226

def reload
  puts "Reloading " + __FILE__ 
  load __FILE__
end

#run(argv) ⇒ Object



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/fastreader.rb', line 264

def run(argv)
  # If there are arguments, then interpret them directly. Otherwise, start
  # an interactive session.
  
  command = preprocess(argv.join(' '))

  # If the command is an OPML file, import the feeds in it 
  if command.strip =~ /\.opml$/
    puts "Importing OPML: #{command}"
    FASTREADER_CONTROLLER.import_opml File.read(command.strip)
  else
    eval(command, FASTREADER_CONTROLLER.get_binding)
  end

end