Hello community,
here is the log from the commit of package rubygem-hashicorp-checkpoint for
openSUSE:Factory checked in at 2018-02-10 18:00:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-hashicorp-checkpoint (Old)
and /work/SRC/openSUSE:Factory/.rubygem-hashicorp-checkpoint.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-hashicorp-checkpoint"
Sat Feb 10 18:00:01 2018 rev:2 rq:574932 version:0.1.5
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-hashicorp-checkpoint/rubygem-hashicorp-checkpoint.changes
2014-11-13 09:17:21.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-hashicorp-checkpoint.new/rubygem-hashicorp-checkpoint.changes
2018-02-10 18:00:02.764051276 +0100
@@ -1,0 +2,6 @@
+Thu Feb 8 06:06:53 UTC 2018 - [email protected]
+
+- updated to version 0.1.5
+ no changelog found
+
+-------------------------------------------------------------------
Old:
----
hashicorp-checkpoint-0.1.4.gem
New:
----
hashicorp-checkpoint-0.1.5.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-hashicorp-checkpoint.spec ++++++
--- /var/tmp/diff_new_pack.DT5dxm/_old 2018-02-10 18:00:04.295995819 +0100
+++ /var/tmp/diff_new_pack.DT5dxm/_new 2018-02-10 18:00:04.295995819 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-hashicorp-checkpoint
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -14,6 +14,8 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
+
#
# This file was generated with a gem2rpm.yml and not just plain gem2rpm.
# All sections marked as MANUAL, license headers, summaries and descriptions
@@ -22,16 +24,16 @@
#
Name: rubygem-hashicorp-checkpoint
-Version: 0.1.4
+Version: 0.1.5
Release: 0
%define mod_name hashicorp-checkpoint
%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: http://www.hashicorp.com
-Source: http://rubygems.org/gems/%{mod_full_name}.gem
+Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Internal HashiCorp service to check version information
License: MPL-2.0
++++++ hashicorp-checkpoint-0.1.4.gem -> hashicorp-checkpoint-0.1.5.gem ++++++
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/checkpoint/version.rb
new/lib/checkpoint/version.rb
--- old/lib/checkpoint/version.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/checkpoint/version.rb 2018-01-19 23:22:26.000000000 +0100
@@ -1,3 +1,3 @@
module Checkpoint
- VERSION = "0.1.4"
+ VERSION = "0.1.5"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/checkpoint.rb new/lib/checkpoint.rb
--- old/lib/checkpoint.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/checkpoint.rb 2018-01-19 23:22:26.000000000 +0100
@@ -9,7 +9,7 @@
require "checkpoint/version"
module Checkpoint
- @@disabled = false
+ @@disabled = !!ENV["CHECKPOINT_DISABLE"]
# Checks for the latest version information as well as alerts.
#
@@ -35,7 +35,7 @@
mtime = File.mtime(opts[:cache_file]).to_i
limit = Time.now.to_i - (60 * 60 * 24 * 2)
if mtime > limit
- return build_check(File.read(opts[:cache_file]))
+ return build_check(File.read(opts[:cache_file]), "cached" => true)
end
# Delete the file
@@ -101,7 +101,7 @@
end
build_check(resp.body)
- rescue Exception
+ rescue StandardError
# If we want errors, raise it
raise if opts[:raise_error]
@@ -116,9 +116,10 @@
protected
- def self.build_check(response)
+ def self.build_check(response, extra_info={})
JSON.parse(response).tap do |result|
result["outdated"] = !!result["outdated"]
+ result.merge!(extra_info)
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 1970-01-01 01:00:00.000000000 +0100
+++ new/metadata 2018-01-19 23:22:26.000000000 +0100
@@ -1,69 +1,69 @@
--- !ruby/object:Gem::Specification
name: hashicorp-checkpoint
version: !ruby/object:Gem::Version
- version: 0.1.4
+ version: 0.1.5
platform: ruby
authors:
- Mitchell Hashimoto
autorequire:
bindir: bin
cert_chain: []
-date: 2014-09-02 00:00:00.000000000 Z
+date: 2018-01-19 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: bundler
requirement: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: '1.6'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: '1.6'
- !ruby/object:Gem::Dependency
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - - '>='
+ - - ">="
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - '>='
+ - - ">="
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: rspec
requirement: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: 3.0.0
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: 3.0.0
- !ruby/object:Gem::Dependency
name: rspec-its
requirement: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: 1.0.0
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: 1.0.0
description: Internal HashiCorp service to check version information
@@ -73,7 +73,7 @@
extensions: []
extra_rdoc_files: []
files:
-- .gitignore
+- ".gitignore"
- Gemfile
- LICENSE.txt
- README.md
@@ -94,17 +94,17 @@
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - - '>='
+ - - ">="
- !ruby/object:Gem::Version
version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - - '>='
+ - - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.0.14
+rubygems_version: 2.6.14
signing_key:
specification_version: 4
summary: Internal HashiCorp service to check version information.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/checkpoint_spec.rb new/spec/checkpoint_spec.rb
--- old/spec/checkpoint_spec.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/spec/checkpoint_spec.rb 2018-01-19 23:22:26.000000000 +0100
@@ -4,6 +4,10 @@
describe Checkpoint do
describe ".check" do
+ before do
+ allow(ENV).to receive(:[]).and_return(nil)
+ end
+
context "with a proper request" do
subject do
described_class.check(
@@ -19,23 +23,84 @@
its(["product"]) { should eq("test") }
end
- it "should cache things with cache_file" do
- tf = Tempfile.new("checkpoint")
- path = tf.path
- tf.close
- File.unlink(path)
-
- opts = {
- product: "test",
- version: "1.0",
- cache_file: path,
+ context "cache file" do
+ let(:path){ @path }
+
+ before do
+ tf = Tempfile.new("checkpoint")
+ tfpath = tf.path
+ tf.close
+ File.unlink(tfpath)
+ @path = tfpath
+ end
+
+ after{ File.unlink(path) if File.exist?(path) }
+
+ it "should cache things with cache_file" do
+ opts = {
+ product: "test",
+ version: "1.0",
+ cache_file: path,
+ }
+
+ # Just run it twice
+ c = described_class.check(opts)
+ c = described_class.check(opts)
+
+ expect(c["product"]).to eq("test")
+ end
+
+ it "should indicate cached result" do
+ opts = {
+ product: "test",
+ version: "1.0",
+ cache_file: path,
+ }
+
+ # Just run it twice
+ c = described_class.check(opts)
+ c = described_class.check(opts)
+
+ expect(c["cached"]).to eq(true)
+ end
+ end
+
+ context "with errors" do
+ let(:error_class){ StandardError }
+ let(:opts) {
+ {
+ product: "test",
+ version: "1.0"
+ }
}
+ before{ allow(Net::HTTP).to receive(:new).and_raise(error_class) }
- # Just run it twice
- c = described_class.check(opts)
- c = described_class.check(opts)
+ it "should not raise error by default" do
+ expect(described_class.check(opts)).to be_nil
+ end
+
+ it "should raise error when option set" do
+ expect{ described_class.check(opts.merge(raise_error: true)) }.to
raise_error(error_class)
+ end
+
+ context "with non-StandardError descendant exception" do
+ let(:error_class){ Interrupt }
+
+ it "should raise error by default" do
+ expect{ described_class.check(opts) }.to raise_error(error_class)
+ end
+
+ it "should raise error when option set" do
+ expect{ described_class.check(opts.merge(raise_error: true)) }.to
raise_error(error_class)
+ end
+ end
+ end
- expect(c["product"]).to eq("test")
+ it "does not check when CHECKPOINT_DISABLE=1" do
+ allow(ENV).to receive(:[])
+ .with("CHECKPOINT_DISABLE")
+ .and_return(1)
+ expect(described_class.check).to be(nil)
end
end
end