ipynbdiff 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10f77cf53513157724c6e1d8c8abc4659e3254dd77c3c14ebb2aaabd3155639c
4
- data.tar.gz: 10815dc6a9cb76c73b4d6c9f712bdb28be9217a2b40efbcf076342e9f5d34811
3
+ metadata.gz: 24615c877db39efeb4b4d0effe014db5a7734f6be88385aaf73bc00622075ca8
4
+ data.tar.gz: 2aca335aa15c5e413eaa23d197f3f9a0f73d6415adbafcb419cf7764eb983e89
5
5
  SHA512:
6
- metadata.gz: 06e895b990e7099d094b6e78c8a54fc6e5c618b28a9ae266cdb47a127189d67df7a7468f5a96fb2da21529f30911dfca761d7e4b0fc5452fc351e1878c697811
7
- data.tar.gz: 54ee8fb62e05b130b304989787ee1032ffe41a2dc68dcdfde5bf7480588bdcd3a4f9a20c3b63eeb7cf21dd0ed89527b34d39a7ec15170f7cddda6114ea8fac0a
6
+ metadata.gz: 280688c5f5f722cea1868963dcf49eefdb3c35374fad96522d7f8b8a7c77b902d11db1b2b5dd1cde3370065159cee4f1c1f252b1a15f585c589abdc9ede02e1f
7
+ data.tar.gz: 50de3ac58248b4af0e67d2e68a476a3c8395753a47638c7ca2015d7c909d55031f605f5334be54d909fd40e5728912623909b7fc3f73f8544b0828dd1e9e6a1a
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,6 @@
1
+ specs:
2
+ stage: test
3
+ image: ruby:2.7
4
+ script:
5
+ - bundle install
6
+ - bundle exec rspec
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ source "https://rubygems.org"
4
+
3
5
  gem 'diffy', '3.3.0'
4
6
  gem 'json', '2.5.1'
5
7
  gem 'rspec', '3.10.0'
data/Gemfile.lock CHANGED
@@ -1,4 +1,5 @@
1
1
  GEM
2
+ remote: https://rubygems.org/
2
3
  specs:
3
4
  diff-lcs (1.4.4)
4
5
  diffy (3.3.0)
@@ -26,4 +27,4 @@ DEPENDENCIES
26
27
  rspec (= 3.10.0)
27
28
 
28
29
  BUNDLED WITH
29
- 2.2.28
30
+ 2.2.29
data/README.md CHANGED
@@ -28,16 +28,16 @@ Options:
28
28
 
29
29
  ```ruby
30
30
  @default_transform_options = {
31
- preprocess_input: TRUE, # Whether the input should be transformed
31
+ preprocess_input: true, # Whether the input should be transformed
32
32
  write_output_to: nil, # Pass a path to save the output to a file
33
33
  format: :text, # These are the formats Diffy accepts https://github.com/samg/diffy
34
- sources_are_files: FALSE, # Weather to use the from/to as string or path to a file
35
- raise_if_invalid_notebook: FALSE, # Raises an error if the notebooks are invalid, otherwise returns nil
34
+ sources_are_files: false, # Weather to use the from/to as string or path to a file
35
+ raise_if_invalid_notebook: false, # Raises an error if the notebooks are invalid, otherwise returns nil
36
36
  transform_options: @default_transform_options, # See below for transform options
37
37
  diff_opts: {
38
- include_diff_info: FALSE # These are passed to Diffy https://github.com/samg/diffy
38
+ include_diff_info: false # These are passed to Diffy https://github.com/samg/diffy
39
39
  }
40
- }
40
+ }
41
41
  ```
42
42
 
43
43
  ### Transforming the notebooks
@@ -52,7 +52,7 @@ Options:
52
52
 
53
53
  ```ruby
54
54
  @default_transform_options = {
55
- include_metadata: FALSE, # Whether to include or not the notebook metadata (kernel, language, etc)
55
+ include_metadata: false, # Whether to include or not the notebook metadata (kernel, language, etc)
56
56
  cell_decorator: :html # :html is useful to add styling with css, :percent is better for text format
57
57
  }
58
58
  ```
data/ipynbdiff.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ipynbdiff'
5
- s.version = '0.3.6'
5
+ s.version = ENV['LIB_VERSION']
6
6
  s.summary = 'Human Readable diffs for Jupyter Notebooks'
7
7
  s.description = 'Better diff for Jupyter Notebooks by first preprocessing them and removing clutter'
8
8
  s.authors = ['Eduardo Bonet']
data/lib/ipynbdiff.rb CHANGED
@@ -6,19 +6,19 @@ module IpynbDiff
6
6
  require 'diffy'
7
7
 
8
8
  @default_transform_options = {
9
- include_metadata: FALSE,
9
+ include_metadata: false,
10
10
  cell_decorator: :html
11
11
  }
12
12
 
13
13
  @default_diff_options = {
14
- preprocess_input: TRUE,
14
+ preprocess_input: true,
15
15
  write_output_to: nil,
16
16
  format: :text,
17
- sources_are_files: FALSE,
18
- raise_if_invalid_notebook: FALSE,
17
+ sources_are_files: false,
18
+ raise_if_invalid_notebook: false,
19
19
  transform_options: @default_transform_options,
20
20
  diff_opts: {
21
- include_diff_info: FALSE
21
+ include_diff_info: false
22
22
  }
23
23
  }.freeze
24
24
 
@@ -27,7 +27,7 @@ module IpynbDiff
27
27
 
28
28
  prep = to_prepare
29
29
  prep = File.read(prep) if options[:sources_are_files]
30
- prep = transform(prep, raise_errors: TRUE, options: options[:transform_options]) if options[:preprocess_input]
30
+ prep = transform(prep, raise_errors: true, options: options[:transform_options]) if options[:preprocess_input]
31
31
  prep
32
32
  end
33
33
 
@@ -48,7 +48,7 @@ module IpynbDiff
48
48
  raise if options[:raise_if_invalid_notebook]
49
49
  end
50
50
 
51
- def self.transform(notebook, raise_errors: FALSE, options: @default_transform_options)
51
+ def self.transform(notebook, raise_errors: false, options: @default_transform_options)
52
52
  options = @default_transform_options.merge(options)
53
53
 
54
54
  Transformer.new(**options).transform(notebook)
data/lib/transformer.rb CHANGED
@@ -11,10 +11,10 @@ module IpynbDiff
11
11
  require 'output_transformer'
12
12
 
13
13
  @cell_decorator = :html
14
- @include_metadata = TRUE
14
+ @include_metadata = true
15
15
 
16
16
 
17
- def initialize(include_metadata: TRUE, cell_decorator: :html)
17
+ def initialize(include_metadata: true, cell_decorator: :html)
18
18
  @include_metadata = include_metadata
19
19
  @cell_decorator = cell_decorator
20
20
  @output_transformer = OutputTransformer.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipynbdiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Bonet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2021-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diffy
@@ -116,6 +116,7 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
+ - ".gitlab-ci.yml"
119
120
  - Gemfile
120
121
  - Gemfile.lock
121
122
  - README.md