lib/berkshelf/lockfile.rb in berkshelf-7.0.10 vs lib/berkshelf/lockfile.rb in berkshelf-7.1.0

- old
+ new

@@ -509,12 +509,12 @@ # @private def inspect "#<Berkshelf::Lockfile #{Pathname.new(filepath).basename}, dependencies: #{dependencies.inspect}>" end - # The class responsible for parsing the lockfile and turning it into a - # useful data structure. + # The class responsible for parsing the lockfile and turning it into a + # useful data structure. class LockfileParser NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?'.freeze DEPENDENCY_PATTERN = /^ {2}#{NAME_VERSION}$/.freeze DEPENDENCIES_PATTERN = /^ {4}#{NAME_VERSION}$/.freeze OPTION_PATTERN = /^ {4}(.+)\: (.+)/.freeze @@ -597,13 +597,13 @@ true end private - # Parse a dependency line. - # - # @param [String] line + # Parse a dependency line. + # + # @param [String] line def parse_dependency(line) if line =~ DEPENDENCY_PATTERN name, version = $1, $2 @parsed_dependencies[name] ||= {} @@ -613,13 +613,13 @@ key, value = $1, $2 @current_dependency[key.to_sym] = value end end - # Parse a graph line. - # - # @param [String] line + # Parse a graph line. + # + # @param [String] line def parse_graph(line) if line =~ DEPENDENCY_PATTERN name, version = $1, $2 @lockfile.graph.find(name) || @lockfile.graph.add(name, version) @@ -629,10 +629,10 @@ @lockfile.graph.find(@current_lock).add_dependency(name, constraint) end end end - # The class representing an internal graph. + # The class representing an internal graph. class Graph include Enumerable # Create a new Lockfile graph. #