Revision 9eeea397
Added by Tomáš Strachota about 10 years ago
dependencies/precise/hammer_cli/changelog | ||
---|---|---|
ruby-hammer-cli (0.1.0-1) stable; urgency=low
|
||
|
||
* 0.1.0 release
|
||
|
||
-- Tomas Strachota <tstrachota@redhat.com> Thu, 27 Mar 2014 05:21:24 -0500
|
||
|
||
ruby-hammer-cli (0.0.18-1) stable; urgency=low
|
||
|
||
* 0.0.18 release
|
dependencies/precise/hammer_cli/cli_config.yml | ||
---|---|---|
:modules:
|
||
# - hammer_cli_foreman
|
||
# - hammer_cli_katello_bridge
|
||
:ui:
|
||
:interactive: true
|
||
:per_page: 20
|
||
:history_file: '~/.hammer/history'
|
||
|
||
:foreman:
|
||
:host: 'https://localhost/'
|
||
:username: 'admin'
|
||
:password: 'changeme'
|
||
|
||
# :watch_plain: true disables color output of logger.watch in Clamp commands
|
||
# enable/disable color output of logger in Clamp commands
|
||
:watch_plain: false
|
||
|
||
#:log_dir: '/var/log/foreman'
|
||
:log_dir: '~/.foreman/log'
|
||
:log_dir: '~/.hammer/log'
|
||
:log_level: 'error'
|
||
:log_api_calls: false
|
||
#:log_owner: 'foreman'
|
||
#:log_group: 'foreman'
|
||
#:log_size: 5 #MB
|
dependencies/precise/hammer_cli/control | ||
---|---|---|
XB-Ruby-Versions: ${ruby:Versions}
|
||
Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
|
||
rubygems,
|
||
ruby-clamp,
|
||
ruby-clamp (>= 0.6.2),
|
||
ruby-rest-client,
|
||
ruby-logging,
|
||
ruby-table-print,
|
||
ruby-table-print (>= 1.5.1),
|
||
ruby-awesome-print,
|
||
ruby-highline,
|
||
ruby-fastercsv,
|
||
ruby-mime-types (< 2.0.0)
|
||
ruby-mime-types (< 2.0.0),
|
||
ruby-fast-gettext (>= 0.8.0),
|
||
liblocale-ruby1.8 (<= 2.0.9) | liblocale-ruby1.9.1 (<= 2.0.9),
|
||
ruby-json (>= 1.6.1),
|
||
ruby-apipie-bindings (>= 0.0.6)
|
||
Description: Universal command-line interface
|
||
Hammer cli provides universal extendable CLI interface for ruby apps
|
dependencies/precise/hammer_cli/dirs | ||
---|---|---|
/etc/hammer
|
||
/etc/hammer/cli.modules.d
|
dependencies/precise/hammer_cli/install | ||
---|---|---|
debian/cli_config.yml etc/foreman
|
||
debian/cli_config.yml etc/hammer
|
dependencies/precise/hammer_cli/patches/fixes-4916-skip-missing-translation-domains.patch | ||
---|---|---|
From 77c62f8e9410c7ab743f0b4cbc7ff9c2a147c98a Mon Sep 17 00:00:00 2001
|
||
From: Tomas Strachota <tstrachota@redhat.com>
|
||
Date: Mon, 31 Mar 2014 11:18:16 +0000
|
||
Subject: [PATCH] Fixes #4916 - skip missing translation domains
|
||
|
||
---
|
||
lib/hammer_cli/i18n.rb | 16 +++++++++++++-
|
||
test/unit/i18n_test.rb | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||
2 files changed, 64 insertions(+), 2 deletions(-)
|
||
create mode 100644 test/unit/i18n_test.rb
|
||
|
||
diff --git a/lib/hammer_cli/i18n.rb b/lib/hammer_cli/i18n.rb
|
||
index 6b883fc..0cb62b0 100644
|
||
--- a/lib/hammer_cli/i18n.rb
|
||
+++ b/lib/hammer_cli/i18n.rb
|
||
@@ -37,6 +37,10 @@ module HammerCLI
|
||
:mo
|
||
end
|
||
|
||
+ def available?
|
||
+ File.exist?(locale_dir)
|
||
+ end
|
||
+
|
||
attr_reader :locale_dir, :domain_name
|
||
end
|
||
|
||
@@ -76,12 +80,20 @@ module HammerCLI
|
||
@domains
|
||
end
|
||
|
||
+
|
||
def self.add_domain(domain)
|
||
- domains << domain
|
||
- FastGettext.add_text_domain(domain.domain_name, :path => domain.locale_dir, :type => domain.type, :report_warning => false)
|
||
+ if domain.available?
|
||
+ domains << domain
|
||
+ FastGettext.add_text_domain(domain.domain_name, :path => domain.locale_dir, :type => domain.type, :report_warning => false)
|
||
+ end
|
||
end
|
||
|
||
|
||
+ def self.clear
|
||
+ FastGettext.translation_repositories.clear
|
||
+ domains.clear
|
||
+ end
|
||
+
|
||
Encoding.default_external='UTF-8' if defined? Encoding
|
||
FastGettext.locale = locale
|
||
|
||
diff --git a/test/unit/i18n_test.rb b/test/unit/i18n_test.rb
|
||
new file mode 100644
|
||
index 0000000..c0a884c
|
||
--- /dev/null
|
||
+++ b/test/unit/i18n_test.rb
|
||
@@ -0,0 +1,50 @@
|
||
+require File.join(File.dirname(__FILE__), 'test_helper')
|
||
+
|
||
+
|
||
+describe HammerCLI::I18n do
|
||
+
|
||
+ class TestLocaleDomain < HammerCLI::I18n::AbstractLocaleDomain
|
||
+
|
||
+ def initialize(name, available)
|
||
+ @name = name
|
||
+ @available = available
|
||
+ end
|
||
+
|
||
+ def locale_dir
|
||
+ File.dirname(__FILE__)
|
||
+ end
|
||
+
|
||
+ def domain_name
|
||
+ @name
|
||
+ end
|
||
+
|
||
+ def available?
|
||
+ @available
|
||
+ end
|
||
+ end
|
||
+
|
||
+ before :each do
|
||
+ HammerCLI::I18n.clear
|
||
+ end
|
||
+
|
||
+ let(:domain1) { TestLocaleDomain.new('domain1', true) }
|
||
+ let(:domain2) { TestLocaleDomain.new('domain2', true) }
|
||
+ let(:unavailable_domain) { TestLocaleDomain.new('domain3', false) }
|
||
+
|
||
+ it "registers available domains at gettext" do
|
||
+ FastGettext.expects(:add_text_domain).with do |name, options|
|
||
+ (name == domain1.domain_name) && (options[:path] == domain1.locale_dir) && (options[:type] == domain1.type)
|
||
+ end
|
||
+ HammerCLI::I18n.add_domain(domain1)
|
||
+ end
|
||
+
|
||
+ it "skips registering domains that are not available" do
|
||
+ HammerCLI::I18n.add_domain(domain1)
|
||
+ HammerCLI::I18n.add_domain(domain2)
|
||
+ HammerCLI::I18n.add_domain(unavailable_domain)
|
||
+ HammerCLI::I18n.domains.must_equal [domain1, domain2]
|
||
+ end
|
||
+
|
||
+
|
||
+end
|
||
+
|
||
--
|
||
1.7.1
|
||
|
dependencies/precise/hammer_cli/patches/series | ||
---|---|---|
fixes-4916-skip-missing-translation-domains.patch
|
dependencies/squeeze/hammer_cli/changelog | ||
---|---|---|
ruby-hammer-cli (0.1.0-1) stable; urgency=low
|
||
|
||
* 0.1.0 release
|
||
|
||
-- Tomas Strachota <tstrachota@redhat.com> Thu, 27 Mar 2014 05:21:24 -0500
|
||
|
||
ruby-hammer-cli (0.0.18-1) stable; urgency=low
|
||
|
||
* 0.0.18 release
|
dependencies/squeeze/hammer_cli/cli_config.yml | ||
---|---|---|
:modules:
|
||
# - hammer_cli_foreman
|
||
# - hammer_cli_katello_bridge
|
||
:ui:
|
||
:interactive: true
|
||
:per_page: 20
|
||
:history_file: '~/.hammer/history'
|
||
|
||
:foreman:
|
||
:host: 'https://localhost/'
|
||
:username: 'admin'
|
||
:password: 'changeme'
|
||
|
||
# :watch_plain: true disables color output of logger.watch in Clamp commands
|
||
# enable/disable color output of logger in Clamp commands
|
||
:watch_plain: false
|
||
|
||
#:log_dir: '/var/log/foreman'
|
||
:log_dir: '~/.foreman/log'
|
||
:log_dir: '~/.hammer/log'
|
||
:log_level: 'error'
|
||
:log_api_calls: false
|
||
#:log_owner: 'foreman'
|
||
#:log_group: 'foreman'
|
||
#:log_size: 5 #MB
|
dependencies/squeeze/hammer_cli/control | ||
---|---|---|
XB-Ruby-Versions: ${ruby:Versions}
|
||
Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
|
||
rubygems,
|
||
ruby-clamp,
|
||
ruby-clamp (>= 0.6.2),
|
||
librestclient-ruby,
|
||
ruby-logging,
|
||
ruby-table-print,
|
||
ruby-table-print (>= 1.5.1),
|
||
ruby-awesome-print,
|
||
libhighline-ruby,
|
||
ruby-fastercsv,
|
||
libmime-types-ruby (< 2.0.0)
|
||
libmime-types-ruby (< 2.0.0),
|
||
ruby-fast-gettext (>= 0.8.0),
|
||
liblocale-ruby1.8 (<= 2.0.9) | liblocale-ruby1.9.1 (<= 2.0.9),
|
||
libjson-ruby (>= 1.6.1),
|
||
ruby-apipie-bindings (>= 0.0.6)
|
||
Description: Universal command-line interface
|
||
Hammer cli provides universal extendable CLI interface for ruby apps
|
dependencies/squeeze/hammer_cli/dirs | ||
---|---|---|
/etc/hammer
|
||
/etc/hammer/cli.modules.d
|
dependencies/squeeze/hammer_cli/install | ||
---|---|---|
debian/cli_config.yml etc/foreman
|
||
debian/cli_config.yml etc/hammer
|
dependencies/squeeze/hammer_cli/patches/fixes-4916-skip-missing-translation-domains.patch | ||
---|---|---|
From 77c62f8e9410c7ab743f0b4cbc7ff9c2a147c98a Mon Sep 17 00:00:00 2001
|
||
From: Tomas Strachota <tstrachota@redhat.com>
|
||
Date: Mon, 31 Mar 2014 11:18:16 +0000
|
||
Subject: [PATCH] Fixes #4916 - skip missing translation domains
|
||
|
||
---
|
||
lib/hammer_cli/i18n.rb | 16 +++++++++++++-
|
||
test/unit/i18n_test.rb | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||
2 files changed, 64 insertions(+), 2 deletions(-)
|
||
create mode 100644 test/unit/i18n_test.rb
|
||
|
||
diff --git a/lib/hammer_cli/i18n.rb b/lib/hammer_cli/i18n.rb
|
||
index 6b883fc..0cb62b0 100644
|
||
--- a/lib/hammer_cli/i18n.rb
|
||
+++ b/lib/hammer_cli/i18n.rb
|
||
@@ -37,6 +37,10 @@ module HammerCLI
|
||
:mo
|
||
end
|
||
|
||
+ def available?
|
||
+ File.exist?(locale_dir)
|
||
+ end
|
||
+
|
||
attr_reader :locale_dir, :domain_name
|
||
end
|
||
|
||
@@ -76,12 +80,20 @@ module HammerCLI
|
||
@domains
|
||
end
|
||
|
||
+
|
||
def self.add_domain(domain)
|
||
- domains << domain
|
||
- FastGettext.add_text_domain(domain.domain_name, :path => domain.locale_dir, :type => domain.type, :report_warning => false)
|
||
+ if domain.available?
|
||
+ domains << domain
|
||
+ FastGettext.add_text_domain(domain.domain_name, :path => domain.locale_dir, :type => domain.type, :report_warning => false)
|
||
+ end
|
||
end
|
||
|
||
|
||
+ def self.clear
|
||
+ FastGettext.translation_repositories.clear
|
||
+ domains.clear
|
||
+ end
|
||
+
|
||
Encoding.default_external='UTF-8' if defined? Encoding
|
||
FastGettext.locale = locale
|
||
|
||
diff --git a/test/unit/i18n_test.rb b/test/unit/i18n_test.rb
|
||
new file mode 100644
|
||
index 0000000..c0a884c
|
||
--- /dev/null
|
||
+++ b/test/unit/i18n_test.rb
|
||
@@ -0,0 +1,50 @@
|
||
+require File.join(File.dirname(__FILE__), 'test_helper')
|
||
+
|
||
+
|
||
+describe HammerCLI::I18n do
|
||
+
|
||
+ class TestLocaleDomain < HammerCLI::I18n::AbstractLocaleDomain
|
||
+
|
||
+ def initialize(name, available)
|
||
+ @name = name
|
||
+ @available = available
|
||
+ end
|
||
+
|
||
+ def locale_dir
|
||
+ File.dirname(__FILE__)
|
||
+ end
|
||
+
|
||
+ def domain_name
|
||
+ @name
|
||
+ end
|
||
+
|
||
+ def available?
|
||
+ @available
|
||
+ end
|
||
+ end
|
||
+
|
||
+ before :each do
|
||
+ HammerCLI::I18n.clear
|
||
+ end
|
||
+
|
||
+ let(:domain1) { TestLocaleDomain.new('domain1', true) }
|
||
+ let(:domain2) { TestLocaleDomain.new('domain2', true) }
|
||
+ let(:unavailable_domain) { TestLocaleDomain.new('domain3', false) }
|
||
+
|
||
+ it "registers available domains at gettext" do
|
||
+ FastGettext.expects(:add_text_domain).with do |name, options|
|
||
+ (name == domain1.domain_name) && (options[:path] == domain1.locale_dir) && (options[:type] == domain1.type)
|
||
+ end
|
||
+ HammerCLI::I18n.add_domain(domain1)
|
||
+ end
|
||
+
|
||
+ it "skips registering domains that are not available" do
|
||
+ HammerCLI::I18n.add_domain(domain1)
|
||
+ HammerCLI::I18n.add_domain(domain2)
|
||
+ HammerCLI::I18n.add_domain(unavailable_domain)
|
||
+ HammerCLI::I18n.domains.must_equal [domain1, domain2]
|
||
+ end
|
||
+
|
||
+
|
||
+end
|
||
+
|
||
--
|
||
1.7.1
|
||
|
dependencies/squeeze/hammer_cli/patches/series | ||
---|---|---|
fixes-4916-skip-missing-translation-domains.patch
|
dependencies/wheezy/hammer_cli/changelog | ||
---|---|---|
ruby-hammer-cli (0.1.0-1) stable; urgency=low
|
||
|
||
* 0.1.0 release
|
||
|
||
-- Tomas Strachota <tstrachota@redhat.com> Thu, 27 Mar 2014 05:21:24 -0500
|
||
|
||
ruby-hammer-cli (0.0.18-1) stable; urgency=low
|
||
|
||
* 0.0.18 release
|
dependencies/wheezy/hammer_cli/cli_config.yml | ||
---|---|---|
:modules:
|
||
# - hammer_cli_foreman
|
||
# - hammer_cli_katello_bridge
|
||
:ui:
|
||
:interactive: true
|
||
:per_page: 20
|
||
:history_file: '~/.hammer/history'
|
||
|
||
:foreman:
|
||
:host: 'https://localhost/'
|
||
:username: 'admin'
|
||
:password: 'changeme'
|
||
|
||
# :watch_plain: true disables color output of logger.watch in Clamp commands
|
||
# enable/disable color output of logger in Clamp commands
|
||
:watch_plain: false
|
||
|
||
#:log_dir: '/var/log/foreman'
|
||
:log_dir: '~/.foreman/log'
|
||
:log_dir: '~/.hammer/log'
|
||
:log_level: 'error'
|
||
:log_api_calls: false
|
||
#:log_owner: 'foreman'
|
||
#:log_group: 'foreman'
|
||
#:log_size: 5 #MB
|
dependencies/wheezy/hammer_cli/control | ||
---|---|---|
Architecture: all
|
||
XB-Ruby-Versions: ${ruby:Versions}
|
||
Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
|
||
ruby-clamp,
|
||
ruby-clamp (>= 0.6.2),
|
||
ruby-rest-client,
|
||
ruby-logging,
|
||
ruby-table-print,
|
||
ruby-table-print (>= 1.5.1),
|
||
ruby-awesome-print,
|
||
ruby-highline,
|
||
ruby-fastercsv,
|
||
ruby-mime-types (< 2.0.0)
|
||
ruby-mime-types (< 2.0.0),
|
||
ruby-fast-gettext (>= 0.8.0),
|
||
ruby-locale (<= 2.0.9),
|
||
ruby-json (>= 1.6.1),
|
||
ruby-apipie-bindings (>= 0.0.6)
|
||
Description: Universal command-line interface
|
||
Hammer cli provides universal extendable CLI interface for ruby apps
|
dependencies/wheezy/hammer_cli/dirs | ||
---|---|---|
/etc/hammer
|
||
/etc/hammer/cli.modules.d
|
dependencies/wheezy/hammer_cli/install | ||
---|---|---|
debian/cli_config.yml etc/foreman
|
||
debian/cli_config.yml etc/hammer
|
dependencies/wheezy/hammer_cli/patches/fixes-4916-skip-missing-translation-domains.patch | ||
---|---|---|
From 77c62f8e9410c7ab743f0b4cbc7ff9c2a147c98a Mon Sep 17 00:00:00 2001
|
||
From: Tomas Strachota <tstrachota@redhat.com>
|
||
Date: Mon, 31 Mar 2014 11:18:16 +0000
|
||
Subject: [PATCH] Fixes #4916 - skip missing translation domains
|
||
|
||
---
|
||
lib/hammer_cli/i18n.rb | 16 +++++++++++++-
|
||
test/unit/i18n_test.rb | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||
2 files changed, 64 insertions(+), 2 deletions(-)
|
||
create mode 100644 test/unit/i18n_test.rb
|
||
|
||
diff --git a/lib/hammer_cli/i18n.rb b/lib/hammer_cli/i18n.rb
|
||
index 6b883fc..0cb62b0 100644
|
||
--- a/lib/hammer_cli/i18n.rb
|
||
+++ b/lib/hammer_cli/i18n.rb
|
||
@@ -37,6 +37,10 @@ module HammerCLI
|
||
:mo
|
||
end
|
||
|
||
+ def available?
|
||
+ File.exist?(locale_dir)
|
||
+ end
|
||
+
|
||
attr_reader :locale_dir, :domain_name
|
||
end
|
||
|
||
@@ -76,12 +80,20 @@ module HammerCLI
|
||
@domains
|
||
end
|
||
|
||
+
|
||
def self.add_domain(domain)
|
||
- domains << domain
|
||
- FastGettext.add_text_domain(domain.domain_name, :path => domain.locale_dir, :type => domain.type, :report_warning => false)
|
||
+ if domain.available?
|
||
+ domains << domain
|
||
+ FastGettext.add_text_domain(domain.domain_name, :path => domain.locale_dir, :type => domain.type, :report_warning => false)
|
||
+ end
|
||
end
|
||
|
||
|
||
+ def self.clear
|
||
+ FastGettext.translation_repositories.clear
|
||
+ domains.clear
|
||
+ end
|
||
+
|
||
Encoding.default_external='UTF-8' if defined? Encoding
|
||
FastGettext.locale = locale
|
||
|
||
diff --git a/test/unit/i18n_test.rb b/test/unit/i18n_test.rb
|
||
new file mode 100644
|
||
index 0000000..c0a884c
|
||
--- /dev/null
|
||
+++ b/test/unit/i18n_test.rb
|
||
@@ -0,0 +1,50 @@
|
||
+require File.join(File.dirname(__FILE__), 'test_helper')
|
||
+
|
||
+
|
||
+describe HammerCLI::I18n do
|
||
+
|
||
+ class TestLocaleDomain < HammerCLI::I18n::AbstractLocaleDomain
|
||
+
|
||
+ def initialize(name, available)
|
||
+ @name = name
|
||
+ @available = available
|
||
+ end
|
||
+
|
||
+ def locale_dir
|
||
+ File.dirname(__FILE__)
|
||
+ end
|
||
+
|
||
+ def domain_name
|
||
+ @name
|
||
+ end
|
||
+
|
||
+ def available?
|
||
+ @available
|
||
+ end
|
||
+ end
|
||
+
|
||
+ before :each do
|
||
+ HammerCLI::I18n.clear
|
||
+ end
|
||
+
|
||
+ let(:domain1) { TestLocaleDomain.new('domain1', true) }
|
||
+ let(:domain2) { TestLocaleDomain.new('domain2', true) }
|
||
+ let(:unavailable_domain) { TestLocaleDomain.new('domain3', false) }
|
||
+
|
||
+ it "registers available domains at gettext" do
|
||
+ FastGettext.expects(:add_text_domain).with do |name, options|
|
||
+ (name == domain1.domain_name) && (options[:path] == domain1.locale_dir) && (options[:type] == domain1.type)
|
||
+ end
|
||
+ HammerCLI::I18n.add_domain(domain1)
|
||
+ end
|
||
+
|
||
+ it "skips registering domains that are not available" do
|
||
+ HammerCLI::I18n.add_domain(domain1)
|
||
+ HammerCLI::I18n.add_domain(domain2)
|
||
+ HammerCLI::I18n.add_domain(unavailable_domain)
|
||
+ HammerCLI::I18n.domains.must_equal [domain1, domain2]
|
||
+ end
|
||
+
|
||
+
|
||
+end
|
||
+
|
||
--
|
||
1.7.1
|
||
|
dependencies/wheezy/hammer_cli/patches/series | ||
---|---|---|
fixes-4916-skip-missing-translation-domains.patch
|
Also available in: Unified diff
Updated hammer_cli to 0.1.0