bkmrq 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/bin/bkmrq +2 -1
- data/lib/bkmrq/app.rb +5 -3
- data/lib/bkmrq/cli.rb +6 -1
- data/lib/bkmrq/manual.rb +2 -2
- data/lib/bkmrq.rb +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9ba71423dbc23a1e716ccf018f1702385feeec95fdde1c4be1dbee34b823ceb
|
4
|
+
data.tar.gz: 2f02147129dff0527f09e0ef1676b57b4ec9ddf6dcc7e19abacec357eb932244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cb16e0d10aa46b6970b4d8e8f18fda14d7591ef514ba55b9a2622d19ec47cc93512936b32dffaebff0879df6c73263073a5b722d2ba7bdfb409ef76e1bc8628
|
7
|
+
data.tar.gz: 44f04e3533b66cbbdced84bc9c3b2bc2d1cfde5ee0ce2e90781ad844fea2a5451a0e710b588fb54619c7ee329ab2c8bd799a122f61008b47342097e1f450f3ed
|
data/bin/bkmrq
CHANGED
data/lib/bkmrq/app.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'json'
|
4
|
+
require 'fileutils'
|
4
5
|
require 'bkmrq/docs_template'
|
5
6
|
require 'bkmrq/browser_config'
|
6
7
|
|
@@ -9,8 +10,9 @@ module Bkmrq
|
|
9
10
|
class App
|
10
11
|
BLOCKLIST = ENV.fetch('BKMRQ_BLOCKLIST', '(pdf|google|file:)').split(',').map(&:strip)
|
11
12
|
|
12
|
-
def initialize(browser: :brave,
|
13
|
-
@bookmarks_input =
|
13
|
+
def initialize(browser: :brave, input_file: nil, output_path: nil, edit: false)
|
14
|
+
@bookmarks_input = input_file || Bkmrq::BROWSER_CONFIG.dig(browser, :bookmark_file_path)
|
15
|
+
@output_path = output_path || FileUtils.pwd
|
14
16
|
end
|
15
17
|
|
16
18
|
def export!
|
@@ -25,7 +27,7 @@ module Bkmrq
|
|
25
27
|
|
26
28
|
def output_file
|
27
29
|
@output_file ||= ::File.open(
|
28
|
-
"bkmrq_export_#{String(Integer(Time.now))[0..-2]}.md",
|
30
|
+
File.join(@output_path, "bkmrq_export_#{String(Integer(Time.now))[0..-2]}.md"),
|
29
31
|
'w+'
|
30
32
|
)
|
31
33
|
end
|
data/lib/bkmrq/cli.rb
CHANGED
@@ -12,6 +12,11 @@ module Bkmrq
|
|
12
12
|
def initialize(args)
|
13
13
|
@opts = {}
|
14
14
|
option_parser.parse!(sanitize_args(args), into: @opts)
|
15
|
+
Bkmrq::App.new(
|
16
|
+
**@opts.slice(
|
17
|
+
Bkmrq::Manual.options_specs.map(&:last)
|
18
|
+
)
|
19
|
+
).export!
|
15
20
|
end
|
16
21
|
|
17
22
|
private
|
@@ -21,7 +26,7 @@ module Bkmrq
|
|
21
26
|
# Option Parsing
|
22
27
|
Bkmrq::Manual.options_specs.map do |option_spec|
|
23
28
|
option_key = option_spec.pop
|
24
|
-
args.on(*option_spec) { |input| @opts
|
29
|
+
args.on(*option_spec) { |input| @opts[option_key] = input }
|
25
30
|
end
|
26
31
|
|
27
32
|
# Manual Printing
|
data/lib/bkmrq/manual.rb
CHANGED
@@ -36,7 +36,7 @@ module Bkmrq
|
|
36
36
|
'--input-file FILE',
|
37
37
|
String,
|
38
38
|
'Bookmarks file generated by your browser. (JSON FORMAT ONLY)',
|
39
|
-
:
|
39
|
+
:input_file
|
40
40
|
]
|
41
41
|
end
|
42
42
|
|
@@ -46,7 +46,7 @@ module Bkmrq
|
|
46
46
|
'--output-file FILE',
|
47
47
|
String,
|
48
48
|
'Filepath for markdown generated by Bkmrq',
|
49
|
-
:
|
49
|
+
:output_path
|
50
50
|
]
|
51
51
|
end
|
52
52
|
|
data/lib/bkmrq.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bkmrq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sreedev Kodichath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Bkmrq Converts Bookmarks stored by your browser in JSON format to a readable
|
14
14
|
markdown format
|
@@ -19,6 +19,7 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- bin/bkmrq
|
22
|
+
- lib/bkmrq.rb
|
22
23
|
- lib/bkmrq/app.rb
|
23
24
|
- lib/bkmrq/browser_config.rb
|
24
25
|
- lib/bkmrq/cli.rb
|