Class: PostIt::Parser
- Inherits:
-
Object
- Object
- PostIt::Parser
- Defined in:
- lib/postit/parser.rb
Constant Summary collapse
- BUNDLED_WITH =
/\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
Instance Method Summary collapse
-
#initialize(file) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(file) ⇒ Parser
Returns a new instance of Parser.
5 6 7 |
# File 'lib/postit/parser.rb', line 5 def initialize(file) @file = file end |
Instance Method Details
#parse ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/postit/parser.rb', line 12 def parse return unless lockfile = File.file?(@file) && File.read(@file) if lockfile =~ BUNDLED_WITH Regexp.last_match(1) else '< 1.10' end end |