site_prism-all_there 2.0 → 2.0.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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 376c04f51a8a815bae55f513721968bf3069c6fdc0f7f4685eaed8f05240f131
4
- data.tar.gz: 3d181c424334f8c7be4749bc7f381508b4a9ea8f27aaa8ce74fcb817b7d6cad4
3
+ metadata.gz: dbdb3fd1e22f9f832cb21e808f77a1c0c236f25442874f692df69bb0d1437367
4
+ data.tar.gz: b98ec38bc16d1f410dc1584ced388a451856295660a9492d64a2b789cd450153
5
5
  SHA512:
6
- metadata.gz: c12c252c431577beb45a46a895a891e486f583293f860711c3ad5fc405b05a24db55e498e1892c294a37eab9c580806a9c6660eb6438092985a7291534e495c5
7
- data.tar.gz: 6024f46050a28a69fbffcfa40d763899abe0c3a7d10cbb9e32405eef14b0acfc2a6643c86560e416f6162a56e623cb5f6776337ccf6814cd0a40997cfaff4c4d
6
+ metadata.gz: b068d588ecb66eae71bb7a5bca3ed990b6f38a7c5b6a6b617edab27f63666a2bfb7a6afd21c07f362cfbcc4930a2ce6b4b1dd6abb724927793f5f2438ba2602a
7
+ data.tar.gz: 0fa5d87ac1f7aa303dac2754eb3b6303522bfb5ba0b70772e971207f8a0da0621e606f7243c8db2f6065df0d22fc2202d2d31d998606dc3cdc0201710c8a8216
data/README.md CHANGED
@@ -11,30 +11,13 @@
11
11
  This in the breakout gem from SitePrism to perform recursion checks for `#all_there?`
12
12
 
13
13
  This gem is a breakout of the current `SitePrism::Page#all_there?` and `SitePrism::Section#all_there?`
14
- methods which have already existed in the gem since version 2.
14
+ methods which have already existed in the gem since version 2
15
15
 
16
- The gem is **now finally** version stable. It will be added as default
17
- functionality in `site_prism` version 4. Which is slated for release early 2023!
16
+ The gem is **now finally** version stable. It is now default functionality in `site_prism` version 4
18
17
 
19
18
  ## Enabling gem methods
20
19
 
21
- - Add the following code to either `spec_helper.rb` or `env.rb` (Pre version 4)
22
-
23
- ```rb
24
- require 'site_prism/all_there'
25
-
26
- SitePrism.use_all_there_gem = true
27
-
28
- # or...
29
-
30
- require 'site_prism/all_there'
31
-
32
- SitePrism.configure do |config|
33
- config.use_all_there_gem = true
34
- end
35
- ```
36
-
37
- > From version 4 onwards this is done by default and isn't required
20
+ The gem methods are now (by default), enabled with `site_prism` version 4 and above
38
21
 
39
22
  ## Usage
40
23
 
@@ -45,7 +28,7 @@ your_page = YourPage.new
45
28
 
46
29
  your_page.all_there?(recursion: :none) # This will do the standard `#all_there?` check on the current page
47
30
  your_page.all_there?(recursion: :one) # This will do the standard `#all_there?` check on the current page as well recursing into all `:section` or `:sections` objects and then doing the standard `#all_there?` check on those `Section` instances
48
- your_page.all_there?(recursion: :invalid) # This will not perform any checks and just throw an error message
31
+ your_page.all_there?(recursion: :invalid) # This will not perform any checks and just log an error
49
32
  ```
50
33
 
51
34
  ### Global configuration
@@ -69,7 +52,7 @@ Then you can perform the above checks using the global config.
69
52
 
70
53
  ## Troubleshooting
71
54
 
72
- Mixing and matching the global config won't work - To come in v3!
55
+ **Mixing and matching the global config won't work - To come in v3!**
73
56
 
74
57
  Happy Testing / Developing!
75
58
 
@@ -23,7 +23,7 @@ module SitePrism
23
23
  elements,
24
24
  section,
25
25
  sections,
26
- iframe,
26
+ iframe
27
27
  ]
28
28
  end
29
29
 
@@ -64,18 +64,14 @@ module SitePrism
64
64
  end
65
65
 
66
66
  def mapped_checklist
67
- if checklist
67
+ if instance.class.expected_items
68
68
  SitePrism.logger.debug('Expected Items has been set.')
69
- mapped_items.array.select { |name| checklist.include?(name) }
69
+ mapped_items.array & instance.class.expected_items
70
70
  else
71
71
  mapped_items.array
72
72
  end
73
73
  end
74
74
 
75
- def checklist
76
- instance.class.expected_items
77
- end
78
-
79
75
  def mapped_items
80
76
  @mapped_items ||= MappedItems.new(instance)
81
77
  end
@@ -8,11 +8,10 @@ module SitePrism
8
8
  # The Expected Items on a SitePrism Page or Section structured in an enumerable way
9
9
  #
10
10
  class MappedItems
11
- attr_reader :instance
12
- private :instance
11
+ attr_reader :hash
13
12
 
14
13
  def initialize(instance)
15
- @instance = instance
14
+ @hash = instance.class.mapped_items
16
15
  end
17
16
 
18
17
  # @return [Array<Symbol>]
@@ -20,12 +19,6 @@ module SitePrism
20
19
  def array
21
20
  hash.values.flatten.uniq
22
21
  end
23
-
24
- # @return [Hash<Symbol>]
25
- # All expected mapped items on the SitePrism instance as a Symbol Hash
26
- def hash
27
- instance.class.mapped_items(legacy: false)
28
- end
29
22
  end
30
23
  end
31
24
  end
@@ -16,9 +16,8 @@ module SitePrism
16
16
  end
17
17
 
18
18
  # @return [Boolean]
19
- # This currently defaults to perform a recursion of depth +:one+
20
- # It will be refactored to use either no input, +:none+, or +:one+ as the
21
- # regular repo uses currently
19
+ # This currently defaults to perform a recursion of depth +:one+ (From the main `site_prism` gem)
20
+ # It will be refactored to use either no input, +:none+, or +:one+ as the regular repo uses currently
22
21
  def all_there?(recursion:)
23
22
  recursion = SitePrism.recursion_setting if SitePrism.recursion_setting
24
23
 
@@ -4,6 +4,6 @@ module SitePrism
4
4
  module AllThere
5
5
  # @return [String]
6
6
  # Version of the gem
7
- VERSION = '2.0'
7
+ VERSION = '2.0.2'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_prism-all_there
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Hill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-06 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -30,62 +30,56 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.47.0
33
+ version: 1.50.2
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
- version: 1.47.0
40
+ version: 1.50.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop-performance
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.16.0
47
+ version: 1.17.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.16.0
54
+ version: 1.17.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.17.1
61
+ version: 2.20.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.17.1
68
+ version: 2.20.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: site_prism
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">"
74
- - !ruby/object:Gem::Version
75
- version: '3.7'
76
- - - "<"
73
+ - - "~>"
77
74
  - !ruby/object:Gem::Version
78
- version: '5'
75
+ version: '4.0'
79
76
  type: :development
80
77
  prerelease: false
81
78
  version_requirements: !ruby/object:Gem::Requirement
82
79
  requirements:
83
- - - ">"
84
- - !ruby/object:Gem::Version
85
- version: '3.7'
86
- - - "<"
80
+ - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: '5'
82
+ version: '4.0'
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: yard
91
85
  requirement: !ruby/object:Gem::Requirement
@@ -101,8 +95,8 @@ dependencies:
101
95
  - !ruby/object:Gem::Version
102
96
  version: '0.9'
103
97
  description: |-
104
- SitePrism AllThere gives you a simple DSL in order to recursively query,
105
- page/section/element structures on your page - exclusively for use with the SitePrism gem.
98
+ SitePrism AllThere allows you to recursively query page and section structures
99
+ on your page - exclusively for use with the SitePrism gem.
106
100
  email:
107
101
  - lukehill_uk@hotmail.com
108
102
  executables: []
@@ -138,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
132
  - !ruby/object:Gem::Version
139
133
  version: '0'
140
134
  requirements: []
141
- rubygems_version: 3.4.1
135
+ rubygems_version: 3.1.6
142
136
  signing_key:
143
137
  specification_version: 4
144
138
  summary: An extension to allow you to recurse through your SitePrism Pages/Sections