Class: Bonobot::LocalFile
- Inherits:
-
Object
- Object
- Bonobot::LocalFile
- Defined in:
- lib/bonobot/local_file.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #annotation ⇒ Object
-
#initialize(path, root) ⇒ LocalFile
constructor
A new instance of LocalFile.
Constructor Details
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/bonobot/local_file.rb', line 5 def path @path end |
Instance Method Details
#annotation ⇒ Object
11 12 13 14 15 |
# File 'lib/bonobot/local_file.rb', line 11 def annotation File.readlines(@path).map do |line| line.sub(/# bonobot_fingerprint:/, "").sub("<%", "").sub("%>", "").strip if line.match?(/# bonobot_fingerprint:/) || line.match?(/<%# bonobot_fingerprint:/) end.compact.first.presence end |