specdiff 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -1
- data/lib/specdiff/diff.rb +2 -1
- data/lib/specdiff/differ/hashdiff.rb +4 -0
- data/lib/specdiff/differ/text.rb +6 -0
- data/lib/specdiff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 888c68bf9d22b79bcd5453f24049e375026f150ec28a96fee5610432246a480c
|
4
|
+
data.tar.gz: 82d74700d65c9e0564862d6ae4b615f25381735e2378d0f1a6236b1b945b1c4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe9750778a84629cabee0b1a70936e471d180d71f38a585d056ca8e723b9b04925591ce4de9536a2b0855e03b1c73ccff10a4716b63358b7c233ee1f80443c8
|
7
|
+
data.tar.gz: a115665ae50487b6decb6ebdddab0d840093702ab2c06d7f5b14536cbbd90ca81d3017c32deb390c325a2572a1e8aa13b9f828fcfa7846b7b5e288efef47a431
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -61,13 +61,25 @@ diff.empty? # => true/false, if it is empty you might want to not print the diff
|
|
61
61
|
diff.to_s # => a string for showing to a developer who may or may not be scratching their head
|
62
62
|
```
|
63
63
|
|
64
|
+
### Registering plugins
|
65
|
+
|
66
|
+
```rb
|
67
|
+
# Specdiff comes with json support, but it must be loaded like so:
|
68
|
+
Specdiff.load!(:json)
|
69
|
+
|
70
|
+
# Custom plugins can be loaded like this:
|
71
|
+
Specdiff.load!(MyCustomType)
|
72
|
+
```
|
73
|
+
|
74
|
+
Check out the [source code](./lib/specdiff/plugins/json.rb) to learn the plugin interface.
|
75
|
+
|
64
76
|
## Development
|
65
77
|
|
66
78
|
Install the software versions specified in `.tool-versions`.
|
67
79
|
|
68
80
|
Run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run the tests and linter and make sure they're green before starting to make your changes.
|
69
81
|
|
70
|
-
Run `bundle exec rake -AD`
|
82
|
+
Run `bundle exec rake -AD` for a full list of all the available tasks you may use for development purposes.
|
71
83
|
|
72
84
|
You can also run `bin/console` for an interactive prompt that will allow you to experiment with the gem code loaded.
|
73
85
|
|
data/lib/specdiff/diff.rb
CHANGED
data/lib/specdiff/differ/text.rb
CHANGED
@@ -47,6 +47,8 @@ class Specdiff::Differ::Text
|
|
47
47
|
diff << hunks.last.diff(:unified).to_s
|
48
48
|
end
|
49
49
|
|
50
|
+
return diff if diff == ""
|
51
|
+
|
50
52
|
diff << "\n"
|
51
53
|
|
52
54
|
return colorize_by_line(diff) do |line|
|
@@ -67,6 +69,10 @@ class Specdiff::Differ::Text
|
|
67
69
|
end
|
68
70
|
end
|
69
71
|
|
72
|
+
def self.empty?(diff)
|
73
|
+
diff.raw == ""
|
74
|
+
end
|
75
|
+
|
70
76
|
def self.stringify(diff)
|
71
77
|
diff.raw
|
72
78
|
end
|
data/lib/specdiff/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Odin Heggvold Bekkelund
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashdiff
|