Hello community, here is the log from the commit of package yast2-docker for openSUSE:Factory checked in at 2018-01-17 21:42:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-docker (Old) and /work/SRC/openSUSE:Factory/.yast2-docker.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-docker" Wed Jan 17 21:42:49 2018 rev:9 rq:558805 version:4.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-docker/yast2-docker.changes 2017-03-24 02:17:25.823925814 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-docker.new/yast2-docker.changes 2018-01-17 21:42:51.414606011 +0100 @@ -1,0 +2,19 @@ +Wed Dec 20 10:29:04 UTC 2017 - dims...@opensuse.org + +- Add ExcludeArch: %ix86 s390 ppc: do not build yast2-docker on + archs where docker is not provided (boo#1073650). + +------------------------------------------------------------------- +Fri Nov 17 12:33:34 UTC 2017 - enava...@suse.com + +- Release 4.0.0 +- Fix listing docker images without any tag (bsc#1068688). + +------------------------------------------------------------------- +Thu Aug 10 16:01:27 UTC 2017 - an...@suse.com + +- Use yast2-storage-ng instead of yast2-storage to display the + size of the images (part of fate#318196). +- 3.3.0 + +------------------------------------------------------------------- Old: ---- yast2-docker-3.2.0.tar.bz2 New: ---- yast2-docker-4.0.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-docker.spec ++++++ --- /var/tmp/diff_new_pack.7P47Qa/_old 2018-01-17 21:42:52.154571375 +0100 +++ /var/tmp/diff_new_pack.7P47Qa/_new 2018-01-17 21:42:52.158571189 +0100 @@ -24,9 +24,11 @@ ###################################################################### Name: yast2-docker -Version: 3.2.0 +Version: 4.0.0 Release: 0 BuildArch: noarch +# ExcludeArch in sync with docker.spec +ExcludeArch: %ix86 s390 ppc BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 @@ -34,7 +36,7 @@ Requires: docker >= 1.3 Requires: yast2 >= 3.1.0 Requires: yast2-ruby-bindings >= 1.2.0 -Requires: yast2-storage +Requires: yast2-storage-ng Requires: rubygem(%{rb_default_ruby_abi}:docker-api) BuildRequires: update-desktop-files ++++++ yast2-docker-3.2.0.tar.bz2 -> yast2-docker-4.0.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/.rubocop.yml new/yast2-docker-4.0.0/.rubocop.yml --- old/yast2-docker-3.2.0/.rubocop.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-docker-4.0.0/.rubocop.yml 2017-12-20 12:26:19.000000000 +0100 @@ -0,0 +1,4 @@ +# use the shared Yast defaults +inherit_from: + - /usr/share/YaST2/data/devtools/data/rubocop_yast_style.yml + - .rubocop_todo.yml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/.rubocop_todo.yml new/yast2-docker-4.0.0/.rubocop_todo.yml --- old/yast2-docker-3.2.0/.rubocop_todo.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-docker-4.0.0/.rubocop_todo.yml 2017-12-20 12:26:19.000000000 +0100 @@ -0,0 +1,32 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2017-11-14 10:12:53 +0000 using RuboCop version 0.41.2. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# Configuration parameters: CountComments. +Metrics/ClassLength: + Max: 277 + +# Offense count: 2 +Metrics/CyclomaticComplexity: + Max: 14 + +# Offense count: 1 +# Configuration parameters: CountComments. +Metrics/MethodLength: + Max: 35 + +# Offense count: 5 +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'src/lib/ydocker/changes_dialog.rb' + - 'src/lib/ydocker/commit_dialog.rb' + - 'src/lib/ydocker/inject_shell_dialog.rb' + - 'src/lib/ydocker/main_dialog.rb' + - 'src/lib/ydocker/run_image_dialog.rb' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/.yardopts new/yast2-docker-4.0.0/.yardopts --- old/yast2-docker-3.2.0/.yardopts 2017-03-13 11:59:43.824294007 +0100 +++ new/yast2-docker-4.0.0/.yardopts 2017-12-20 12:26:19.000000000 +0100 @@ -2,4 +2,5 @@ --protected --markup markdown --readme README.md +--output-dir ./doc/autodocs src/**/*.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/Dockerfile new/yast2-docker-4.0.0/Dockerfile --- old/yast2-docker-3.2.0/Dockerfile 2017-03-13 11:59:43.836294007 +0100 +++ new/yast2-docker-4.0.0/Dockerfile 2017-12-20 12:26:19.000000000 +0100 @@ -1,3 +1,4 @@ FROM yastdevel/ruby +RUN zypper --non-interactive in --force-resolution rubygem-docker-api COPY . /usr/src/app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/README.md new/yast2-docker-4.0.0/README.md --- old/yast2-docker-3.2.0/README.md 2017-03-13 11:59:43.848294007 +0100 +++ new/yast2-docker-4.0.0/README.md 2017-12-20 12:26:19.000000000 +0100 @@ -1,6 +1,7 @@ # YaST Docker Module [![Build Status](https://travis-ci.org/yast/yast-docker.svg?branch=master)](https://travis-ci.org/yast/yast-docker) +[![Coverage Status](https://coveralls.io/repos/github/yast/yast-docker/badge.svg?branch=master)](https://coveralls.io/github/yast/yast-docker?branch=master) This module provides access to a Docker daemon running on the server. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/Rakefile new/yast2-docker-4.0.0/Rakefile --- old/yast2-docker-3.2.0/Rakefile 2017-03-13 11:59:43.848294007 +0100 +++ new/yast2-docker-4.0.0/Rakefile 2017-12-20 12:26:19.000000000 +0100 @@ -19,6 +19,6 @@ require "yast/rake" Yast::Tasks.configuration do |conf| - #lets ignore license check for now + # lets ignore license check for now conf.skip_license_check << /\.desktop$/ end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/package/yast2-docker.changes new/yast2-docker-4.0.0/package/yast2-docker.changes --- old/yast2-docker-3.2.0/package/yast2-docker.changes 2017-03-13 11:59:43.984294007 +0100 +++ new/yast2-docker-4.0.0/package/yast2-docker.changes 2017-12-20 12:26:19.000000000 +0100 @@ -1,4 +1,23 @@ ------------------------------------------------------------------- +Wed Dec 20 10:29:04 UTC 2017 - dims...@opensuse.org + +- Add ExcludeArch: %ix86 s390 ppc: do not build yast2-docker on + archs where docker is not provided (boo#1073650). + +------------------------------------------------------------------- +Fri Nov 17 12:33:34 UTC 2017 - enava...@suse.com + +- Release 4.0.0 +- Fix listing docker images without any tag (bsc#1068688). + +------------------------------------------------------------------- +Thu Aug 10 16:01:27 UTC 2017 - an...@suse.com + +- Use yast2-storage-ng instead of yast2-storage to display the + size of the images (part of fate#318196). +- 3.3.0 + +------------------------------------------------------------------- Mon Mar 13 10:00:26 UTC 2017 - an...@suse.com - Fixed RPM packaging error (bsc#1029088) @@ -64,5 +83,5 @@ ------------------------------------------------------------------- Mon Sep 22 09:05:01 UTC 2014 - jreidin...@suse.com -- initial package +- initial package diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/package/yast2-docker.spec new/yast2-docker-4.0.0/package/yast2-docker.spec --- old/yast2-docker-3.2.0/package/yast2-docker.spec 2017-03-13 11:59:43.984294007 +0100 +++ new/yast2-docker-4.0.0/package/yast2-docker.spec 2017-12-20 12:26:19.000000000 +0100 @@ -24,16 +24,18 @@ ###################################################################### Name: yast2-docker -Version: 3.2.0 +Version: 4.0.0 Release: 0 BuildArch: noarch +# ExcludeArch in sync with docker.spec +ExcludeArch: %ix86 s390 ppc BuildRoot: %{_tmppath}/%{name}-build Source0: %{name}-%{version}.tar.bz2 Requires: yast2 >= 3.1.0 Requires: yast2-ruby-bindings >= 1.2.0 -Requires: yast2-storage +Requires: yast2-storage-ng Requires: rubygem(%{rb_default_ruby_abi}:docker-api) Requires: docker >= 1.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/src/lib/ydocker/changes_dialog.rb new/yast2-docker-4.0.0/src/lib/ydocker/changes_dialog.rb --- old/yast2-docker-3.2.0/src/lib/ydocker/changes_dialog.rb 2017-03-13 11:59:44.016294007 +0100 +++ new/yast2-docker-4.0.0/src/lib/ydocker/changes_dialog.rb 2017-12-20 12:26:19.000000000 +0100 @@ -48,7 +48,7 @@ end def controller_loop - while true do + loop do input = Yast::UI.UserInput case input when :ok, :cancel @@ -71,7 +71,6 @@ Heading(_("Changes in Container")) end - def changes_table Table( Id(:changes_table), @@ -83,16 +82,15 @@ ) end - STATUS_MAPPING = { # TODO translation - 0 => ("Modified"), - 1 => ("Created"), - 2 => ("Deleted") - } + STATUS_MAPPING = { # TODO: translation + 0 => "Modified", + 1 => "Created", + 2 => "Deleted" + }.freeze def changes_items changes = @container.changes changes.reject! do |change| - path = change["Path"] changes.any? do |change2| change["Path"] != change2["Path"] && change2["Path"].start_with?(change["Path"]) end @@ -101,7 +99,7 @@ changes.map do |change| Item( change["Path"], - ((STATUS_MAPPING[change["Kind"]] || change["Kind"]).to_s) + (STATUS_MAPPING[change["Kind"]] || change["Kind"]).to_s ) end end @@ -109,6 +107,5 @@ def ending_buttons PushButton(Id(:ok), _("&Exit")) end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/src/lib/ydocker/commit_dialog.rb new/yast2-docker-4.0.0/src/lib/ydocker/commit_dialog.rb --- old/yast2-docker-3.2.0/src/lib/ydocker/commit_dialog.rb 2017-03-13 11:59:44.020294007 +0100 +++ new/yast2-docker-4.0.0/src/lib/ydocker/commit_dialog.rb 2017-12-20 12:26:19.000000000 +0100 @@ -49,7 +49,7 @@ end def controller_loop - while true do + loop do input = Yast::UI.UserInput case input when :ok @@ -81,7 +81,6 @@ Heading(_("Commit Container")) end - def contents VBox( ComboBox( @@ -117,7 +116,7 @@ def images return @images if @images - @images = Hash.new {|h, k| h[k] = Hash.new {|h2, k2| h2[k2] = []} } + @images = Hash.new { |h, k| h[k] = Hash.new { |h2, k2| h2[k2] = [] } } Docker::Image.all.each do |image| image.info["RepoTags"].each do |repo_tag| matches = repo_tag.match(/\A(?:([^\/]+)\/)?([^:]+)(?::(.+))?\z/) @@ -134,7 +133,7 @@ def available_repositories keys = images.keys keys.delete("") - repos = keys.map{|repo_name| Item(Id(repo_name), repo_name) } + repos = keys.map { |repo_name| Item(Id(repo_name), repo_name) } repos << Item(Id(""), "", true) end @@ -142,7 +141,7 @@ selected = Yast::UI.QueryWidget(:repository, :Value) if images[selected] keys = images[selected].keys - images = keys.map{|image_name| Item(Id(image_name), image_name) } + keys.map { |image_name| Item(Id(image_name), image_name) } else [Item(Id(""), "", true)] end @@ -180,10 +179,10 @@ end repo += selected_name - options = { 'repo' => repo } - options['tag'] = selected_tag if selected_tag - options['m'] = message if message - options['author'] = author if author + options = { "repo" => repo } + options["tag"] = selected_tag if selected_tag + options["m"] = message if message + options["author"] = author if author Yast::Builtins.y2milestone( "Going to commit new image using the following options: #{options.inspect}" @@ -191,6 +190,5 @@ @container.commit(options) end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/src/lib/ydocker/inject_shell_dialog.rb new/yast2-docker-4.0.0/src/lib/ydocker/inject_shell_dialog.rb --- old/yast2-docker-3.2.0/src/lib/ydocker/inject_shell_dialog.rb 2017-03-13 11:59:44.028294007 +0100 +++ new/yast2-docker-4.0.0/src/lib/ydocker/inject_shell_dialog.rb 2017-12-20 12:26:19.000000000 +0100 @@ -49,7 +49,7 @@ end def controller_loop - while true do + loop do input = Yast::UI.UserInput case input when :ok @@ -75,7 +75,6 @@ Heading(_("Inject Shell")) end - def contents VBox( ComboBox( @@ -94,24 +93,26 @@ ) end - SHELLS = [ "bash", "sh", "zsh", "csh" ] + SHELLS = ["bash", "sh", "zsh", "csh"].freeze def proposed_shells - SHELLS.map{|shell| Item(Id(shell), shell) } + SHELLS.map { |shell| Item(Id(shell), shell) } end def attach selected_shell = Yast::UI.QueryWidget(:shell, :Value) if Yast::UI.TextMode - Yast::UI.RunInTerminal("docker exec -ti #{@container.id} #{Shellwords.escape selected_shell} 2>&1") + Yast::UI.RunInTerminal( + "docker exec -ti #{@container.id} #{Shellwords.escape selected_shell} 2>&1" + ) else - res = `xterm -e 'docker exec -ti #{@container.id} #{Shellwords.escape selected_shell} || (echo "Failed to attach. Will close window in 5 seconds";sleep 5)' 2>&1` - if $?.exitstatus != 0 - Yast::Popup.Error(_("Failed to run terminal. Error: %{error}") % { :error => res }) + res = `xterm -e 'docker exec -ti #{@container.id} #{Shellwords.escape selected_shell} \ + || (echo "Failed to attach. Will close window in 5 seconds";sleep 5)' 2>&1` + if $CHILD_STATUS.exitstatus != 0 + Yast::Popup.Error(_("Failed to run terminal. Error: %{error}") % { error: res }) return end end end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/src/lib/ydocker/main_dialog.rb new/yast2-docker-4.0.0/src/lib/ydocker/main_dialog.rb --- old/yast2-docker-3.2.0/src/lib/ydocker/main_dialog.rb 2017-03-13 11:59:44.040294007 +0100 +++ new/yast2-docker-4.0.0/src/lib/ydocker/main_dialog.rb 2017-12-20 12:26:19.000000000 +0100 @@ -18,6 +18,7 @@ require "yast" require "docker" +require "y2storage" require "ydocker/changes_dialog" require "ydocker/commit_dialog" @@ -33,10 +34,9 @@ def self.run Yast.import "UI" Yast.import "Popup" - Yast.import "Storage" Yast.import "Service" - dialog = self.new + dialog = new dialog.run end @@ -45,7 +45,6 @@ end def run - return unless create_dialog begin @@ -56,6 +55,7 @@ end private + DEFAULT_SIZE_OPT = Yast::Term.new(:opt, :defaultsize) def create_dialog @@ -71,11 +71,14 @@ # Only root can start process if Process::UID.rid == 0 - return false unless Yast::Popup.YesNo(_("Docker service does not run. Should YaST start docker? Otherwise YaST quits.")) + return false unless Yast::Popup.YesNo( + _("Docker service does not run. Should YaST start docker? Otherwise YaST quits.") + ) return Yast::Service.start("docker") else - Yast::Popup.Error(_("Docker service does not run. Run this module as root or start docker service manually.")) + Yast::Popup.Error(_("Docker service does not run. \ +Run this module as root or start docker service manually.")) return false end end @@ -85,7 +88,7 @@ end def controller_loop - while true do + loop do input = Yast::UI.UserInput handle_docker_exceptions do case input @@ -134,11 +137,13 @@ @current_tab = :containers end - def handle_docker_exceptions(&block) + def handle_docker_exceptions yield rescue Docker::Error::DockerError => e log.error "Docker exception #{e.inspect}" - Yast::Popup.Error(_("Communication with docker failed with error: %s. Please try again.") % e.to_s) + Yast::Popup.Error( + _("Communication with docker failed with error: %s. Please try again.") % e.to_s + ) @current_tab == :images ? redraw_images : redraw_containers end @@ -149,18 +154,18 @@ end def stop_container - return unless (Yast::Popup.YesNo(_("Do you really want to stop the running container?"))) + return unless Yast::Popup.YesNo(_("Do you really want to stop the running container?")) selected_container.stop! - return unless (Yast::Popup.YesNo(_("Do you want to remove the container?"))) + return unless Yast::Popup.YesNo(_("Do you want to remove the container?")) selected_container.delete redraw_containers end def kill_container - return unless (Yast::Popup.YesNo(_("Do you really want to kill the running container?"))) + return unless Yast::Popup.YesNo(_("Do you really want to kill the running container?")) selected_container.kill! - return unless (Yast::Popup.YesNo(_("Do you want to remove the container?"))) + return unless Yast::Popup.YesNo(_("Do you want to remove the container?")) selected_container.delete redraw_containers @@ -220,7 +225,7 @@ _("Created"), _("Virtual Size") ), - images_items + images_items ) end @@ -244,12 +249,14 @@ containers.map do |container| Item( Id(container.id), - container.id.slice(0,12), + container.id.slice(0, 12), container.info["Image"], container.info["Command"], DateTime.strptime(container.info["Created"].to_s, "%s").to_s, container.info["Status"], - container.info["Ports"].map {|p| "#{p["IP"]}:#{p["PublicPort"]}->#{p["PrivatePort"]}/#{p["Type"]}" }.join(",") + container.info["Ports"].map do |p| + "#{p["IP"]}:#{p["PublicPort"]}->#{p["PrivatePort"]}/#{p["Type"]}" + end.join(",") ) end end @@ -258,15 +265,17 @@ images = Docker::Image.all ret = [] images.map do |image| - image.info['RepoTags'].each do |repotag| + repotags = image.info["RepoTags"] + repotags = [":<none>"] if repotags.nil? + repotags.each do |repotag| repository, tag = repotag.split(":", 2) ret << Item( - Id({:id => image.id, :label => repotag}), + Id(id: image.id, label: repotag), repository, tag, image.id.slice(0, 12), DateTime.strptime(image.info["Created"].to_s, "%s").to_s, - Yast::Storage.ByteToHumanString(image.info["VirtualSize"]) + Y2Storage::DiskSize.new(image.info["VirtualSize"]).to_human_string ) end end @@ -312,9 +321,9 @@ def image_delete image, label = selected_image - return unless (Yast::Popup.YesNo(_("Do you really want to delete image \"%s\"?") % label)) + return unless Yast::Popup.YesNo(_("Do you really want to delete image \"%s\"?") % label) - if label == '<none>:<none>' + if label == "<none>:<none>" image.remove else image.connection.delete("/images/#{label}", {}) @@ -332,10 +341,10 @@ def update_containers_buttons is_something_selected = !Yast::UI.QueryWidget(:containers_table, :SelectedItems).empty? - [:container_inject, :container_changes, :container_stop, :container_kill, :container_commit].each do |item| + [:container_inject, :container_changes, :container_stop, :container_kill, + :container_commit].each do |item| Yast::UI.ChangeWidget(item, :Enabled, is_something_selected) end end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/src/lib/ydocker/run_image_dialog.rb new/yast2-docker-4.0.0/src/lib/ydocker/run_image_dialog.rb --- old/yast2-docker-3.2.0/src/lib/ydocker/run_image_dialog.rb 2017-03-13 11:59:44.060294007 +0100 +++ new/yast2-docker-4.0.0/src/lib/ydocker/run_image_dialog.rb 2017-12-20 12:26:19.000000000 +0100 @@ -16,7 +16,6 @@ # To contact Novell about this file by physical or electronic mail, # you may find current contact information at www.suse.com - require "docker" require "shellwords" require "yast" @@ -54,7 +53,7 @@ end def controller_loop - while true do + loop do input = Yast::UI.UserInput case input when :ok @@ -70,7 +69,7 @@ add_port when :run_cmd update_ok_button - when :remove_port + when :remove_port remove_port else raise "Unknown action #{input}" @@ -116,7 +115,6 @@ ) end - def contents VBox( frame_table_with_buttons(_("Volumes"), :volumes_table, "volume"), @@ -170,7 +168,7 @@ Yast::UI.OpenDialog( VBox( - InputField(Id(:target), _("Choose target directory"),""), + InputField(Id(:target), _("Choose target directory"), ""), ending_buttons ) ) @@ -178,7 +176,7 @@ if Yast::UI.UserInput == :cancel Yast::UI.CloseDialog else - @volumes << { :source => dir, :target => Yast::UI.QueryWidget(:target, :Value) } + @volumes << { source: dir, target: Yast::UI.QueryWidget(:target, :Value) } Yast::UI.CloseDialog @@ -207,8 +205,8 @@ Yast::UI.CloseDialog else @ports << { - :external => Yast::UI.QueryWidget(:external, :Value), - :internal => Yast::UI.QueryWidget(:internal, :Value) + external: Yast::UI.QueryWidget(:external, :Value), + internal: Yast::UI.QueryWidget(:internal, :Value) } Yast::UI.CloseDialog @@ -228,31 +226,28 @@ def port_bindings bindings = {} @ports.each do |mapping| - bindings["#{mapping[:internal]}/tcp"] = [{"HostPort" => mapping[:external]}] + bindings["#{mapping[:internal]}/tcp"] = [{ "HostPort" => mapping[:external] }] end bindings end def run_container - command = Shellwords.shellsplit(Yast::UI.QueryWidget(:run_cmd, :Value)) - container = Docker::Container.create(opts={'Image' => @image.id, "Cmd" => command}) - options = {} + command = Shellwords.shellsplit(Yast::UI.QueryWidget(:run_cmd, :Value)) + container = Docker::Container.create("Image" => @image.id, "Cmd" => command) + options = {} - if !@volumes.empty? - options['Binds'] = @volumes.map{|mapping| "#{mapping[:source]}:#{mapping[:target]}"} - end + if !@volumes.empty? + options["Binds"] = @volumes.map { |mapping| "#{mapping[:source]}:#{mapping[:target]}" } + end - if !@ports.empty? - options['PortBindings'] = port_bindings - end + options["PortBindings"] = port_bindings if !@ports.empty? - container.start!(options) + container.start!(options) end def update_ok_button command = Shellwords.shellsplit(Yast::UI.QueryWidget(:run_cmd, :Value)) Yast::UI.ChangeWidget(:ok, :Enabled, !command.empty?) end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-docker-3.2.0/test/spec_helper.rb new/yast2-docker-4.0.0/test/spec_helper.rb --- old/yast2-docker-3.2.0/test/spec_helper.rb 2017-03-13 11:59:44.060294007 +0100 +++ new/yast2-docker-4.0.0/test/spec_helper.rb 2017-12-20 12:26:19.000000000 +0100 @@ -1 +1,42 @@ -$:.unshift(File.expand_path("../../src/lib", __FILE__)) +# encoding: utf-8 + +# ------------------------------------------------------------------------------ +# Copyright (c) 2017 SUSE LLC +# +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of version 2 of the GNU General Public License as published by the +# Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, contact SUSE. +# +# To contact SUSE about this file by physical or electronic mail, you may find +# current contact information at www.suse.com. +# ------------------------------------------------------------------------------ + +$LOAD_PATH.unshift(File.expand_path("../../src/lib", __FILE__)) + +if ENV["COVERAGE"] + require "simplecov" + SimpleCov.start do + add_filter "/test/" + end + + # track all ruby files under src + src_location = File.expand_path("../../src", __FILE__) + SimpleCov.track_files("#{src_location}/**/*.rb") + + # use coveralls for on-line code coverage reporting at Travis CI + if ENV["TRAVIS"] + require "coveralls" + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ] + end +end