Class: LicenseAuto::Readme
- Inherits:
-
Object
- Object
- LicenseAuto::Readme
- Defined in:
- lib/license_auto/license/readme.rb
Instance Attribute Summary collapse
-
#license_content ⇒ Object
readonly
RDOC_EXT = /.rdoc$/ RDOC_PATTERN = //.
Instance Method Summary collapse
- #extensions ⇒ Object
- #formator(filename) ⇒ Object
-
#initialize(filename, content) ⇒ Readme
constructor
A new instance of Readme.
Constructor Details
#initialize(filename, content) ⇒ Readme
Returns a new instance of Readme.
16 17 18 19 |
# File 'lib/license_auto/license/readme.rb', line 16 def initialize(filename, content) impl = formator(filename) @license_content = impl.cut_license(content) end |
Instance Attribute Details
#license_content ⇒ Object (readonly)
RDOC_EXT = /.rdoc$/ RDOC_PATTERN = //
RST_EXT = /.rst/ RST_PATTERN = //
14 15 16 |
# File 'lib/license_auto/license/readme.rb', line 14 def license_content @license_content end |
Instance Method Details
#extensions ⇒ Object
21 22 23 |
# File 'lib/license_auto/license/readme.rb', line 21 def extensions [Markdown] end |
#formator(filename) ⇒ Object
25 26 27 28 29 |
# File 'lib/license_auto/license/readme.rb', line 25 def formator(filename) extensions.find { |format| format::FILE_EXTENSION.match(filename) } end |