Class: Wikisys::Pages

Inherits:
Object
  • Object
show all
Defined in:
lib/wikisys.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filepath = '.', debug: false) ⇒ Pages

Returns a new instance of Pages.



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/wikisys.rb', line 292

def initialize(filepath='.', debug: false)
  
  @filepath, @debug = filepath, debug
  
  entries_file = File.join(@filepath, 'entries.txt')
  
  if File.exists?(entries_file) then
    @entries = DxLite.new(entries_file)
  else
    @entries = DxLite.new('entries/entry(title, tags)')
    @entries.save entries_file
  end

  # check for the mindwords raw document file
  mindwords_file = File.join(@filepath, 'mindwords.txt')
  
  if File.exists?(mindwords_file) then 
    @mw = MindWords.new(mindwords_file)
  else
    @mw = MindWords.new
    @mw.filepath = mindwords_file
  end
  
  scan_md_files()
  
end

Instance Attribute Details

#entriesObject

Returns the value of attribute entries.



290
291
292
# File 'lib/wikisys.rb', line 290

def entries
  @entries
end

#mwObject

Returns the value of attribute mw.



290
291
292
# File 'lib/wikisys.rb', line 290

def mw
  @mw
end