knjrbfw 0.0.79 → 0.0.80

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.79
1
+ 0.0.80
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{knjrbfw}
8
- s.version = "0.0.79"
8
+ s.version = "0.0.80"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = %q{2012-08-07}
12
+ s.date = %q{2012-08-08}
13
13
  s.description = %q{Including stuff for HTTP, SSH and much more.}
14
14
  s.email = %q{k@spernj.org}
15
15
  s.extra_rdoc_files = [
@@ -81,6 +81,10 @@ module Knj::Gtk2::Tv
81
81
  col.__send__("#{arg}=", args[arg]) if args.key?(arg)
82
82
  end
83
83
 
84
+ [:width_chars, :wrap_mode, :wrap_width].each do |arg|
85
+ renderer.__send__("#{arg}=", args[arg]) if args.key?(arg)
86
+ end
87
+
84
88
  tv.append_column(col)
85
89
  ret[:renderers] << renderer
86
90
  count += 1
@@ -271,13 +271,13 @@ module Knj::Strings
271
271
  end
272
272
 
273
273
  #Returns a short time-format for the given amount of seconds.
274
- def self.secs_to_human_short_time(secs)
274
+ def self.secs_to_human_short_time(secs, args = nil)
275
275
  secs = secs.to_i
276
276
 
277
- return "#{secs}s" if secs < 60
277
+ return "#{secs}s" if secs < 60 and (!args or !args.key?(:secs) or args[:secs])
278
278
 
279
279
  mins = (secs.to_f / 60.0).floor
280
- if mins < 60
280
+ if mins < 60 and (!args or !args.key?(:mins) or args[:mins])
281
281
  return "#{mins.to_i}m"
282
282
  end
283
283
 
@@ -50,5 +50,11 @@ describe "Strings" do
50
50
 
51
51
  res = Knj::Strings.secs_to_human_short_time(185)
52
52
  raise "Expected '3m' but got '#{res}'." if res != "3m"
53
+
54
+ res = Knj::Strings.secs_to_human_short_time(57, :secs => false)
55
+ raise "Expected '0m' but got '#{res}'." if res != "0m"
56
+
57
+ res = Knj::Strings.secs_to_human_short_time(120, :mins => false)
58
+ raise "Expected '0.0t' but got '#{res}'." if res != "0.0t"
53
59
  end
54
60
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: knjrbfw
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.79
5
+ version: 0.0.80
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-08-07 00:00:00 +02:00
13
+ date: 2012-08-08 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -394,7 +394,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
394
394
  requirements:
395
395
  - - ">="
396
396
  - !ruby/object:Gem::Version
397
- hash: 1485433927830025325
397
+ hash: -3889913433613768246
398
398
  segments:
399
399
  - 0
400
400
  version: "0"