Hello community, here is the log from the commit of package rubygem-get_process_mem for openSUSE:Factory checked in at 2018-11-26 10:32:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-get_process_mem (Old) and /work/SRC/openSUSE:Factory/.rubygem-get_process_mem.new.19453 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-get_process_mem" Mon Nov 26 10:32:36 2018 rev:4 rq:651606 version:0.2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-get_process_mem/rubygem-get_process_mem.changes 2018-07-18 22:49:49.095780902 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-get_process_mem.new.19453/rubygem-get_process_mem.changes 2018-11-26 10:34:05.820761509 +0100 @@ -1,0 +2,10 @@ +Thu Nov 22 05:10:02 UTC 2018 - Stephan Kulow <co...@suse.com> + +- updated to version 0.2.3 + see installed CHANGELOG.md + + ## 0.2.3 + + - Silence BigDecimal deprecation warning under Ruby 2.5 (#26) + +------------------------------------------------------------------- Old: ---- get_process_mem-0.2.2.gem New: ---- get_process_mem-0.2.3.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-get_process_mem.spec ++++++ --- /var/tmp/diff_new_pack.J6TNnJ/_old 2018-11-26 10:34:08.352758544 +0100 +++ /var/tmp/diff_new_pack.J6TNnJ/_new 2018-11-26 10:34:08.352758544 +0100 @@ -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,7 +24,7 @@ # Name: rubygem-get_process_mem -Version: 0.2.2 +Version: 0.2.3 Release: 0 %define mod_name get_process_mem %define mod_full_name %{mod_name}-%{version} ++++++ get_process_mem-0.2.2.gem -> get_process_mem-0.2.3.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.travis.yml new/.travis.yml --- old/.travis.yml 2018-05-11 14:38:19.000000000 +0200 +++ new/.travis.yml 2018-10-18 23:13:40.000000000 +0200 @@ -4,9 +4,8 @@ - gem install bundler -v 1.12.5 rvm: - - 1.9.3 - - 2.0.0 - - 2.1.0 + - 2.2.0 + - 2.5.0 - ruby-head - jruby-19mode - rbx-19mode diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2018-05-11 14:38:19.000000000 +0200 +++ new/CHANGELOG.md 2018-10-18 23:13:40.000000000 +0200 @@ -1,3 +1,7 @@ +## 0.2.3 + +- Silence BigDecimal deprecation warning under Ruby 2.5 (#26) + ## 0.2.2 - Fix support for Ruby 2.4 (#23) Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/get_process_mem/version.rb new/lib/get_process_mem/version.rb --- old/lib/get_process_mem/version.rb 2018-05-11 14:38:19.000000000 +0200 +++ new/lib/get_process_mem/version.rb 2018-10-18 23:13:40.000000000 +0200 @@ -1,3 +1,3 @@ class GetProcessMem - VERSION = "0.2.2" + VERSION = "0.2.3" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/get_process_mem.rb new/lib/get_process_mem.rb --- old/lib/get_process_mem.rb 2018-05-11 14:38:19.000000000 +0200 +++ new/lib/get_process_mem.rb 2018-10-18 23:13:40.000000000 +0200 @@ -3,11 +3,25 @@ # Cribbed from Unicorn Worker Killer, thanks! class GetProcessMem - KB_TO_BYTE = 1024 # 2**10 = 1024 - MB_TO_BYTE = 1_048_576 # 1024**2 = 1_048_576 - GB_TO_BYTE = 1_073_741_824 # 1024**3 = 1_073_741_824 + if Kernel.respond_to?(:BigDecimal) + private_class_method def self.number_to_bigdecimal(value) + BigDecimal(value) + end + else + private_class_method def self.number_to_bigdecimal(value) + BigDecimal.new(value) + end + end + + private def number_to_bigdecimal(value) + self.class.send(:number_to_bigdecimal, value) + end + + KB_TO_BYTE = number_to_bigdecimal 1024 # 2**10 = 1024 + MB_TO_BYTE = number_to_bigdecimal 1_048_576 # 1024**2 = 1_048_576 + GB_TO_BYTE = number_to_bigdecimal 1_073_741_824 # 1024**3 = 1_073_741_824 CONVERSION = { "kb" => KB_TO_BYTE, "mb" => MB_TO_BYTE, "gb" => GB_TO_BYTE } - ROUND_UP = BigDecimal.new("0.5") + ROUND_UP = number_to_bigdecimal "0.5" attr_reader :pid RUNS_ON_WINDOWS = Gem.win_platform? @@ -40,15 +54,15 @@ end def kb(b = bytes) - (b/BigDecimal.new(KB_TO_BYTE)).to_f + (b/KB_TO_BYTE).to_f end def mb(b = bytes) - (b/BigDecimal.new(MB_TO_BYTE)).to_f + (b/MB_TO_BYTE).to_f end def gb(b = bytes) - (b/BigDecimal.new(GB_TO_BYTE)).to_f + (b/GB_TO_BYTE).to_f end def inspect @@ -73,7 +87,7 @@ return if lines.empty? lines.reduce(0) do |sum, line| line.match(/(?<value>(\d*\.{0,1}\d+))\s+(?<unit>\w\w)/) do |m| - value = BigDecimal.new(m[:value]) + ROUND_UP + value = number_to_bigdecimal(m[:value]) + ROUND_UP unit = m[:unit].downcase sum += CONVERSION[unit] * value end @@ -88,10 +102,10 @@ def ps_memory if RUNS_ON_WINDOWS size = ProcTable.ps(pid).working_set_size - BigDecimal.new(size) + number_to_bigdecimal(size) else mem = `ps -o rss= -p #{pid}` - KB_TO_BYTE * BigDecimal.new(mem == "" ? 0 : mem) + KB_TO_BYTE * number_to_bigdecimal(mem == "" ? 0 : mem) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2018-05-11 14:38:19.000000000 +0200 +++ new/metadata 2018-10-18 23:13:40.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: get_process_mem version: !ruby/object:Gem::Version - version: 0.2.2 + version: 0.2.3 platform: ruby authors: - Richard Schneeman autorequire: bindir: bin cert_chain: [] -date: 2018-05-11 00:00:00.000000000 Z +date: 2018-10-18 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: sys-proctable