ttable 0.0.7 → 0.0.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1143d0826e56fc391aab77df86ae4bb65d60e4b7
4
- data.tar.gz: d9dd441bc44c6acbd8ebc16627b18fab37a05c4f
3
+ metadata.gz: 829caabb9f6ecd7558801ce9018bb718b782a761
4
+ data.tar.gz: 13c4d80c988f1e6540a36680a202762fc44bb5c5
5
5
  SHA512:
6
- metadata.gz: f6c57c1f6bcd67303b255c6a1ae59b979ce0f4526f5af3245ef267242ead715be3249a55d6ebf97d201f03728b26cf0d97e686a3238975770e575beac18f82b2
7
- data.tar.gz: dd5306f3053de63bf39403b8eabde5f3f97ca143ce8327ce289bebbf4ed55cd35482489f37e2d45fb9e08a5601290092d884b63a202daf1d433d109107439e32
6
+ metadata.gz: 3ee3b47945d736053de60e3e85e9d89d0f1fdacf8805a664ffc1ed5d56f108fc3a093af66b48a4fce39df1ece39a2272d49275f3b20b93bcdcdd63037003d4b6
7
+ data.tar.gz: 89fce1106da7dcd7813942f308b1932b803d995d0cfcec999dc47b4a1ac6f735ed83cfe84d3b03b954b27f56d92bd0dfe6e575511da9e2c0c2c9416ead69844d
@@ -2,3 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
4
  script: bundle exec rspec
5
+ gemfile: Gemfile.ci
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rspec', '~> 2.12.0'
7
+ gem 'guard'
8
+ gem 'guard-rspec'
9
+ gem 'simplecov', require: false
10
+ gem 'coveralls', require: false
11
+ end
data/Guardfile CHANGED
@@ -1,6 +1,3 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
1
  guard 'rspec' do
5
2
  watch(%r{^spec/.+_spec\.rb$})
6
3
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
@@ -65,7 +65,11 @@ module Terminal
65
65
  end
66
66
 
67
67
  def add_object(object, options)
68
- add_hash(object.to_hash, options) if object.respond_to?(:to_hash)
68
+ if object.respond_to?(:to_hash)
69
+ add_hash(object.to_hash, options)
70
+ elsif object.respond_to?(:each)
71
+ @rows << object
72
+ end
69
73
  end
70
74
 
71
75
  def add_hash(hash, options)
@@ -1,5 +1,5 @@
1
1
  module Terminal
2
2
  class Table
3
- VERSION = '0.0.7'
3
+ VERSION = '0.0.8'
4
4
  end
5
5
  end
@@ -22,6 +22,19 @@ module Terminal
22
22
  describe Table do
23
23
  it { should respond_to :to_s }
24
24
 
25
+ describe 'initialize with array of array' do
26
+ let(:array) { [%w{ hello 1 }, %w{ world 2 } ] }
27
+ subject { Table.new(array) }
28
+
29
+ expected = <<END
30
+ +-------+---+
31
+ | hello | 1 |
32
+ | world | 2 |
33
+ +-------+---+
34
+ END
35
+ its(:to_s) { should == expected.gsub(/^(\s+)/, '') }
36
+ end
37
+
25
38
  describe 'initialize with hash' do
26
39
  let(:hash) { { foo: 'bar' } }
27
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ttable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Forrest Ye
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-15 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -63,6 +63,7 @@ files:
63
63
  - .gitignore
64
64
  - .travis.yml
65
65
  - Gemfile
66
+ - Gemfile.ci
66
67
  - Guardfile
67
68
  - LICENSE.txt
68
69
  - README.md