chop 0.25.0 → 0.25.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chop/form.rb +12 -1
  3. data/lib/chop/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef8e55d7073955552b6c9a2c84fa3557b155932868f819e383bfbe8e324005f7
4
- data.tar.gz: ffc599c2e17422d296c41e1becc4376624d0ed6942107a39f6b37ac74f092c7c
3
+ metadata.gz: f53842373f4008147af52ccaa536a0feba22f09f21f6a817a03843b97a63677f
4
+ data.tar.gz: 606f70be3cec864c4475f45a8dcd9356c79b153aa338129f4ada6819bac5f354
5
5
  SHA512:
6
- metadata.gz: 8bae49072827f854b8d3f82609e91d39cb374d123f12cca8db1b8b2f632076eb355886c00ccb8a8d61eff4d7048501499c45bfed74172879fccef46ca3d78017
7
- data.tar.gz: 5741000e0fc3764eadbc01d42ded2118648e380af61651421f73f640e6dd11264d6d895b3e73030d7d5b5400b2696e53124eb821bd9eed09ae6f9e43c349ab5a
6
+ metadata.gz: 9adfc4c43d158774acc43ffe64f95826614e88734482ba16cb989f4e3150bc88026384b60f29601b3d059eebb80db53b04717f30537976fdcc3d4f3c022c61f6
7
+ data.tar.gz: 91474fd0c048d4fbf61fa91becadc0cee1ffe88ebcda94a718380abde85b5b3c5bf0bfd7417ec5f239ee23fa6c99045eeb5784c7d4b63c89d08450ef5f709882
@@ -8,7 +8,18 @@ module Chop
8
8
  end
9
9
 
10
10
  def self.diff! selector, table, session: Capybara.current_session, &block
11
- all_fields = session.find("form").all("input, textarea, select")
11
+ root = begin
12
+ if selector.is_a?(Capybara::Node::Element)
13
+ selector
14
+ else
15
+ session.find(selector)
16
+ end
17
+ rescue Capybara::ElementNotFound
18
+ raise unless @allow_not_found
19
+ Node("")
20
+ end
21
+
22
+ all_fields = root.all("input, textarea, select")
12
23
  relevant_fields = all_fields.inject([]) do |fields, field|
13
24
  next fields if field[:name].blank?
14
25
  next fields if field[:type] == "submit"
@@ -1,3 +1,3 @@
1
1
  module Chop
2
- VERSION = "0.25.0"
2
+ VERSION = "0.25.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-08 00:00:00.000000000 Z
11
+ date: 2020-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord