simpletable 0.3.1 → 0.3.2

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MmU3Y2YxODA5ODIxZDVjMzcwMGUzZGVlYmU5ZTIxMDZmZjY5ODA2OQ==
5
- data.tar.gz: !binary |-
6
- N2RmNzQyYjI4NDBiN2FhOGJiYWNmNWM4ZDc3ZjQ4ZGU5NDJkYzllMA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- N2NmNjc0N2ViNjMyZDY1YmQ1NGJiZWUwNGY0MzZlNTA5ODcyNWFlYjYxNDA3
10
- NzllNmQ4MjgxNmI5MTgyZDljOGQxYmNhOGFmMTI2ODI3YjE4ZTNiNmU5MjA1
11
- Nzg0OTNmNzEwODBlOWUzZDE5YTdjMGUyOTg4ZGExOWY2NTMxNjA=
12
- data.tar.gz: !binary |-
13
- NzIwNDc0OWFmN2FlMTNlY2YxNzJjNWQ1YjIxMjNhY2IxMjIyNmFkMDA5ZDQ2
14
- ZGJkNmZkN2I4MzJlZGJkZDBlMDkwNDI1MWZlYmU3ZDRmMzZmOGRiNzA2YjQw
15
- MWU2NmNhMjBkN2RiYjljZDQ0M2MxNjM5M2EyNDQ2MzhhNmMzZmQ=
2
+ SHA1:
3
+ metadata.gz: 2325b6b32df1d609e17b11fede111455907d9a01
4
+ data.tar.gz: f9e9eb8dc02dd5a8c007717c5f4c3aa2f70aaaed
5
+ SHA512:
6
+ metadata.gz: 045446284a882e78279cd51d8e490cb178bfe5c98a0d98e585b03e48cc8551c3286669f26ad737c065add7ee6061b1ef2f906ea9a01a12c1bbfac7f2f45ed2bd
7
+ data.tar.gz: 54864200fa390e1254cf564586db58138bbb6815a5538173810e14f5c8f279bfcc0d875ecd5a4b34c47e4e1ff9e33f508948325d3d169565dba85edd55a83806
data/lib/simpletable.rb CHANGED
@@ -60,9 +60,15 @@ private
60
60
  row << "\n"
61
61
  end
62
62
 
63
- def call_method(obj,method)
63
+ def call_method(obj,methods)
64
64
  begin
65
- obj.send(method).to_s
65
+ ret = obj
66
+ # cast methods to array, for nested calls
67
+ methods = [methods].flatten
68
+ methods.each do |m|
69
+ ret = ret.send(m)
70
+ end
71
+ ret.to_s
66
72
  rescue NoMethodError
67
73
  @placeholder == @separator ? "\"#{@placeholder}\"" : @placeholder
68
74
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleTableConst
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/test.rb CHANGED
@@ -13,7 +13,7 @@ end
13
13
 
14
14
  titles = [ "Title A", "Title B is very long, the longest", "Title C", "Title D" ]
15
15
  titles2 = [ "Title A", "Title B", "Title C", "Title D is very long; the longest" ]
16
- methods = [ :p1, :p2, :p4, :p3 ]
16
+ methods = [ :p1, :p2, :p4, [:p3,:length] ]
17
17
 
18
18
  objs = []
19
19
  objs << TestObject.new("thisisaword","anotherword","short")
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpletable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brady Turner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-01 00:00:00.000000000 Z
11
+ date: 2015-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Create and format tables
@@ -45,9 +45,8 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
48
+ - ".gitignore"
49
49
  - Gemfile
50
- - LICENSE
51
50
  - LICENSE.txt
52
51
  - README.md
53
52
  - Rakefile
@@ -65,17 +64,17 @@ require_paths:
65
64
  - lib
66
65
  required_ruby_version: !ruby/object:Gem::Requirement
67
66
  requirements:
68
- - - ! '>='
67
+ - - ">="
69
68
  - !ruby/object:Gem::Version
70
69
  version: '0'
71
70
  required_rubygems_version: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - ! '>='
72
+ - - ">="
74
73
  - !ruby/object:Gem::Version
75
74
  version: '0'
76
75
  requirements: []
77
76
  rubyforge_project:
78
- rubygems_version: 2.0.6
77
+ rubygems_version: 2.4.6
79
78
  signing_key:
80
79
  specification_version: 4
81
80
  summary: Create and format tables
data/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Brady Turner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-