vendor/dependencies/lib/dependencies/dep.rb in benschwarz-smoke-0.5.3 vs vendor/dependencies/lib/dependencies/dep.rb in benschwarz-smoke-0.5.4
- old
+ new
@@ -1,22 +1,6 @@
-require "pathname"
-
class Dep
- DependenciesFileNotFound = Class.new(StandardError)
-
- def self.dependencies_file
- current = Pathname.new(Dir.pwd)
-
- until current.root?
- filename = current.join("dependencies")
- return filename if filename.exist? and filename.file?
- current = current.parent
- end
-
- raise DependenciesFileNotFound
- end
-
class Dependency
attr :name
attr :version
attr :environment
attr :url
@@ -76,10 +60,10 @@
def initialize(dependencies)
@dependencies = []
@missing = []
dependencies.each_line do |line|
- next unless line =~ /^([\w\-_]+)\s*([<~=>]* ?[\d\.]+)?\s*(?: \(([\w, ]+)\))?\s*(?: ([a-z]+:\/\/.+?))?\s*$/
+ next unless line =~ /^([\w\-_]+) ?([<~=> \d\.]+)?(?: \(([\w, ]+)\))?(?: ([a-z]+:\/\/.+?))?$/
@dependencies << Dependency.new($1, $2, $3, $4)
end
end
def filter(environment)