bogo-ui 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 086eb9d9922c79a9021fe2ee6ea4b6644f472c9c
4
- data.tar.gz: 109ea6e43441e94a1da2a78e42cc22aa1e0de5f2
3
+ metadata.gz: d1d767eb2099b0f4ac0cbc40e21c2ea0bcd83814
4
+ data.tar.gz: 1dfa7f6d9850e33fc991a96a7337a105104d9ef8
5
5
  SHA512:
6
- metadata.gz: 5719ce584cccc14b5d4143888ad728e65142fbd43cc19533774a1341b003bd157c651838826b2f813b13bd63dd4ded40c4d316d755334276b320b488a0ca8d4e
7
- data.tar.gz: 0d0595a972d9a6d0504ed34e6744006797dc3136f2ccb43a2b1e9e94658a92d6178b6ce6e5794b0e4cdcd961008d1ce6ed5141574da9f047198b4710201499eb
6
+ metadata.gz: f25fa2fcf0718ed7fa21f8b54d9481527a9f3ac583720fc4be5890f9e11d0eb3b2f58ccfade8324624b34268bcf8e4f085b9d8a25670c283b068ecff23fe648b
7
+ data.tar.gz: 14567b0044081fdac3ab67c864e990287ccf4b06c0ea0aaefe03fd381819ef6f3e25042c95943bc702b850a05b8cc1d1d87f10edd06fc9d133b0ed94d024ac3b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.1.4
2
+ * Add compat alias `#ask_question` -> `#ask`
3
+ * Allow passing instance to `Ui::Table` to proxy method calls
4
+
1
5
  ## v0.1.2
2
6
  * Fix table generation
3
7
  * Add test coverage
data/lib/bogo-ui/table.rb CHANGED
@@ -13,19 +13,31 @@ module Bogo
13
13
  attr_reader :ui
14
14
  # @return [Array<Proc>]
15
15
  attr_reader :table
16
+ # @return [Object]
17
+ attr_reader :proxy_to
16
18
 
17
19
  # Create a new instance
18
20
  #
19
21
  # @param ui [Bogo::Ui]
20
22
  # @yield table content
21
23
  # @return [self]
22
- def initialize(ui, &block)
24
+ def initialize(ui, inst=nil, &block)
25
+ @proxy_to = inst
23
26
  @ui = ui
24
27
  @base = block
25
28
  @content = []
26
29
  @printed_lines = 0
27
30
  end
28
31
 
32
+ # If proxy instance is provided, forward if possible
33
+ def method_missing(m_name, *args, &block)
34
+ if(proxy_to && proxy_to.respond_to?(m_name, true))
35
+ proxy_to.send(m_name, *args, &block)
36
+ else
37
+ super
38
+ end
39
+ end
40
+
29
41
  # Update the table content
30
42
  #
31
43
  # @yield table content
data/lib/bogo-ui/ui.rb CHANGED
@@ -110,6 +110,7 @@ module Bogo
110
110
  end
111
111
  result
112
112
  end
113
+ alias_method :ask_question, :ask
113
114
 
114
115
  end
115
116
  end
@@ -1,6 +1,6 @@
1
1
  module Bogo
2
2
  class Ui
3
3
  # Current library version
4
- VERSION = Gem::Version.new('0.1.2')
4
+ VERSION = Gem::Version.new('0.1.4')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogo-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-31 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo