Class: EY::Serverside::LockfileParser::Parse09
Instance Method Summary
collapse
Methods inherited from BaseParser
#initialize
Instance Method Details
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/engineyard-serverside/lockfile_parser.rb', line 24
def parse
from_yaml = safe_yaml_load(@contents)
unless from_yaml.is_a?(Hash)
return super
end
bundler_version = from_yaml['specs'].map do |spec|
if spec.keys.first == "bundler"
spec.values.first["version"]
end
end.compact.first
[:bundler09, bundler_version]
end
|
#safe_yaml_load(loadable) ⇒ Object
38
39
40
41
42
|
# File 'lib/engineyard-serverside/lockfile_parser.rb', line 38
def safe_yaml_load(loadable)
YAML.load(loadable) rescue ArgumentError => e nil
end
|