tram-page 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tram/page.rb +9 -2
- data/lib/tram/page/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2da2c8691b77724f4c2cf404654c5ef1a3c7e574
|
4
|
+
data.tar.gz: a4ad045bf0497258617b20ce47b0dfabf8e399fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1019255dafb0500aa25040e48786b1463de3d0e514f63144fec24e5705128977f39137a547e21af8be92ca54c5df772bc6dbaa2ed13b035e34814cc1ae5c49dc
|
7
|
+
data.tar.gz: fde7d0cc7d8a5c7b8661931fd248bb4e55f6282ed8cca52c8b789c6176212b7d214241fba779ac0c7719a40b37d8f2f78b92306a9f9eeedea74450d376676b99
|
data/lib/tram/page.rb
CHANGED
@@ -13,6 +13,7 @@ class Tram::Page
|
|
13
13
|
if @__sections.map(&:first).include?(n)
|
14
14
|
raise "Section #{n} already exists"
|
15
15
|
end
|
16
|
+
|
16
17
|
n = define_section_method(n, options)
|
17
18
|
@__sections << [n, options]
|
18
19
|
end
|
@@ -50,11 +51,17 @@ class Tram::Page
|
|
50
51
|
methods = self.class.instance_variable_get(:"@__sections") || []
|
51
52
|
except = Array(options[:except])
|
52
53
|
only = Array(options[:only])
|
53
|
-
methods.reject do |(name,
|
54
|
+
methods.reject do |(name, opts)|
|
54
55
|
(except.any? && except.include?(name)) ||
|
55
|
-
(only.any? && !only.include?(name))
|
56
|
+
(only.any? && !only.include?(name)) ||
|
57
|
+
__hide?(opts)
|
56
58
|
end
|
57
59
|
end
|
60
|
+
|
61
|
+
def __hide?(opts)
|
62
|
+
black, white = opts.values_at(:unless, :if)
|
63
|
+
(black && public_send(black)) || (white && !public_send(white))
|
64
|
+
end
|
58
65
|
end
|
59
66
|
|
60
67
|
Tram::Page.i18n_scope = "pages"
|
data/lib/tram/page/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tram-page
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Viktor Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.6.
|
125
|
+
rubygems_version: 2.6.12
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Page Object pattern
|