diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2014-06-05 09:12:43 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2014-06-05 09:12:43 +0000 |
commit | 46fa919b96f48f69684b4de2bca04cee519ebb31 (patch) | |
tree | 6fd3ad486fb602da096543bbbe07e598396a6019 /sysutils | |
parent | 05b5968a8f99dd67b1c9d35417e29d544167f5f5 (diff) | |
download | ports-46fa919b96f48f69684b4de2bca04cee519ebb31.tar.gz ports-46fa919b96f48f69684b4de2bca04cee519ebb31.zip |
Notes
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/rubygem-hammer_cli/Makefile | 2 | ||||
-rw-r--r-- | sysutils/rubygem-hammer_cli/distinfo | 4 | ||||
-rw-r--r-- | sysutils/rubygem-hammer_cli/files/patch-fca42d1a8e9f7a4dfabca0900818e5d355b3b554 | 69 |
3 files changed, 3 insertions, 72 deletions
diff --git a/sysutils/rubygem-hammer_cli/Makefile b/sysutils/rubygem-hammer_cli/Makefile index f9b4514623e9..eb8ad278e918 100644 --- a/sysutils/rubygem-hammer_cli/Makefile +++ b/sysutils/rubygem-hammer_cli/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= hammer_cli -PORTVERSION= 0.1.0 +PORTVERSION= 0.1.1 CATEGORIES= sysutils ruby MASTER_SITES= RG diff --git a/sysutils/rubygem-hammer_cli/distinfo b/sysutils/rubygem-hammer_cli/distinfo index f2136fef229a..2b547486b5d6 100644 --- a/sysutils/rubygem-hammer_cli/distinfo +++ b/sysutils/rubygem-hammer_cli/distinfo @@ -1,2 +1,2 @@ -SHA256 (rubygem/hammer_cli-0.1.0.gem) = 2b41ae48e3eb3f4adb8a11c2facce28cf6e61eca163f2bbef9dc90eb7c45fca7 -SIZE (rubygem/hammer_cli-0.1.0.gem) = 91136 +SHA256 (rubygem/hammer_cli-0.1.1.gem) = 8ed6878847894b69bd0c09317fc4e2e0557662bf2bf38d53f851d8ad85a6c7e2 +SIZE (rubygem/hammer_cli-0.1.1.gem) = 93696 diff --git a/sysutils/rubygem-hammer_cli/files/patch-fca42d1a8e9f7a4dfabca0900818e5d355b3b554 b/sysutils/rubygem-hammer_cli/files/patch-fca42d1a8e9f7a4dfabca0900818e5d355b3b554 deleted file mode 100644 index fc3edd3db04c..000000000000 --- a/sysutils/rubygem-hammer_cli/files/patch-fca42d1a8e9f7a4dfabca0900818e5d355b3b554 +++ /dev/null @@ -1,69 +0,0 @@ -commit fca42d1a8e9f7a4dfabca0900818e5d355b3b554 -Author: Ivan Nečas <inecas@redhat.com> -Date: Wed Apr 2 15:08:17 2014 +0200 - - Fixes #5025 - Add support for boolean fields - -diff --git lib/hammer_cli/output/fields.rb lib/hammer_cli/output/fields.rb -index 1abe7b2..26b5540 100644 ---- lib/hammer_cli/output/fields.rb -+++ lib/hammer_cli/output/fields.rb -@@ -86,4 +86,7 @@ module Fields - class Collection < ContainerField - end - -+ class Boolean < Field -+ end -+ - end -diff --git lib/hammer_cli/output/formatters.rb lib/hammer_cli/output/formatters.rb -index fa2d299..2d261de 100644 ---- lib/hammer_cli/output/formatters.rb -+++ lib/hammer_cli/output/formatters.rb -@@ -144,10 +144,22 @@ module HammerCLI::Output - end - end - -+ class BooleanFormatter < FieldFormatter -+ -+ def tags -+ [:flat, :screen] -+ end -+ -+ def format(value) -+ !value || value == "" ? _("no") : _("yes") -+ end -+ end -+ - HammerCLI::Output::Output.register_formatter(DateFormatter.new, :Date) - HammerCLI::Output::Output.register_formatter(ListFormatter.new, :List) - HammerCLI::Output::Output.register_formatter(KeyValueFormatter.new, :KeyValue) - HammerCLI::Output::Output.register_formatter(LongTextFormatter.new, :LongText) -+ HammerCLI::Output::Output.register_formatter(BooleanFormatter.new, :Boolean) - - end - end -diff --git test/unit/output/formatters_test.rb test/unit/output/formatters_test.rb -index 2a3a610..050a085 100644 ---- test/unit/output/formatters_test.rb -+++ test/unit/output/formatters_test.rb -@@ -138,3 +138,19 @@ describe HammerCLI::Output::Formatters::LongTextFormatter do - end - - end -+ -+describe HammerCLI::Output::Formatters::BooleanFormatter do -+ -+ it "says yes for true like objects" do -+ formatter = HammerCLI::Output::Formatters::BooleanFormatter.new -+ formatter.format(true).must_equal "yes" -+ formatter.format("yes").must_equal "yes" -+ end -+ -+ it "says no for false and nil and empty string" do -+ formatter = HammerCLI::Output::Formatters::BooleanFormatter.new -+ formatter.format(nil).must_equal "no" -+ formatter.format(false).must_equal "no" -+ formatter.format("").must_equal "no" -+ end -+end |