lib/stove/cookbook/metadata.rb in stove-2.0.0 vs lib/stove/cookbook/metadata.rb in stove-3.0.0
- old
+ new
@@ -1,7 +1,6 @@
require 'json'
-require 'solve'
module Stove
class Cookbook
# Borrowed and modified from:
# {https://raw.github.com/opscode/chef/11.4.0/lib/chef/cookbook/metadata.rb}
@@ -39,11 +38,11 @@
def def_meta_cookbook(field, instance_variable)
class_eval <<-EOM, __FILE__, __LINE__ + 1
def #{field}(thing, *args)
version = args.first
- @#{instance_variable}[thing] = Solve::Constraint.new(version).to_s
+ @#{instance_variable}[thing] = version.to_s
@#{instance_variable}[thing]
end
EOM
end
@@ -144,13 +143,12 @@
end
end
def version(arg = UNSET_VALUE)
if arg == UNSET_VALUE
- @version.to_s
+ @version
else
- @version = Solve::Version.new(arg)
- @version.to_s
+ @version = arg.to_s
end
end
def to_hash
{