knjrbfw 0.0.79 → 0.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/knjrbfw.gemspec +2 -2
- data/lib/knj/gtk2_tv.rb +4 -0
- data/lib/knj/strings.rb +3 -3
- data/spec/strings_spec.rb +6 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.80
|
data/knjrbfw.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{knjrbfw}
|
8
|
-
s.version = "0.0.
|
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-
|
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 = [
|
data/lib/knj/gtk2_tv.rb
CHANGED
@@ -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
|
data/lib/knj/strings.rb
CHANGED
@@ -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
|
|
data/spec/strings_spec.rb
CHANGED
@@ -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.
|
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-
|
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:
|
397
|
+
hash: -3889913433613768246
|
398
398
|
segments:
|
399
399
|
- 0
|
400
400
|
version: "0"
|