Hello community,

here is the log from the commit of package rubygem-vagrant_cloud for 
openSUSE:Factory checked in at 2019-01-21 10:54:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-vagrant_cloud (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-vagrant_cloud.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-vagrant_cloud"

Mon Jan 21 10:54:03 2019 rev:2 rq:666050 version:2.0.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-vagrant_cloud/rubygem-vagrant_cloud.changes  
    2018-11-26 10:28:08.197180685 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-vagrant_cloud.new.28833/rubygem-vagrant_cloud.changes
   2019-01-21 10:54:21.759728039 +0100
@@ -1,0 +2,6 @@
+Mon Jan 14 14:01:50 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to version 2.0.2
+  no changelog found
+
+-------------------------------------------------------------------

Old:
----
  vagrant_cloud-2.0.1.gem

New:
----
  vagrant_cloud-2.0.2.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-vagrant_cloud.spec ++++++
--- /var/tmp/diff_new_pack.f7fzYN/_old  2019-01-21 10:54:23.087726437 +0100
+++ /var/tmp/diff_new_pack.f7fzYN/_new  2019-01-21 10:54:23.087726437 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-vagrant_cloud
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -24,14 +24,14 @@
 #
 
 Name:           rubygem-vagrant_cloud
-Version:        2.0.1
+Version:        2.0.2
 Release:        0
 %define mod_name vagrant_cloud
 %define mod_full_name %{mod_name}-%{version}
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  ruby-macros >= 5
-BuildRequires:  %{ruby}
 BuildRequires:  %{rubygem gem2rpm}
+BuildRequires:  %{ruby}
+BuildRequires:  ruby-macros >= 5
 Url:            https://github.com/hashicorp/vagrant_cloud
 Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml

++++++ vagrant_cloud-2.0.1.gem -> vagrant_cloud-2.0.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bin/vagrant_cloud new/bin/vagrant_cloud
--- old/bin/vagrant_cloud       2018-10-17 05:13:32.000000000 +0200
+++ new/bin/vagrant_cloud       2019-01-09 17:47:28.000000000 +0100
@@ -1,5 +1,6 @@
 #!/usr/bin/env ruby
 
-require 'vagrant_cloud'
-
-VagrantCloud::Cli.start(ARGV)
+raise 'As of the 2.0.0 release, the vagrant_cloud gem provides library' \
+      ' functionality and no longer includes a command line client. For a' \
+      ' command line client, use the `vagrant cloud` subcommand from Vagrant.' 
\
+      ' Vagrant can be downloaded from: 
https://www.vagrantup.com/downloads.html'
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant_cloud/account.rb 
new/lib/vagrant_cloud/account.rb
--- old/lib/vagrant_cloud/account.rb    2018-10-17 05:13:32.000000000 +0200
+++ new/lib/vagrant_cloud/account.rb    2019-01-09 17:47:28.000000000 +0100
@@ -104,10 +104,15 @@
     def ensure_box(name, *args)
       params = box_params(*args)
 
+      # try to read the box data
       begin
         box = get_box(name)
         box.data
-      rescue RestClient::ResourceNotFound
+      rescue VagrantCloud::ClientError => err
+        # Check if it's a 404 error. If so, then create
+        # the missing box
+        raise if err.error_code != 404
+
         box = create_box(name, params)
         # If we've just created the box, we're done.
         return box
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant_cloud/box.rb new/lib/vagrant_cloud/box.rb
--- old/lib/vagrant_cloud/box.rb        2018-10-17 05:13:32.000000000 +0200
+++ new/lib/vagrant_cloud/box.rb        2019-01-09 17:47:28.000000000 +0100
@@ -33,10 +33,15 @@
     # @param [Hash] args
     # @param [String] org - organization of the box to read
     # @param [String] box_name - name of the box to read
-    # @return [Hash]
+    # @return [Hash] @data
     def update(args = {})
       # hash arguments kept for backwards compatibility
-      data = @client.request('put', box_path(args[:organization], 
args[:name]), box: args)
+      return @data if args.empty?
+
+      org = args[:organization] || account.username
+      box_name = args[:name] || @name
+
+      data = @client.request('put', box_path(org, box_name), box: args)
 
       # Update was called on *this* object, so update
       # objects data locally
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant_cloud/errors.rb 
new/lib/vagrant_cloud/errors.rb
--- old/lib/vagrant_cloud/errors.rb     2018-10-17 05:13:32.000000000 +0200
+++ new/lib/vagrant_cloud/errors.rb     2019-01-09 17:47:28.000000000 +0100
@@ -4,21 +4,31 @@
     attr_accessor :error_code
 
     def initialize(msg, http_body, http_code)
+      message = msg
+
       begin
         errors = JSON.parse(http_body)
-        vagrant_cloud_msg = errors['errors']
-
-        if vagrant_cloud_msg.is_a?(Array)
-          message = msg + ' - ' + vagrant_cloud_msg.join(', ').to_s
-        else
-          message = msg + ' - ' + vagrant_cloud_msg
+        if errors.is_a?(Hash)
+          vagrant_cloud_msg = errors['errors']
+          if vagrant_cloud_msg.is_a?(Array)
+            message = msg + ' - ' + vagrant_cloud_msg.map(&:to_s).join(', 
').to_s
+          elsif !vagrant_cloud_msg.to_s.empty?
+            message = msg + ' - ' + vagrant_cloud_msg.to_s
+          end
         end
-      rescue JSON::ParserError
-        message = msg
+      rescue JSON::ParserError => err
+        vagrant_cloud_msg = err.message
       end
 
       @error_arr = vagrant_cloud_msg
-      @error_code = http_code
+      @error_code = http_code.to_i
+      super(message)
+    end
+  end
+
+  class InvalidVersion < StandardError
+    def initialize(version_number)
+      message = 'Invalid version given: ' + version_number
       super(message)
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant_cloud/version.rb 
new/lib/vagrant_cloud/version.rb
--- old/lib/vagrant_cloud/version.rb    2018-10-17 05:13:32.000000000 +0200
+++ new/lib/vagrant_cloud/version.rb    2019-01-09 17:47:28.000000000 +0100
@@ -67,6 +67,13 @@
     # @param [String] version_number
     # @param [String] description
     def update(description = nil, username = nil, box_name = nil, 
version_number = nil)
+      # Ensure version given is a 'proper' version
+      begin
+        Gem::Version.new(version_number) if version_number
+      rescue ArgumentError
+        raise VagrantCloud::InvalidVersion, version_number
+      end
+
       update_data = !(username && box_name && version_number)
       description ||= @description
       version = { description: description }
@@ -116,6 +123,13 @@
       number ||= @number
       description ||= @description
 
+      # Ensure version given is a 'proper' version
+      begin
+        Gem::Version.new(number) if number
+      rescue ArgumentError
+        raise VagrantCloud::InvalidVersion, number
+      end
+
       params = { version: number, description: description }
       data = @client.request('post', create_version_path(org, box_name).to_s, 
version: params)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2018-10-17 05:13:32.000000000 +0200
+++ new/metadata        2019-01-09 17:47:28.000000000 +0100
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: vagrant_cloud
 version: !ruby/object:Gem::Version
-  version: 2.0.1
+  version: 2.0.2
 platform: ruby
 authors:
 - HashiCorp
@@ -9,7 +9,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2018-10-17 00:00:00.000000000 Z
+date: 2019-01-09 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rest-client


Reply via email to