Class: Xpub::CallBook::CallMdFiles
- Inherits:
-
Object
- Object
- Xpub::CallBook::CallMdFiles
- Defined in:
- lib/xpub/dsl/src_file.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
- #debug ⇒ Object
- #full_path ⇒ Object
-
#initialize(dir) ⇒ CallMdFiles
constructor
A new instance of CallMdFiles.
- #md_files ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize(dir) ⇒ CallMdFiles
Returns a new instance of CallMdFiles.
65 66 67 |
# File 'lib/xpub/dsl/src_file.rb', line 65 def initialize(dir) @dir = dir end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
63 64 65 |
# File 'lib/xpub/dsl/src_file.rb', line 63 def dir @dir end |
Instance Method Details
#debug ⇒ Object
86 87 88 |
# File 'lib/xpub/dsl/src_file.rb', line 86 def debug p full_path end |
#full_path ⇒ Object
69 70 71 |
# File 'lib/xpub/dsl/src_file.rb', line 69 def full_path "#{Dir.getwd}/src/#{@dir}" end |
#md_files ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/xpub/dsl/src_file.rb', line 77 def md_files validate Dir.glob("#{full_path}/**/*.md").sort.map do |path| mf = CallMdFile.new path.sub("#{Dir.getwd}/src/", '') mf.validate mf end end |
#validate ⇒ Object
73 74 75 |
# File 'lib/xpub/dsl/src_file.rb', line 73 def validate raise "Markdown Dir does not exist.#{full_path}" unless Dir.exist? full_path end |