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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5032f08cccd0af7ac9983fa879006022b3dd437b
4
- data.tar.gz: 4247af1cab8cd52f6d246f0a8bd12e0c76037d82
3
+ metadata.gz: 18b904b14f2f8426190aeeb648ac611b5819549a
4
+ data.tar.gz: 5187a12ad7ddb2e904dc60a7c610dca647bf4676
5
5
  SHA512:
6
- metadata.gz: 5848350418a76332671b1490a2c3b78899f32d787cb23e2aeaae93211775edab9208fe9703332237034ef8b6f06db35370cba651bcc0ea0f57eaab69502e5446
7
- data.tar.gz: 1281fc95c562a0a733257954b91139a24db4733c0453e95d1dd8ac49052c05227b42b8796ebf761bdce58e62e4e4b796b56b5f62583db44e8efd548d1774cd43
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
@@ -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
- cmd = "git diff --no-index --color-words --word-diff-regex='\w+|[^[:space:]=\"<>]+' #{old_beautified_html_path} #{new_beautified_html_path}"
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
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Differ
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  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.1
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-08-28 00:00:00.000000000 Z
11
+ date: 2018-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara