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.



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/wikisys.rb', line 242

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.



240
241
242
# File 'lib/wikisys.rb', line 240

def entries
  @entries
end

#mwObject

Returns the value of attribute mw.



240
241
242
# File 'lib/wikisys.rb', line 240

def mw
  @mw
end