Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-formatador for openSUSE:Factory checked in at 2022-10-12 18:25:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-formatador (Old) and /work/SRC/openSUSE:Factory/.rubygem-formatador.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-formatador" Wed Oct 12 18:25:08 2022 rev:9 rq:1010056 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-formatador/rubygem-formatador.changes 2022-03-18 08:55:17.828776244 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-formatador.new.2275/rubygem-formatador.changes 2022-10-12 18:26:55.233984268 +0200 @@ -1,0 +2,12 @@ +Thu Apr 28 05:30:15 UTC 2022 - Stephan Kulow <co...@suse.com> + +updated to version 1.1.0 + see installed changelog.txt + + v1.0.0 01/20/21 + =============== + + release v1, it's been stable for ages + + +------------------------------------------------------------------- Old: ---- formatador-0.3.0.gem New: ---- formatador-1.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-formatador.spec ++++++ --- /var/tmp/diff_new_pack.IffZc3/_old 2022-10-12 18:26:55.597985070 +0200 +++ /var/tmp/diff_new_pack.IffZc3/_new 2022-10-12 18:26:55.601985079 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-formatador # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-formatador -Version: 0.3.0 +Version: 1.1.0 Release: 0 %define mod_name formatador %define mod_full_name %{mod_name}-%{version} ++++++ formatador-0.3.0.gem -> formatador-1.1.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile new/Gemfile --- old/Gemfile 2021-06-17 16:03:25.000000000 +0200 +++ new/Gemfile 2022-01-25 02:56:44.000000000 +0100 @@ -1,3 +1,3 @@ -source "http://rubygems.org" +source "https://rubygems.org" gemspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/LICENSE.md new/LICENSE.md --- old/LICENSE.md 2021-06-17 16:03:25.000000000 +0200 +++ new/LICENSE.md 2022-01-25 02:56:44.000000000 +0100 @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2009-2013 [CONTRIBUTORS.md](https://github.com/geemus/formatador/blob/master/CONTRIBUTORS.md) +Copyright (c) 2009-2022 [CONTRIBUTORS.md](https://github.com/geemus/formatador/blob/master/CONTRIBUTORS.md) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2021-06-17 16:03:25.000000000 +0200 +++ new/README.md 2022-01-25 02:56:44.000000000 +0100 @@ -2,7 +2,7 @@ STDOUT text formatting -[![Build Status](https://travis-ci.org/geemus/formatador.svg)](http://travis-ci.org/geemus/formatador) +[![Build Status](https://github.com/geemus/formatador/actions/workflows/ruby.yml/badge.svg)](https://github.com/geemus/formatador/actions/workflows/ruby.yml) ## Quick and dirty @@ -123,7 +123,7 @@ (The MIT License) -Copyright (c) 2015 [geemus (Wesley Beary)](http://github.com/geemus) +Copyright (c) 2022 [geemus (Wesley Beary)](http://github.com/geemus) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2021-06-17 16:03:25.000000000 +0200 +++ new/Rakefile 2022-01-25 02:56:44.000000000 +0100 @@ -84,7 +84,7 @@ puts "You must be on the master branch to release!" exit! end - sh "sudo gem install pkg/#{name}-#{version}.gem" + sh "gem install pkg/#{name}-#{version}.gem" sh "git commit --allow-empty -a -m 'Release #{version}'" sh "git tag v#{version}" sh "git push origin master" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/changelog.txt new/changelog.txt --- old/changelog.txt 2021-06-17 16:03:25.000000000 +0200 +++ new/changelog.txt 2022-01-25 02:56:44.000000000 +0100 @@ -1,3 +1,8 @@ +v1.0.0 01/20/21 +=============== + +release v1, it's been stable for ages + v0.3.0 06/17/21 =============== Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/formatador.gemspec new/formatador.gemspec --- old/formatador.gemspec 2021-06-17 16:03:25.000000000 +0200 +++ new/formatador.gemspec 2022-01-25 02:56:44.000000000 +0100 @@ -13,8 +13,8 @@ ## If your rubyforge_project name is different, then edit it and comment out ## the sub! line in the Rakefile s.name = 'formatador' - s.version = '0.3.0' - s.date = '2021-06-17' + s.version = '1.1.0' + s.date = '2022-01-24' ## Make sure your summary is short. The description may be as long ## as you like. @@ -77,8 +77,4 @@ tests/tests_helper.rb ] # = MANIFEST = - - ## Test files will be grabbed from the file list. Make sure the path glob - ## matches what you actually use. - s.test_files = s.files.select { |path| path =~ /^[spec|tests]\/.*_[spec|tests]\.rb/ } end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/formatador/table.rb new/lib/formatador/table.rb --- old/lib/formatador/table.rb 2021-06-17 16:03:25.000000000 +0200 +++ new/lib/formatador/table.rb 2022-01-25 02:56:44.000000000 +0100 @@ -1,13 +1,13 @@ class Formatador - def display_table(hashes, keys = nil, &block) + def display_table(hashes, keys = nil, **options, &block) new_hashes = hashes.inject([]) do |accum,item| accum << :split unless accum.empty? accum << item end - display_compact_table(new_hashes, keys, &block) + display_compact_table(new_hashes, keys, **options, &block) end - def display_compact_table(hashes, keys = nil, &block) + def display_compact_table(hashes, keys = nil, **options, &block) headers = keys || [] widths = {} @@ -59,12 +59,12 @@ hashes.each do |hash| if hash.respond_to? :keys - columns = [] - headers.each do |header| + columns = headers.map do |header| datum = calculate_datum(header, hash) width = widths[header] - length(datum) width = width < 0 ? 0 : width - columns << "#{datum}#{' ' * width}" + + datum.is_a?(Numeric) && options[:numeric_rjust] ? "#{' ' * width}#{datum}" : "#{datum}#{' ' * width}" end display_line("| #{columns.join(' | ')} |") else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/formatador.rb new/lib/formatador.rb --- old/lib/formatador.rb 2021-06-17 16:03:25.000000000 +0200 +++ new/lib/formatador.rb 2022-01-25 02:56:44.000000000 +0100 @@ -3,7 +3,7 @@ class Formatador - VERSION = '0.3.0' + VERSION = '1.1.0' STYLES = { :"\/" => "0", @@ -119,7 +119,7 @@ string.gsub(PARSE_REGEX, '').gsub(INDENT_REGEX) { indentation } end - %w{display display_line display_lines display_table display_compact_table indent parse redisplay redisplay_line new_line redisplay_progressbar}.each do |method| + %w{display display_line display_lines indent parse redisplay redisplay_line new_line redisplay_progressbar}.each do |method| eval <<-DEF def self.#{method}(*args, &block) Thread.current[:formatador] ||= new @@ -127,5 +127,14 @@ end DEF end + + %w{display_table display_compact_table}.each do |method| + eval <<-DEF + def self.#{method}(*args, **kwargs, &block) + Thread.current[:formatador] ||= new + Thread.current[:formatador].#{method}(*args, **kwargs, &block) + end + DEF + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2021-06-17 16:03:25.000000000 +0200 +++ new/metadata 2022-01-25 02:56:44.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: formatador version: !ruby/object:Gem::Version - version: 0.3.0 + version: 1.1.0 platform: ruby authors: - geemus (Wesley Beary) autorequire: bindir: bin cert_chain: [] -date: 2021-06-17 00:00:00.000000000 Z +date: 2022-01-24 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -93,7 +93,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.2.15 +rubygems_version: 3.3.5 signing_key: specification_version: 2 summary: Ruby STDOUT text formatting diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/table_tests.rb new/tests/table_tests.rb --- old/tests/table_tests.rb 2021-06-17 16:03:25.000000000 +0200 +++ new/tests/table_tests.rb 2022-01-25 02:56:44.000000000 +0100 @@ -94,6 +94,36 @@ end end +output = <<-OUTPUT + +-------------------------+----------------+ + | [bold]right-justify a numeric[/] | [bold]standard value[/] | + +-------------------------+----------------+ + | 12345 | value | + +-------------------------+----------------+ +OUTPUT +output = Formatador.parse(output) + + tests("#display_table([{'right-justify a numeric' => 12345, 'standard value' => 'standard value'}], numeric_rjust: true)").returns(output) do + capture_stdout do + Formatador.display_table([{'right-justify a numeric' => 12345, 'standard value' => 'value'}], numeric_rjust: true) + end + end + +output = <<-OUTPUT + +--------+------------+ + | [bold]header[/] | [bold]nested.key[/] | + +--------+------------+ + | 12345 | value | + +--------+------------+ +OUTPUT +output = Formatador.parse(output) + + tests("#display_table([{:header => 12345, :nested => {:key => value}}], [:header, :'nested.key'], numeric_rjust: true)").returns(output) do + capture_stdout do + Formatador.display_table([{:header => 12345, :nested => {:key => 'value'}}], [:header, :'nested.key'], numeric_rjust: true) + end + end + output = <<-OUTPUT +------+ @@ -106,7 +136,7 @@ OUTPUT output = Formatador.parse(output) - tests("#display_table([{:a => 1}, {:a => 2}])").returns(output) do + tests("#display_table([{:a => 1}, {:a => '??????'}])").returns(output) do capture_stdout do Formatador.display_table([{:a => 1}, {:a => "??????"}]) end