Class: Rebundler::Parser
- Inherits:
-
Object
- Object
- Rebundler::Parser
- Defined in:
- lib/rebundler/parser.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#directives ⇒ Object
readonly
Returns the value of attribute directives.
-
#frozen_string_literal ⇒ Object
readonly
Returns the value of attribute frozen_string_literal.
-
#gem_sets ⇒ Object
readonly
Returns the value of attribute gem_sets.
Class Method Summary collapse
Instance Method Summary collapse
- #format(overwrite_comments: false) ⇒ Object
-
#initialize(content) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
7 8 9 |
# File 'lib/rebundler/parser.rb', line 7 def comments @comments end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/rebundler/parser.rb', line 7 def content @content end |
#directives ⇒ Object (readonly)
Returns the value of attribute directives.
7 8 9 |
# File 'lib/rebundler/parser.rb', line 7 def directives @directives end |
#frozen_string_literal ⇒ Object (readonly)
Returns the value of attribute frozen_string_literal.
7 8 9 |
# File 'lib/rebundler/parser.rb', line 7 def frozen_string_literal @frozen_string_literal end |
#gem_sets ⇒ Object (readonly)
Returns the value of attribute gem_sets.
7 8 9 |
# File 'lib/rebundler/parser.rb', line 7 def gem_sets @gem_sets end |
Class Method Details
.from_file(path) ⇒ Object
9 10 11 12 13 |
# File 'lib/rebundler/parser.rb', line 9 def self.from_file(path) raise Rebundler::Error, "File not found: #{path}" unless File.exist?(path) new(File.read(path)) end |
.from_string(content) ⇒ Object
15 16 17 |
# File 'lib/rebundler/parser.rb', line 15 def self.from_string(content) new(content) end |