hirb 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/lib/hirb.rb +2 -1
- data/lib/hirb/helpers/table/resizer.rb +2 -2
- data/lib/hirb/version.rb +1 -1
- data/lib/hirb/view.rb +2 -2
- data/test/table_test.rb +12 -0
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/lib/hirb.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Needed by Hirb::String to handle multibyte characters
|
2
2
|
$KCODE = 'u' if RUBY_VERSION < '1.9'
|
3
3
|
|
4
|
+
require 'yaml'
|
4
5
|
require 'hirb/util'
|
5
6
|
require 'hirb/string'
|
6
7
|
require 'hirb/formatter' # must come before helpers/auto_table
|
@@ -78,4 +79,4 @@ module Hirb
|
|
78
79
|
end
|
79
80
|
#:startdoc:
|
80
81
|
end
|
81
|
-
end
|
82
|
+
end
|
data/lib/hirb/version.rb
CHANGED
data/lib/hirb/view.rb
CHANGED
@@ -178,7 +178,7 @@ module Hirb
|
|
178
178
|
if defined? Ripl
|
179
179
|
@output_method = true
|
180
180
|
require 'ripl/hirb'
|
181
|
-
elsif defined? IRB
|
181
|
+
elsif defined? IRB::Irb
|
182
182
|
@output_method = true
|
183
183
|
::IRB::Irb.class_eval do
|
184
184
|
alias_method :non_hirb_view_output, :output_value
|
@@ -190,7 +190,7 @@ module Hirb
|
|
190
190
|
end
|
191
191
|
|
192
192
|
def disable_output_method
|
193
|
-
if defined?(IRB) && !defined? Ripl
|
193
|
+
if defined?(IRB::Irb) && !defined? Ripl
|
194
194
|
::IRB::Irb.send :alias_method, :output_value, :non_hirb_view_output
|
195
195
|
end
|
196
196
|
@output_method = nil
|
data/test/table_test.rb
CHANGED
@@ -54,6 +54,18 @@ describe "Table" do
|
|
54
54
|
table([{'a'=>1, 'b'=>2}, {'a'=>3, 'b'=>4}]).should == expected_table
|
55
55
|
end
|
56
56
|
|
57
|
+
it "with no keys renders" do
|
58
|
+
expected_table = <<-TABLE.unindent
|
59
|
+
+--+
|
60
|
+
| |
|
61
|
+
+--+
|
62
|
+
| |
|
63
|
+
+--+
|
64
|
+
1 row in set
|
65
|
+
TABLE
|
66
|
+
table([{}]).should == expected_table
|
67
|
+
end
|
68
|
+
|
57
69
|
it "with array only rows renders" do
|
58
70
|
expected_table = <<-TABLE.unindent
|
59
71
|
+---+---+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hirb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gabriel Horner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-26 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|