sitediff 0.0.6 → 1.2.0

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.
Files changed (55) hide show
  1. checksums.yaml +5 -5
  2. data/.eslintignore +1 -0
  3. data/.eslintrc.json +28 -0
  4. data/.project +11 -0
  5. data/.rubocop.yml +179 -0
  6. data/.rubocop_todo.yml +51 -0
  7. data/CHANGELOG.md +28 -0
  8. data/Dockerfile +33 -0
  9. data/Gemfile +11 -0
  10. data/Gemfile.lock +85 -0
  11. data/INSTALLATION.md +146 -0
  12. data/LICENSE +339 -0
  13. data/README.md +810 -0
  14. data/Rakefile +12 -0
  15. data/Thorfile +135 -0
  16. data/bin/sitediff +9 -2
  17. data/config/.gitkeep +0 -0
  18. data/config/sanitize_domains.example.yaml +8 -0
  19. data/config/sitediff.example.yaml +81 -0
  20. data/docker-compose.test.yml +3 -0
  21. data/lib/sitediff/api.rb +276 -0
  22. data/lib/sitediff/cache.rb +57 -8
  23. data/lib/sitediff/cli.rb +156 -176
  24. data/lib/sitediff/config/creator.rb +61 -77
  25. data/lib/sitediff/config/preset.rb +75 -0
  26. data/lib/sitediff/config.rb +436 -31
  27. data/lib/sitediff/crawler.rb +27 -21
  28. data/lib/sitediff/diff.rb +32 -9
  29. data/lib/sitediff/fetch.rb +10 -3
  30. data/lib/sitediff/files/diff.html.erb +20 -2
  31. data/lib/sitediff/files/jquery.min.js +2 -0
  32. data/lib/sitediff/files/normalize.css +349 -0
  33. data/lib/sitediff/files/report.html.erb +171 -0
  34. data/lib/sitediff/files/sidebyside.html.erb +5 -2
  35. data/lib/sitediff/files/sitediff.css +303 -30
  36. data/lib/sitediff/files/sitediff.js +367 -0
  37. data/lib/sitediff/presets/drupal.yaml +63 -0
  38. data/lib/sitediff/report.rb +254 -0
  39. data/lib/sitediff/result.rb +50 -20
  40. data/lib/sitediff/sanitize/dom_transform.rb +47 -8
  41. data/lib/sitediff/sanitize/regexp.rb +24 -3
  42. data/lib/sitediff/sanitize.rb +81 -12
  43. data/lib/sitediff/uriwrapper.rb +65 -23
  44. data/lib/sitediff/webserver/resultserver.rb +30 -33
  45. data/lib/sitediff/webserver.rb +15 -3
  46. data/lib/sitediff.rb +130 -83
  47. data/misc/sitediff - overview report.png +0 -0
  48. data/misc/sitediff - page report.png +0 -0
  49. data/package-lock.json +878 -0
  50. data/package.json +25 -0
  51. data/sitediff.gemspec +51 -0
  52. metadata +91 -29
  53. data/lib/sitediff/files/html_report.html.erb +0 -66
  54. data/lib/sitediff/files/rules/drupal.yaml +0 -63
  55. data/lib/sitediff/rules.rb +0 -65
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1377b6bafe658b4a8a8f50ef0f54e577e99f1a87
4
- data.tar.gz: 9a80e20a89b7f2f60506bbcccdc2b9f7037320f8
2
+ SHA256:
3
+ metadata.gz: 2e37a67bb4f0d7b93f252940d4ee0e4e3184dc27a435626f995b70bad4a7fc40
4
+ data.tar.gz: 692d0a82b230e2dbab10fe8f6ee8591ca0128998f4c9acd6b97a37a90856c887
5
5
  SHA512:
6
- metadata.gz: 7fe3ce1b2e7bc1762d5e8f4a1bfd4ab9280963732d033d4b403087f71a4d6caa394669eadb9d82064ad963dd62918f95cae7e0b0495dd92979f105be1bfe6f5e
7
- data.tar.gz: fb98c439544172ae40c0ba347272ec1287a1dc9042ab238e4abd8f720d52307ffa8a4b3fec7a70df68c7fdf845b324fe69c99693c5bbbc369f9e2c22fbe8c404
6
+ metadata.gz: 72551efe76eaa6a4a23aeacba6b25cb3bb8b4483d27299846f55ba7a7bad8e256f798de23db36f501a6739875494be808541834bfaadf587fbbd078b6fa62506
7
+ data.tar.gz: 977634a139f70794aa5015e42e014e542391f5cf3c07bd34bff1f7128514051c341512d607f1cb9dfb0326c2bee0c80b2c6b4b119e21897adb5bf516fa7a3140
data/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ *.min.js
data/.eslintrc.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2020": true
5
+ },
6
+ "extends": "eslint:recommended",
7
+ "parserOptions": {
8
+ "ecmaVersion": 11
9
+ },
10
+ "rules": {
11
+ "indent": [
12
+ "error",
13
+ 4
14
+ ],
15
+ "linebreak-style": [
16
+ "error",
17
+ "unix"
18
+ ],
19
+ "quotes": [
20
+ "error",
21
+ "single"
22
+ ],
23
+ "semi": [
24
+ "error",
25
+ "always"
26
+ ]
27
+ }
28
+ }
data/.project ADDED
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>sitediff</name>
4
+ <comment></comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ </buildSpec>
9
+ <natures>
10
+ </natures>
11
+ </projectDescription>
data/.rubocop.yml ADDED
@@ -0,0 +1,179 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ # Common configuration.
4
+ AllCops:
5
+ TargetRubyVersion: 3.1.2
6
+
7
+ Naming/MethodName:
8
+ EnforcedStyle: snake_case
9
+ Exclude:
10
+ # Overriding WEBrick::HTTPServlet::AbstractServlet::do_GET.
11
+ # It's not ours to fix, it comes from the WEBrick libraries.
12
+ - lib/sitediff/webserver/resultserver.rb
13
+
14
+ # Check for grouping of accessors in class and module bodies.
15
+ # By default it enforces accessors to be placed in grouped declarations
16
+ Style/AccessorGrouping:
17
+ Enabled: true
18
+
19
+ #
20
+ Style/ArrayCoercion:
21
+ Enabled: false
22
+
23
+ # Check for places where attr_reader and attr_writer for the same method
24
+ # can be combined into single attr_accessor
25
+ Style/BisectedAttrAccessor:
26
+ Enabled: true
27
+
28
+ # Identifies places where if-elsif constructions can be replaced with case-when
29
+ Style/CaseLikeIf:
30
+ Enabled: true
31
+
32
+ # Disable rules enforcing unreadable programming styles.
33
+ # Example: Use the return of the conditional for variable assignment
34
+ # and comparison
35
+ Style/ConditionalAssignment:
36
+ Enabled: false
37
+
38
+ # Require documentation for class methods.
39
+ Style/DocumentationMethod:
40
+ Enabled: true
41
+
42
+ # Exponential notation: enforces a mantissa between 1 (inclusive) and 10 (exclusive).
43
+ Style/ExponentialNotation:
44
+ Enabled: true
45
+
46
+ # Checks for presence or absence of braces around hash literal as a last array
47
+ # item depending on configuration.
48
+ Style/HashAsLastArrayItem:
49
+ Enabled: true
50
+
51
+ # Check for uses of `each_key` and `each_value` Hash methods.
52
+ Style/HashEachMethods:
53
+ Enabled: true
54
+
55
+ # Check for places where case-when represents a simple 1:1 mapping and
56
+ # can be replaced with a hash lookup.
57
+ Style/HashLikeCase:
58
+ Enabled: true
59
+
60
+ # Use of `transform_keys`: This cop should only be enabled on Ruby version 2.5 or newer.
61
+ Style/HashTransformKeys:
62
+ Enabled: false
63
+
64
+ # Use of `transform_values`.
65
+ Style/HashTransformValues:
66
+ Enabled: true
67
+
68
+ # Check this as the value is changed somewhere after initial assignment.
69
+ Style/MutableConstant:
70
+ Exclude:
71
+ - 'lib/sitediff/sanitize/dom_transform.rb'
72
+
73
+ # Checks for redundant assignment before returning.
74
+ Style/RedundantAssignment:
75
+ Enabled: true
76
+
77
+ # Checks for where fetch(key) { value } can be replaced by fetch(key, value)
78
+ Style/RedundantFetchBlock:
79
+ Enabled: true
80
+
81
+ # Checks for the presence of superfluous .rb extension in the filename
82
+ # provided to require and require_relative.
83
+ Style/RedundantFileExtensionInRequire:
84
+ Enabled: true
85
+
86
+ # Check for unnecessary single-element Regexp character classes.
87
+ Style/RedundantRegexpCharacterClass:
88
+ Enabled: true
89
+
90
+ # Checks for redundant escapes inside Regexp literals.
91
+ Style/RedundantRegexpEscape:
92
+ Enabled: true
93
+
94
+ # Check that arrays are sliced with endless ranges instead of ary[start..-1] on Ruby 2.6+.
95
+ Style/SlicingWithRange:
96
+ Enabled: true
97
+
98
+ # Allow developers to write complex code.
99
+ Metrics/AbcSize:
100
+ Max: 100
101
+
102
+ # Allow developers to write complex code.
103
+ Metrics/CyclomaticComplexity:
104
+ Max: 15
105
+
106
+ # Allow developers to write complex code.
107
+ Metrics/PerceivedComplexity:
108
+ Max: 15
109
+
110
+ # Classes can have as many lines as they want.
111
+ # Complex classes can have many methods after all.
112
+ Metrics/ClassLength:
113
+ Enabled: false
114
+
115
+ # Methods can have a maximum of 128 lines.
116
+ # Complex methods might need to be broken in to multiple methods.
117
+ Metrics/MethodLength:
118
+ Max: 64
119
+ CountComments: false
120
+
121
+ # Methods can have a maximum of 128 lines.
122
+ # Complex methods might need to be broken in to multiple methods.
123
+ Metrics/BlockLength:
124
+ CountComments: false
125
+ Max: 64
126
+ Exclude:
127
+ # Tests can get fairly long, so we ignore them.
128
+ - 'spec/**/*_spec.rb'
129
+
130
+ # Some files have very long lines and need to be ignored.
131
+ # Otherwise, we enforce a max-length of 80 characters per line.
132
+ Layout/LineLength:
133
+ AllowHeredoc: true
134
+ AllowURI: true
135
+ IgnoredPatterns:
136
+ - '^\s*SiteDiff\.log'
137
+ - '^\s*run\s'
138
+ - '\sif|elsif|unless\s'
139
+ Exclude:
140
+ - 'Thorfile'
141
+ # Spec files contain long strings for testing, so we ignore them.
142
+ - 'spec/**/*_spec.rb'
143
+
144
+ # Checks if empty lines exist around the arguments of a method invocation.
145
+ Layout/EmptyLinesAroundAttributeAccessor:
146
+ Enabled: true
147
+
148
+ # Checks that operators have space around them, except for ** which should or shouldn't have surrounding space.
149
+ Layout/SpaceAroundMethodCallOperator:
150
+ Enabled: true
151
+
152
+ # MarshalLoad helps in creating a clone of a Ruby hash, ensuring that it is
153
+ # completely disconnected from the original hash. A common way of doing this
154
+ # is by serializing an object and then un-serializing it with Marshal.
155
+ Security/MarshalLoad:
156
+ Exclude:
157
+ - 'lib/sitediff/cache.rb'
158
+
159
+ # Disallow algorithmic constants for OpenSSL::Cipher and OpenSSL::Digest.
160
+ Lint/DeprecatedOpenSSLConstant:
161
+ Enabled: true
162
+
163
+ # Check that there are no repeated conditions used in if 'elsif'.
164
+ Lint/DuplicateElsifCondition:
165
+ Enabled: true
166
+
167
+ # Do not mix named captures and numbered captures in a Regexp literal.
168
+ Lint/MixedRegexpCaptureTypes:
169
+ Enabled: true
170
+
171
+ # This cop checks for `raise` or `fail` statements which are raising `Exception` class.
172
+ Lint/RaiseException:
173
+ Enabled: true
174
+
175
+ # Check for unexpected overrides of the `Struct` built-in methods via `Struct.new`.
176
+ Lint/StructNewOverride:
177
+ Enabled: true
178
+
179
+
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,51 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2018-12-13 11:15:14 -0500 using RuboCop version 0.60.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 3
10
+ Lint/IneffectiveAccessModifier:
11
+ Exclude:
12
+ - 'lib/sitediff/config.rb'
13
+
14
+ # Offense count: 2
15
+ # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
16
+ Lint/UselessAccessModifier:
17
+ Exclude:
18
+ - 'lib/sitediff/config.rb'
19
+ - 'lib/sitediff/webserver.rb'
20
+
21
+ # Offense count: 3
22
+ Metrics/CyclomaticComplexity:
23
+ Exclude:
24
+ - 'lib/sitediff/api.rb'
25
+ - 'lib/sitediff/cli.rb'
26
+ - 'lib/sitediff/config.rb'
27
+
28
+ # Offense count: 3
29
+ Metrics/PerceivedComplexity:
30
+ Exclude:
31
+ - 'lib/sitediff/api.rb'
32
+ - 'lib/sitediff/cli.rb'
33
+ - 'lib/sitediff/config.rb'
34
+
35
+ # Offense count: 2
36
+ # Configuration parameters: CountKeywordArgs.
37
+ Metrics/ParameterLists:
38
+ Max: 9
39
+
40
+ # Offense count: 1
41
+ Style/StructInheritance:
42
+ Exclude:
43
+ - 'lib/sitediff/result.rb'
44
+
45
+ Style/GuardClause:
46
+ Enabled: false
47
+
48
+ # Offense count: 18!!!
49
+ # New default. https://docs.rubocop.org/en/latest/cops_style/#styleifunlessmodifier
50
+ Style/IfUnlessModifier:
51
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # SiteDiff Change Log
2
+
3
+ Contains noteworthy changes made to SiteDiff.
4
+
5
+ ## Version 1.2.0
6
+ - Updated requirement to Ruby 3.1.2.
7
+ - Upgraded modules for security and compatibility.
8
+ - Fixed bug in crawl command where the `after` site pages were overwriting pages in the `sitediff/before` directory.
9
+ - Fixed bug for using presets.
10
+ - Fixed bug for including other files.
11
+
12
+ ## Version 1.1.2
13
+ - Security upgrades to modules.
14
+
15
+ ## Version 1.1.1
16
+ - Refactor CLI class and move business logic to new SiteDiff::Api class for better integration with other Ruby apps.
17
+ - Add overlay for diff screen - JS fails back to HTML.
18
+ - Add additional information to the report output (21861).
19
+ - Restore the `before_url_report` and `after_url_report` features and improve the output of exported reports (21860).
20
+ - Added named regions feature. (See [Advanced diffs](README.md#advanced-diffs).)
21
+ - Deprecated `--whitelist` and `--blacklist`. To be removed in 1.1.0.
22
+ - Fix `init` command when running with a single URL #109
23
+ - Remove --insecure option — instead, always accept certificates.
24
+ - Update `.travis.yml` to Ruby 2.7
25
+
26
+ ## Prior to 1.0.0
27
+
28
+ Release notes were out of date, so only tracking changes since 1.0.0 here.
data/Dockerfile ADDED
@@ -0,0 +1,33 @@
1
+ FROM ruby:3.1
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ # Minimal dependencies
6
+ # ======
7
+ # Building ruby native extensions requires ruby-dev, make
8
+ # Nokogiri requires libxml2, libxslt, pkg-config
9
+ # Typhoeus requires libcurl3
10
+ # Our build requires rake
11
+ # Install editors: vim, nano.
12
+ RUN apt-get update
13
+ RUN apt-get install -y apt-utils
14
+ RUN apt-get install -y software-properties-common
15
+ RUN apt-get install -y make pkg-config libxml2-dev libxslt-dev
16
+ RUN apt-get install -y vim nano git
17
+
18
+ # Force nokogiri gem not to compile libxml2, it takes too long
19
+ ENV NOKOGIRI_USE_SYSTEM_LIBRARIES 1
20
+
21
+ # Install thor and rspec globally so we can test the gem without bundle exec
22
+ RUN gem install thor rspec --no-document
23
+ COPY . /sitediff
24
+ WORKDIR /sitediff
25
+
26
+ RUN apt-get install -y liblzma-dev
27
+ RUN gem install nokogiri -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/
28
+
29
+ # Build as a gem
30
+ RUN gem build sitediff.gemspec && gem install sitediff --no-document
31
+
32
+ # Build locally
33
+ RUN bundle install
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ gemspec
5
+
6
+ group :development, :test do
7
+ gem 'fileutils', '1.1.0'
8
+ gem 'rspec'
9
+ gem 'rubocop'
10
+ gem 'thor'
11
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,85 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sitediff (1.2.0)
5
+ addressable (>= 2.5.2, < 2.9.0)
6
+ diffy (~> 3.4.0)
7
+ minitar (~> 0.9)
8
+ nokogiri (>= 1.13.6)
9
+ pkg-config (~> 1.4)
10
+ rainbow (~> 3.1.1)
11
+ thor (~> 1.2.1)
12
+ typhoeus (~> 1.4.0)
13
+ webrick (>= 1.7)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ addressable (2.8.0)
19
+ public_suffix (>= 2.0.2, < 5.0)
20
+ ast (2.4.2)
21
+ diff-lcs (1.5.0)
22
+ diffy (3.4.2)
23
+ ethon (0.15.0)
24
+ ffi (>= 1.15.0)
25
+ ffi (1.15.5)
26
+ fileutils (1.1.0)
27
+ json (2.6.2)
28
+ mini_portile2 (2.8.0)
29
+ minitar (0.9)
30
+ nokogiri (1.13.6)
31
+ mini_portile2 (~> 2.8.0)
32
+ racc (~> 1.4)
33
+ parallel (1.22.1)
34
+ parser (3.1.2.0)
35
+ ast (~> 2.4.1)
36
+ pkg-config (1.4.7)
37
+ public_suffix (4.0.7)
38
+ racc (1.6.0)
39
+ rainbow (3.1.1)
40
+ regexp_parser (2.5.0)
41
+ rexml (3.2.5)
42
+ rspec (3.11.0)
43
+ rspec-core (~> 3.11.0)
44
+ rspec-expectations (~> 3.11.0)
45
+ rspec-mocks (~> 3.11.0)
46
+ rspec-core (3.11.0)
47
+ rspec-support (~> 3.11.0)
48
+ rspec-expectations (3.11.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.11.0)
51
+ rspec-mocks (3.11.1)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.11.0)
54
+ rspec-support (3.11.0)
55
+ rubocop (1.31.1)
56
+ json (~> 2.3)
57
+ parallel (~> 1.10)
58
+ parser (>= 3.1.0.0)
59
+ rainbow (>= 2.2.2, < 4.0)
60
+ regexp_parser (>= 1.8, < 3.0)
61
+ rexml (>= 3.2.5, < 4.0)
62
+ rubocop-ast (>= 1.18.0, < 2.0)
63
+ ruby-progressbar (~> 1.7)
64
+ unicode-display_width (>= 1.4.0, < 3.0)
65
+ rubocop-ast (1.18.0)
66
+ parser (>= 3.1.1.0)
67
+ ruby-progressbar (1.11.0)
68
+ thor (1.2.1)
69
+ typhoeus (1.4.0)
70
+ ethon (>= 0.9.0)
71
+ unicode-display_width (2.2.0)
72
+ webrick (1.7.0)
73
+
74
+ PLATFORMS
75
+ ruby
76
+
77
+ DEPENDENCIES
78
+ fileutils (= 1.1.0)
79
+ rspec
80
+ rubocop
81
+ sitediff!
82
+ thor
83
+
84
+ BUNDLED WITH
85
+ 2.1.4
data/INSTALLATION.md ADDED
@@ -0,0 +1,146 @@
1
+ # SiteDiff: Installation
2
+
3
+ The SiteDiff CLI, as the name suggests, is mostly a command-line tool powered
4
+ by Ruby. Please refer to the proper installation instructions depending on your
5
+ operating system.
6
+
7
+ ## Table of contents
8
+
9
+ * [CentOS](#centos)
10
+ * [Docker](#docker)
11
+ * [MacOS](#macos)
12
+ * [Ubuntu](#ubuntu)
13
+ * [Windows](#windows)
14
+ * [Development](#development)
15
+
16
+ ## CentOS
17
+
18
+ These instructions are for CentOS 7 or higher.
19
+
20
+ You'll need [Ruby](https://www.ruby-lang.org/) 3.1.2 or higher.
21
+
22
+ We recommend using one of the following to install Ruby:
23
+
24
+ - [rbenv](https://github.com/rbenv/rbenv)
25
+ - [RVM](https://rvm.io/rvm/install)
26
+
27
+ Here are some dependencies which mostly require a manual installation.
28
+
29
+ ```bash
30
+ sudo yum install libzip-devel gcc patch make
31
+ sudo yum install libxml2-devel libxslt-devel libcurl
32
+ ```
33
+
34
+ We recommend installing _nokogiri_ before the SiteDiff gem. If possible,
35
+ avoid using `sudo` for `gem install`.
36
+
37
+ ```bash
38
+ gem install nokogiri --no-rdoc --no-ri -- --use-system-libraries=true —with-xml2-include=/usr/include/libxml2
39
+ gem install sitediff -v '1.2.0'
40
+ ```
41
+
42
+ ## Docker
43
+
44
+ There is a `Dockerfile` in the root of the SiteDiff git repository. It uses
45
+ the Docker offical Ruby image. Note that SiteDiff will use port `13080` for the result server. The following Docker image tags are available to be pulled.
46
+
47
+ * latest (master branch)
48
+ * 1.0.0
49
+ * 1.0.0-rc1
50
+ * 0.0.6
51
+
52
+ ```bash
53
+ docker run -p 13080:13080 -t -d --name sitediff evolvingweb/sitediff:latest
54
+ docker exec -it sitediff /bin/bash
55
+ ```
56
+
57
+ If used on Apple silicon (m1), you can force the amd64 platform:
58
+ ```bash
59
+ docker run --platform linux/amd64 -p 13080:13080 -t -d --name sitediff evolvingweb/sitediff:latest
60
+ docker exec -it sitediff /bin/bash
61
+ ```
62
+
63
+ ## MacOS
64
+
65
+ You will need [Homebrew](https://brew.sh/) for Mac.
66
+
67
+ If your version of Ruby is not 3.1.2 or later, you will need to upgrade.
68
+
69
+ rbenv is recommended for managing Ruby versions.
70
+
71
+ To install with Homebrew:
72
+
73
+ ```bash
74
+ brew install rbenv ruby ruby-build
75
+ ```
76
+
77
+ There are many dependencies, which are often already installed on many Macs.
78
+
79
+ ```bash
80
+ brew install autoconf libffi libtool libyaml openssl pkg-config
81
+ ```
82
+
83
+ If you prefer not to use Homebrew, you can install manually. See: https://github.com/rbenv/rbenv#basic-github-checkout
84
+
85
+ We recommend installing _nokogiri_ before the sitediff gem. However, on most
86
+ recent Macs, the `nokogiri` step below will fail and it can be safely skipped.
87
+ If possible avoid using `sudo` for `gem install`.
88
+
89
+ ```bash
90
+ gem install nokogiri --no-rdoc --no-ri -- --use-system-libraries=true —with-xml2-include=/usr/include/libxml2
91
+ gem install sitediff -v '1.2.0'
92
+ ```
93
+
94
+ ## Ubuntu
95
+
96
+ These instructions are for Ubuntu 16.04 or higher.
97
+
98
+ You'll need [Ruby](https://www.ruby-lang.org/) 3.1.2 or higher.
99
+
100
+ We recommend using one of the following to install Ruby:
101
+
102
+ - [rbenv](https://github.com/rbenv/rbenv)
103
+ - [RVM](https://rvm.io/rvm/install)
104
+
105
+ Here are some dependencies which mostly require a manual installation.
106
+
107
+ ```bash
108
+ sudo apt-get install -y ruby-dev libz-dev gcc patch make
109
+ sudo apt-get install -y libxml2-dev libxslt-dev libcurl3
110
+ ```
111
+
112
+ We recommend installing _nokogiri_ before the SiteDiff gem. If possible,
113
+ avoid using `sudo` for `gem install`.
114
+
115
+ ```bash
116
+ gem install nokogiri --no-rdoc --no-ri -- --use-system-libraries=true --with-xml2-include=/usr/include/libxml2
117
+ gem install sitediff
118
+ ```
119
+
120
+ ## Windows
121
+
122
+ SiteDiff doesn't officially support the Windows operating system. However, you
123
+ should be able to use SiteDiff inside a VM or a Docker container on Windows.
124
+
125
+ ---
126
+
127
+ ## Development
128
+
129
+ You will need the same dependencies installed as required for the gem.
130
+ Depending on what you use for development, please see instructions for
131
+ CentOS, MacOS, Ubuntu above.
132
+
133
+ Install `bundler` on your system.
134
+
135
+ ```bash
136
+ gem install bundle
137
+ ```
138
+
139
+ There is an up-to-date configuration file for bundle which you can use.
140
+
141
+ ```bash
142
+ git clone https://github.com/evolvingweb/sitediff
143
+ cd sitediff
144
+ git checkout dev
145
+ bundle install
146
+ ```