ipynbdiff 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ipynbdiff.gemspec +3 -3
- data/lib/ipynbdiff.rb +6 -5
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e457c9e3908f4ebdf452ec01428e71ca866730a6e36d4af344cb3e703fe989cc
|
4
|
+
data.tar.gz: 4d12d8975526ad09c6f890af1283c7586773fbd8b2a43abda7d65772ac472818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3da474c1bad0797b392f51cb33692216d2326822b8654a507849c05d52d4631799c88ccbcd92bc8df1b01f72352b8031e782384f605c9d0abf07dcce9dd4a176
|
7
|
+
data.tar.gz: ba36b69389d265d8ebd327a66d081688f242614938f51b0c3d644a07502aef1854ebb4804b20572ab9d81c64a7a45c4844b1bba6889ace7988ac85e95130a72d
|
data/ipynbdiff.gemspec
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'ipynbdiff'
|
5
|
-
s.version = '0.3.
|
6
|
-
s.summary = 'Human
|
7
|
-
s.description = '
|
5
|
+
s.version = '0.3.2'
|
6
|
+
s.summary = 'Human Readable diffs for Jupyter Notebooks'
|
7
|
+
s.description = 'Better diff for Jupyter Notebooks by first preprocessing them and removing clutter'
|
8
8
|
s.authors = ['Eduardo Bonet']
|
9
9
|
s.email = 'ebonet@gitlab.com'
|
10
10
|
# Specify which files should be added to the gem when it is released.
|
data/lib/ipynbdiff.rb
CHANGED
@@ -10,15 +10,16 @@ module IpynbDiff
|
|
10
10
|
write_output_to: nil,
|
11
11
|
format: :text,
|
12
12
|
sources_are_files: FALSE,
|
13
|
+
include_metadata: TRUE,
|
13
14
|
diff_opts: {
|
14
15
|
include_diff_info: FALSE
|
15
16
|
}
|
16
17
|
}.freeze
|
17
18
|
|
18
|
-
def self.prepare_input(to_prepare,
|
19
|
+
def self.prepare_input(to_prepare, options)
|
19
20
|
prepared = to_prepare
|
20
|
-
prepared = File.read(prepared) if
|
21
|
-
prepared = Transformer.transform(prepared) if
|
21
|
+
prepared = File.read(prepared) if options[:sources_are_files]
|
22
|
+
prepared = Transformer.transform(prepared, include_metadata: options[:include_metadata]) if options[:preprocess_input]
|
22
23
|
|
23
24
|
prepared
|
24
25
|
end
|
@@ -30,8 +31,8 @@ module IpynbDiff
|
|
30
31
|
)
|
31
32
|
options = @default_options.merge(options)
|
32
33
|
|
33
|
-
from = prepare_input(from_notebook, options
|
34
|
-
to = prepare_input(to_notebook, options
|
34
|
+
from = from_notebook && prepare_input(from_notebook, options) || ''
|
35
|
+
to = to_notebook && prepare_input(to_notebook, options) || ''
|
35
36
|
|
36
37
|
d = Diffy::Diff.new(from, to, **options[:diff_opts]).to_s(options[:format])
|
37
38
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipynbdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Bonet
|
@@ -108,7 +108,8 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description:
|
111
|
+
description: Better diff for Jupyter Notebooks by first preprocessing them and removing
|
112
|
+
clutter
|
112
113
|
email: ebonet@gitlab.com
|
113
114
|
executables: []
|
114
115
|
extensions: []
|
@@ -143,5 +144,5 @@ requirements: []
|
|
143
144
|
rubygems_version: 3.1.6
|
144
145
|
signing_key:
|
145
146
|
specification_version: 4
|
146
|
-
summary: Human
|
147
|
+
summary: Human Readable diffs for Jupyter Notebooks
|
147
148
|
test_files: []
|