Module: Codesake::Utils::Files
- Included in:
- Engine::Generic, Engine::Jsp, Engine::Text
- Defined in:
- lib/codesake/utils/files.rb
Instance Attribute Summary collapse
-
#file_content ⇒ Object
readonly
Returns the value of attribute file_content.
-
#filename ⇒ Object
Returns the value of attribute filename.
Instance Method Summary collapse
Instance Attribute Details
#file_content ⇒ Object (readonly)
Returns the value of attribute file_content.
6 7 8 |
# File 'lib/codesake/utils/files.rb', line 6 def file_content @file_content end |
#filename ⇒ Object
Returns the value of attribute filename.
5 6 7 |
# File 'lib/codesake/utils/files.rb', line 5 def filename @filename end |
Instance Method Details
#lines ⇒ Object
13 14 15 |
# File 'lib/codesake/utils/files.rb', line 13 def lines @file_content.count end |
#lines_of_comment ⇒ Object
17 18 19 |
# File 'lib/codesake/utils/files.rb', line 17 def lines_of_comment 0 end |
#loc ⇒ Object
20 21 22 |
# File 'lib/codesake/utils/files.rb', line 20 def loc 0 end |
#read_file ⇒ Object
8 9 10 11 |
# File 'lib/codesake/utils/files.rb', line 8 def read_file @file_content = [] @file_content = File.readlines(@filename) if File.exists?(@filename) end |