chop 0.28.1 → 0.29.0

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: f6ba456da0a548764f1a18e69630fe483b74ba5f4011c4f2f0468f63425e6a16
4
- data.tar.gz: 0b7ddf32ce0881dc3fea0ab5360dc6f9140b07a819b26c648de400b777938742
3
+ metadata.gz: 0f84ec9d448ef83b5f8d68adbf9a1c550b0a562a97d8fad772cae9c5e7549c73
4
+ data.tar.gz: d626cb0101cdbff7d412c26674ebaa7570672f18d4f1a543a192a7bf69eca1e9
5
5
  SHA512:
6
- metadata.gz: 7bf304ee6020e23edda9a226fa4dbde24a23ba8a7cd0e4e098eb024da1e90ea89e552515c751bcf347d96dd7bed41ec49199478501d852eb2f61b3a95bc956b3
7
- data.tar.gz: 51dbb0ca6ec2295305349948418cfb0c56a8ffeedad2570b444053da19a300ff60600a94108667d12c902c342fe066638c7d185e030953c93adb2be98bc7550c
6
+ metadata.gz: fa66bb7aacdce2c7bdbb224ad879d28c29236768a6a586d488e181f4455446a51e86de45320c5f2508613a16bbc31a6b422b6c744b589842a0a292b3a50a3c90
7
+ data.tar.gz: 5f896840ea326efaa236f32a9e60e717cb31fde302dbcd157be4c72de5cec9f07c1be9e18dfcbffa28e703eaf850dbe405e9f061969f54215b1427d38ad05f04
data/lib/chop/create.rb CHANGED
@@ -157,19 +157,19 @@ module Chop
157
157
  end
158
158
  end
159
159
 
160
- def has_many key, klass=nil, delimiter: ", ", name_field: :name
160
+ def has_many key, klass=nil, delimiter: ", ", field: :name
161
161
  klass ||= key.to_s.classify.constantize
162
- field key do |names|
162
+ self.field key do |names|
163
163
  names.split(delimiter).map do |name|
164
- klass.find_by!(name_field => name)
164
+ klass.find_by!(field => name)
165
165
  end
166
166
  end
167
167
  end
168
168
 
169
- def has_one key, klass=nil, name_field: :name
169
+ def has_one key, klass=nil, field: :name
170
170
  klass ||= key.to_s.classify.constantize
171
- field key do |name|
172
- klass.find_by!(name_field => name) if name.present?
171
+ self.field key do |name|
172
+ klass.find_by!(field => name) if name.present?
173
173
  end
174
174
  end
175
175
  alias_method :belongs_to, :has_one
data/lib/chop/diff.rb CHANGED
@@ -5,8 +5,12 @@ require "active_support/hash_with_indifferent_access"
5
5
 
6
6
  module Chop
7
7
  class Diff < Struct.new(:selector, :table, :session, :timeout, :block)
8
- def self.diff! selector, table, session: Capybara.current_session, timeout: Capybara.default_max_wait_time, &block
9
- new(selector, table, session, timeout, block).diff!
8
+ def self.diff! selector, table, session: Capybara.current_session, timeout: Capybara.default_max_wait_time, errors: [], &block
9
+ errors += session.driver.invalid_element_errors
10
+ errors += [Cucumber::MultilineArgument::DataTable::Different]
11
+ session.document.synchronize timeout, errors: errors do
12
+ new(selector, table, session, timeout, block).diff!
13
+ end
10
14
  end
11
15
 
12
16
  def cell_to_image_filename cell
data/lib/chop/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chop
2
- VERSION = "0.28.1"
2
+ VERSION = "0.29.0"
3
3
  end
data/lib/chop.rb CHANGED
@@ -13,7 +13,14 @@ module Chop
13
13
  extend Config
14
14
 
15
15
  def self.empty_table
16
- Cucumber::MultilineArgument::DataTable.from([[]])
16
+ empty = Cucumber::MultilineArgument::DataTable.from([[]])
17
+
18
+ def empty.diff! ...
19
+ super
20
+ rescue Capybara::ElementNotFound
21
+ end
22
+
23
+ empty
17
24
  end
18
25
  end
19
26
 
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.28.1
4
+ version: 0.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-29 00:00:00.000000000 Z
11
+ date: 2024-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubygems_version: 3.5.3
177
+ rubygems_version: 3.5.6
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Slice and dice your cucumber tables with ease!