Class: Fmedit::Files

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Files

Returns a new instance of Files.



7
8
9
# File 'lib/fmedit.rb', line 7

def initialize dir
  @markdown_files = File.join(dir)
end

Instance Attribute Details

#markdown_filesObject (readonly)

Returns the value of attribute markdown_files.



6
7
8
# File 'lib/fmedit.rb', line 6

def markdown_files
  @markdown_files
end

Instance Method Details

#eachObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fmedit.rb', line 11

def each
  Dir.glob(markdown_files).each do |filename|
    editor = Editor.new filename
    yield editor
  end

  # f.add "hidden", true if f.get("published").nil?
  # f.add "published", true

  # if f.get("hidden") == true && f.get("published") == true
    # f.add "exclude_from_pagination", true
  # end
  # f.remove "hidden"
  # f.print!
  # f.edit "image", /^((?!images\/.+|\/|http).*)$/, "/images/\\1"
  # f.edit "image", /^(images\/.+)$/, "\/\\1"
  # f.print!
end