lib/postit/parser.rb in postit-0.1.1 vs lib/postit/parser.rb in postit-0.1.2
- old
+ new
@@ -1,16 +1,17 @@
+require 'rubygems'
+
module PostIt
class Parser
def initialize(file)
@file = file
end
BUNDLED_WITH =
/\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
def parse
- lockfile = File.read(@file) if File.file?(@file)
- return unless lockfile
+ return unless lockfile = File.file?(@file) && File.read(@file)
if lockfile =~ BUNDLED_WITH
Regexp.last_match(1)
else
'< 1.10'
end