ipynbdiff 0.3.1 → 0.3.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ipynbdiff.gemspec +3 -3
  3. data/lib/ipynbdiff.rb +6 -5
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0839dd5e5fbcdf19b5525d859fa7d224ec1bb647d7131f9cc20487190ccea80
4
- data.tar.gz: ca32de2c784712f66f2f1c8b5642b32fca0078eae0279c8b30f975216101d143
3
+ metadata.gz: e457c9e3908f4ebdf452ec01428e71ca866730a6e36d4af344cb3e703fe989cc
4
+ data.tar.gz: 4d12d8975526ad09c6f890af1283c7586773fbd8b2a43abda7d65772ac472818
5
5
  SHA512:
6
- metadata.gz: 45353d2e38a4378cb5f785edb6b38d250bf38ce4934f8943dcbe08973e4c187942449d185d4a3af59649d9459c74071475b33f23033c192b4345b24f95a2fd78
7
- data.tar.gz: 7d8df2c34356018dfe098c0f36e8fb8f3c189c8121411826b9923b406ead730856a9e46ca57124b4e4e23e0409e1fdf83c5785686ab6aa0254bcedca07b95246
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.1'
6
- s.summary = 'Human Readble diffs for Jupyter Notebooks'
7
- s.description = 'A simple hello world gem'
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, load_from_file, preprocess)
19
+ def self.prepare_input(to_prepare, options)
19
20
  prepared = to_prepare
20
- prepared = File.read(prepared) if load_from_file
21
- prepared = Transformer.transform(prepared) if preprocess
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[:sources_are_files], options[:preprocess_input])
34
- to = prepare_input(to_notebook, options[:sources_are_files], options[:preprocess_input])
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.1
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: A simple hello world gem
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 Readble diffs for Jupyter Notebooks
147
+ summary: Human Readable diffs for Jupyter Notebooks
147
148
  test_files: []