lib/kontena/cli/apps/common.rb in kontena-cli-0.15.1 vs lib/kontena/cli/apps/common.rb in kontena-cli-0.15.2
- old
+ new
@@ -31,11 +31,11 @@
# @param [Hash] yaml
# @param [String] version
# @return [Hash]
def generate_services(yaml_services, version)
services = {}
- if version == '2'
+ if version.to_i == 2
generator_klass = ServiceGeneratorV2
else
generator_klass = ServiceGenerator
end
yaml_services.each do |service_name, config|
@@ -61,10 +61,10 @@
end
def project_name_from_yaml(file)
reader = YAML::Reader.new(file, true)
outcome = reader.execute
- if outcome[:version] == '2'
+ if outcome[:version].to_i == 2
outcome[:name]
else
nil
end
end