wallaby-view 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 6a929efcb346e897dfe0688c5a59456113d629f8db316b2677ad6100e9202306
4
- data.tar.gz: 1828b3f84696bd325b76fc09675f7ba92c1fdcab79debf860e9286d67377df5f
3
+ metadata.gz: e9f47755d845bd5adf4199a5d7e11a50788f1505fdf8c786a447252e8fa0ac29
4
+ data.tar.gz: 4d953c4142e42b2341bf26c55b0d2ad84683c73f95bc526867d2091db3eb6ed1
5
5
  SHA512:
6
- metadata.gz: 3f8195ec5abe1d40680e17b6f9cee3b0b9eef6c987203b84bbc4e6e82fb4fa35ea4d1333c068dae46425d42f9468dc61663c8cc7158ce95b70ea1fa722e18118
7
- data.tar.gz: eb592fa0367da6dc852970d1b848bbabd84631ea250a5347b7efe6e5dc4ef22a9a997ff7447570a53ad7ea236af84581aa6fe3b918c52fe7c64dc60cbe629723
6
+ metadata.gz: 3a5e064cda03c29e6ce17b45e9b945e17bde7d9cb8c091106143624d9b997459ce015d44d07d9e0eb02d540fa05b7a307838c8208d382a021a3ea8eb45dc9ab3
7
+ data.tar.gz: af47857fa027f84384740f04b5e529e00397e477f493905456d410c0691ea2659f1f1681149376601931253884b9ad3f0f64dd5c3e7d57f4a3864d1576253056
@@ -17,7 +17,7 @@ module Wallaby
17
17
  attr_writer :prefix_options
18
18
 
19
19
  def prefix_options
20
- @prefix_options ||= View.try_to superclass, :prefix_options
20
+ @prefix_options ||= superclass.try(:prefix_options)
21
21
  end
22
22
  end
23
23
 
@@ -68,7 +68,7 @@ module Wallaby
68
68
 
69
69
  # (see .theme_name)
70
70
  def theme_name
71
- defined?(@theme_name) && @theme_name || View.try_to(superclass, :theme_name)
71
+ defined?(@theme_name) && @theme_name || superclass.try(:theme_name)
72
72
  end
73
73
 
74
74
  # (see .theme)
@@ -76,12 +76,12 @@ module Wallaby
76
76
  defined?(@theme_name) && @theme_name && {
77
77
  theme_name: @theme_name,
78
78
  theme_path: @theme_path
79
- } || View.try_to(superclass, :theme)
79
+ } || superclass.try(:theme)
80
80
  end
81
81
 
82
82
  # (see .themes)
83
83
  def themes
84
- list = View.try_to(superclass, :themes) || []
84
+ list = superclass.try(:themes) || []
85
85
  list.prepend theme if defined?(@theme_name) && @theme_name
86
86
  list.compact
87
87
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Wallaby
4
4
  module View
5
- VERSION = '0.1.2' # :nodoc:
5
+ VERSION = '0.1.3' # :nodoc:
6
6
  end
7
7
  end
data/lib/wallaby/view.rb CHANGED
@@ -40,19 +40,6 @@ module Wallaby # :nodoc:
40
40
  mod.send :alias_method, :_prefixes, :override_prefixes
41
41
  end
42
42
 
43
- # Util method to check if the given subject responds to the given method.
44
- #
45
- # If so, it will send the message and return the result. Otherwise, nil.
46
- # @param subject [Object]
47
- # @param method_id [Symbol, String]
48
- # @param args [Array]
49
- # @return [Object, nil]
50
- def self.try_to(subject, method_id, *args, &block)
51
- return unless subject.respond_to?(method_id)
52
-
53
- subject.public_send(method_id, *args, &block)
54
- end
55
-
56
43
  COMMA = ',' # :nodoc:
57
44
  EMPTY_STRING = '' # :nodoc:
58
45
  DOT_RB = '.rb' # :nodoc:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wallaby-view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tian Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-14 00:00:00.000000000 Z
11
+ date: 2020-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties