notion_to_md 0.0.2 → 0.0.3

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: fbf7716b4f2a300d37f0fe04bcd7ed44ef0cc82bc49f65746b001a00f807771a
4
- data.tar.gz: 37b679ec092f186fede6530a2cc039571f07c757bc7f10f55c09ac36a7181e90
3
+ metadata.gz: 5e11590c90c4539c151d8c290f1175a76c331bcd4027832c055158ae11b3e396
4
+ data.tar.gz: 410e1b78ddb8f287b9b4a92b7e583910cccf6474d612b42c4a4933dad0d154b5
5
5
  SHA512:
6
- metadata.gz: a23dc4b82fd253f710ae847f75efb50d83b34dc8cd2aeecdaf57a74b69329a1148ba2dd95db5dadab0400148912cec21f985af92960445c02607af50fbce35a2
7
- data.tar.gz: af15a046cca4048ddf0725c387a00280430fbcb1f8df4ada8c27036aee4d398908783f423c45927622495e242716bc159cb26d97730f7eea48b766f540dfc30f
6
+ metadata.gz: deeb77d21a3be57cb713b1c765b008b502d8c100bb103be99a88b50311c3895d3557f8c2909db1d8334616e223862fd6bf6e0b21c233237ab99698f7d008c466
7
+ data.tar.gz: 594bc21094683131274a3eb254ea9efad95a6d98839d219862bfd38b867aba43fb833ef3c9adb47dce55aa9a089ee16d806e049a356fedb1b5aee177746be8a1
data/README.md CHANGED
@@ -38,4 +38,9 @@ notion_converter = NotionToMd::Converter.new(page_id: 'b91d5...')
38
38
  md = notion_converter.convert
39
39
  ```
40
40
 
41
- And that's all. The `md` is a string variable containing the notion page formatted in markdown.
41
+ And that's all. The `md` is a string variable containing the notion page formatted in markdown.
42
+
43
+ ## Test
44
+ ```bash
45
+ $ ruby -Ilib:test test/notion_to_md/converter_spec.rb
46
+ ```
@@ -21,7 +21,7 @@ module NotionToMd
21
21
 
22
22
  begin
23
23
  send(block_type, block[block_type])
24
- rescue
24
+ rescue StandardError
25
25
  Logger.info("Unsupported block type: #{block_type}")
26
26
  next nil
27
27
  end
@@ -36,7 +36,6 @@ module NotionToMd
36
36
  @page_blocks ||= @notion.block_children(id: page_id)
37
37
  end
38
38
 
39
-
40
39
  def paragraph(block)
41
40
  convert_text(block)
42
41
  end
@@ -148,7 +147,7 @@ module NotionToMd
148
147
  end
149
148
 
150
149
  def add_annotations(text, content)
151
- annotations = text[:annotations].select { |key, value| !!value }
150
+ annotations = text[:annotations].select { |_key, value| !!value }
152
151
  annotations.keys.inject(content) do |enriched_content, annotation|
153
152
  TextAnnotation.send(annotation.to_sym, enriched_content)
154
153
  end
@@ -4,13 +4,11 @@ require 'logger'
4
4
 
5
5
  module NotionToMd
6
6
  class Logger
7
- @logger = ::Logger.new(STDOUT)
7
+ @logger = ::Logger.new($stdout)
8
8
 
9
9
  class << self
10
10
  extend Forwardable
11
- def_delegators :@logger, :debug, :info, :warn, :error, :fatal
11
+ def_delegators :@logger, :debug, :info, :warn, :error, :fatal, :level, :level=
12
12
  end
13
13
  end
14
14
  end
15
-
16
-
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module NotionToMd
2
4
  # Append the text type:
3
5
  # * italic: boolean,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NotionToMd
4
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_to_md
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Enrique Arias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-29 00:00:00.000000000 Z
11
+ date: 2021-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: notion-ruby-client
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Notion Markdown Exporter in Ruby
42
56
  email: emoriarty81@gmail.com
43
57
  executables: []