ztk 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/ztk.png)](http://badge.fury.io/rb/ztk)
2
2
  [![Dependency Status](https://gemnasium.com/zpatten/ztk.png)](https://gemnasium.com/zpatten/ztk)
3
3
  [![Build Status](https://secure.travis-ci.org/zpatten/ztk.png)](http://travis-ci.org/zpatten/ztk)
4
- [![Coverage Status](https://coveralls.io/repos/zpatten/testlab/badge.png?branch=master)](https://coveralls.io/r/zpatten/testlab)
4
+ [![Coverage Status](https://coveralls.io/repos/zpatten/ztk/badge.png?branch=master)](https://coveralls.io/r/zpatten/ztk)
5
5
  [![Code Climate](https://codeclimate.com/github/zpatten/ztk.png)](https://codeclimate.com/github/zpatten/ztk)
6
6
 
7
7
  # ZTK
data/lib/ztk/command.rb CHANGED
@@ -158,7 +158,7 @@ module ZTK
158
158
  if !options.ignore_exit_status && (exit_code != options.exit_code)
159
159
  log_and_raise(CommandError, "exec(#{command.inspect}, #{options.inspect}) failed! [#{exit_code}]")
160
160
  end
161
- OpenStruct.new(:output => output, :exit_code => exit_code)
161
+ OpenStruct.new(:command => command, :output => output, :exit_code => exit_code)
162
162
  end
163
163
 
164
164
  # Not Supported
data/lib/ztk/logger.rb CHANGED
@@ -106,12 +106,13 @@ module ZTK
106
106
  def add(severity, message=nil, progname=nil, shift=0, &block)
107
107
  return if (@level > severity)
108
108
 
109
- msg = (block && block.call)
110
- (msg.nil? || msg.strip.empty?) and return
111
- @hostname ||= %x(hostname -s).chomp.strip
112
- called_by = "#{@hostname}:#{parse_caller(caller[1+shift])}"
113
- message = [message, progname, msg].flatten.compact.join(": ")
114
- message = "%19s.%06d|%05d|%5s|%60s%s\n" % [Time.now.utc.strftime("%Y-%m-%d|%H:%M:%S"), Time.now.utc.usec, Process.pid, SEVERITIES[severity], called_by, message]
109
+ message = block.call if message.nil? && block_given?
110
+ return if message.nil?
111
+
112
+ called_by = parse_caller(caller[1+shift])
113
+
114
+ message = [message, progname].flatten.compact.join(": ")
115
+ message = "%19s.%06d|%05d|%5s|%s%s\n" % [Time.now.utc.strftime("%Y-%m-%d|%H:%M:%S"), Time.now.utc.usec, Process.pid, SEVERITIES[severity], called_by, message]
115
116
 
116
117
  @logdev.write(message)
117
118
  @logdev.respond_to?(:flush) and @logdev.flush
data/lib/ztk/ssh.rb CHANGED
@@ -302,7 +302,7 @@ module ZTK
302
302
  if !options.ignore_exit_status && (exit_code != options.exit_code)
303
303
  log_and_raise(SSHError, message)
304
304
  end
305
- OpenStruct.new(:output => output, :exit_code => exit_code, :exit_signal => exit_signal)
305
+ OpenStruct.new(:command => command, :output => output, :exit_code => exit_code, :exit_signal => exit_signal)
306
306
  end
307
307
 
308
308
  # Uploads a local file to a remote host.
data/lib/ztk/version.rb CHANGED
@@ -21,6 +21,6 @@
21
21
  module ZTK
22
22
 
23
23
  # ZTK Version String
24
- VERSION = "1.1.0"
24
+ VERSION = "1.1.1"
25
25
 
26
26
  end
@@ -34,14 +34,14 @@ describe ZTK::Locator do
34
34
 
35
35
  describe "#find" do
36
36
 
37
- it "should find root" do
38
- subject.find("root").should == "/root"
39
- end
40
-
41
37
  it "should find home" do
42
38
  subject.find("home").should == "/home"
43
39
  end
44
40
 
41
+ it "should not find funkytown_123_abc" do
42
+ lambda { subject.find("funkytown_123_abc") }.should raise_error ZTK::LocatorError
43
+ end
44
+
45
45
  end
46
46
 
47
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubis
@@ -240,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
240
  version: '0'
241
241
  segments:
242
242
  - 0
243
- hash: 1144803051742143768
243
+ hash: -4015995280630629016
244
244
  required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  none: false
246
246
  requirements:
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  version: '0'
250
250
  segments:
251
251
  - 0
252
- hash: 1144803051742143768
252
+ hash: -4015995280630629016
253
253
  requirements: []
254
254
  rubyforge_project:
255
255
  rubygems_version: 1.8.25