hugo-notion 0.1.0.pre.alpha.1 → 0.1.0.pre.alpha.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/bin/huno +35 -0
  3. data/lib/hugo_notion/version.rb +1 -1
  4. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6bd4925e3b3a59530ce6240621fffc48526af50e7437d8fa1c412920a247a72
4
- data.tar.gz: 3ce5c9c0170acaddade872e954566180a4b8bb5d0b29be542ac836e0d8ad6f15
3
+ metadata.gz: 911a882054fd1e8bd0aad7878f6e75948bc0b0a6d9ac3b433147b300e0942498
4
+ data.tar.gz: ab2c4b42f4cd5a10e50b23826cc638c4db1ef001208ad276c37b402f5738cbc8
5
5
  SHA512:
6
- metadata.gz: dbe275da44f5a7bde42180a20e889338935e1c3299c20bfc96860521220f0f394c887201c60bea65427b34ef224696329b49c017aaa1562f0e4994e9e9513f25
7
- data.tar.gz: 87aa5d782b3461a21b95ac0e30a702f6b91fc7dadc7a8c779ce88ad6a07a37e7d408aad6ec02c824a32434539434afc02e21f752b408f7198a19a03a0d9bf4de
6
+ metadata.gz: d549fc486805ea9333bc763503261e60cf814be278d0cca1e047a7f076274564751d78cc6380f75b482db42580aea8a23f457c5e30646492b10b6e21937dcce4
7
+ data.tar.gz: f9b669857c40d138d3e9030094f582e18e93262b482a546333f032eff5c36d1b3383a00b8286d128cca24451254c13680f81ebd1c04b8b6e1aa1933ee4b31789
data/bin/huno ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/hugo_notion/synchronizer'
4
+
5
+ def do_exit
6
+ puts 'Exiting...'
7
+ exit
8
+ end
9
+ Signal.trap("TERM") { do_exit }
10
+ Signal.trap("INT") { do_exit }
11
+
12
+ if !ARGV[0]
13
+ puts "Please provide the URL of the Notion page you'd like to sync as the first argument"
14
+ end
15
+ notion_page_url = ARGV[0]
16
+ notion_page_id = URI(notion_page_url).path.match(/-(?<page_id>.*)\z/)['page_id']
17
+
18
+ destination_dir = Dir.pwd
19
+ if ARGV[1]
20
+ if Pathname.new(ARGV[1]).absolute?
21
+ destination_dir = ARGV[1]
22
+ else
23
+ destination_dir = File.join(Dir.pwd, ARGV[1])
24
+ end
25
+ end
26
+
27
+ loop do
28
+ puts "Syncing posts from Notion..."
29
+ Synchronizer.run(
30
+ notion_page_id: notion_page_id,
31
+ destination_dir: destination_dir
32
+ )
33
+ puts "Done."
34
+ sleep 10
35
+ end
@@ -1,3 +1,3 @@
1
1
  class HugoNotion
2
- VERSION = '0.1.0-alpha.1'
2
+ VERSION = '0.1.0-alpha.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hugo-notion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.alpha.1
4
+ version: 0.1.0.pre.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nisanth Chunduru
@@ -69,11 +69,13 @@ dependencies:
69
69
  description: Write in Notion. Publish with Hugo.
70
70
  email:
71
71
  - nisanth074@gmail.com
72
- executables: []
72
+ executables:
73
+ - huno
73
74
  extensions: []
74
75
  extra_rdoc_files: []
75
76
  files:
76
77
  - README.md
78
+ - bin/huno
77
79
  - lib/hugo_notion/synchronizer.rb
78
80
  - lib/hugo_notion/version.rb
79
81
  homepage: https://github.com/nisanthchunduru/hugo-notion