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 +4 -4
- data/lib/chop/create.rb +6 -6
- data/lib/chop/diff.rb +6 -2
- data/lib/chop/version.rb +1 -1
- data/lib/chop.rb +8 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f84ec9d448ef83b5f8d68adbf9a1c550b0a562a97d8fad772cae9c5e7549c73
|
4
|
+
data.tar.gz: d626cb0101cdbff7d412c26674ebaa7570672f18d4f1a543a192a7bf69eca1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: ", ",
|
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!(
|
164
|
+
klass.find_by!(field => name)
|
165
165
|
end
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
-
def has_one key, klass=nil,
|
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!(
|
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
|
-
|
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
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.
|
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-
|
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.
|
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!
|