capybara-differ 0.2.1 → 0.2.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 +4 -4
- data/README.md +16 -0
- data/lib/capybara-differ.rb +2 -1
- data/lib/capybara-differ/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18b904b14f2f8426190aeeb648ac611b5819549a
|
|
4
|
+
data.tar.gz: 5187a12ad7ddb2e904dc60a7c610dca647bf4676
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 476f7055ae9712b721c04cfb5304c533448488557568745affc1c8a7d6e9cc36b152f853e8e562d614c809bd98e8bfb4237336e6538439ea049af870f348e1ff
|
|
7
|
+
data.tar.gz: d7d8bbecb7d2b4666fd66c9601bff5dda32d2f08e3f7507dd2c45c2e146946e5c4fb5f6cefab0a8ab0beabc983cf6445633357f77ff36a80a19b0df1ae3eca6c
|
data/README.md
CHANGED
|
@@ -79,6 +79,22 @@ session.visit 'http://rubyonrails.org/'
|
|
|
79
79
|
session.check_page('rails_page')
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
+
#### Change the number of lines of context
|
|
83
|
+
|
|
84
|
+
Supports the option(`context`) to change the number of lines of context.
|
|
85
|
+
It sets the value of `--unified=`(default 3) of git diff option.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
session.check_page('test_page', context: 0)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
It's possible to change the value from command line using env var
|
|
92
|
+
if you have code something like the following.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
session.check_page('test_page', context: ENV.fetch('CONTEXT', 3))
|
|
96
|
+
```
|
|
97
|
+
|
|
82
98
|
### Dependencies
|
|
83
99
|
|
|
84
100
|
* git
|
data/lib/capybara-differ.rb
CHANGED
|
@@ -27,7 +27,8 @@ module Capybara
|
|
|
27
27
|
diff = Diffy::Diff.new(old_beautified_html_path, new_beautified_html_path, diffy_options.merge(source: 'files'))
|
|
28
28
|
diff.to_s(diffy_options.fetch(:format, :color))
|
|
29
29
|
else
|
|
30
|
-
|
|
30
|
+
context = @options.fetch(:context, 3).to_i
|
|
31
|
+
cmd = "git diff --no-index --color-words --unified=#{context} --word-diff-regex='\w+|[^[:space:]=\"<>]+' #{old_beautified_html_path} #{new_beautified_html_path}"
|
|
31
32
|
Open3.popen3(cmd) { |i, o, e| o.read }
|
|
32
33
|
end
|
|
33
34
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capybara-differ
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kazuho Yamaguchi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capybara
|