geturl 0.4.0 → 0.5.0
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/geturl +10 -6
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f19981b934099e642dcd5e4ccbdb0ae206aa07b296ce0f0bddbd65c05348c43f
|
4
|
+
data.tar.gz: be4975b3e283ae1f0d41b12dd78aab644b08597f4ad0e8db116db915436dbe8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 836883d1772fe8ecfcf8af6bc07408d76a02b897b61ecec43f8843315f68dc457ec5158bc6da902388ec78f14d4978e500b8efdfd697ec5adfca80225408e012
|
7
|
+
data.tar.gz: 1820d0b7fe2b16094292be981c32cf2cda644c34afe5f04b799f46b7c79783de099c3b29be8d94ff7dcd70eb5c1630ef20abbf4aed999df3d497aa852883946d
|
data/bin/geturl
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'cli-parser'
|
4
4
|
require_relative '../lib/geturl'
|
5
5
|
require 'mustache'
|
6
|
+
require 'colorize'
|
6
7
|
|
7
8
|
module GetUrlCli
|
8
9
|
extend self
|
@@ -10,12 +11,13 @@ module GetUrlCli
|
|
10
11
|
# Reads the command line and runs the selected action.
|
11
12
|
def run
|
12
13
|
flags = %w(--save --delete --reload --sources --register --unregister
|
13
|
-
--reload -v --show-all --match-all -a --only-urls -u --color --show-score)
|
14
|
+
--reload -v --show-all --match-all -a --only-urls -u --color -c --show-score)
|
14
15
|
parameters = %w(--format --sources --tags --description --template -n)
|
15
16
|
@arguments, @options = CliParser.parse(flags, parameters)
|
16
17
|
|
17
|
-
@options['--match-all'] = @options['-a']
|
18
|
-
@options['--only-urls'] = @options['-u']
|
18
|
+
@options['--match-all'] = @options['-a'] unless @options.include?('--match-all')
|
19
|
+
@options['--only-urls'] = @options['-u'] unless @options.include?('--only-urls')
|
20
|
+
@options['--color'] = @options['-c'] unless @options.include?('--color')
|
19
21
|
|
20
22
|
if @options.include?('--save')
|
21
23
|
save
|
@@ -46,6 +48,7 @@ module GetUrlCli
|
|
46
48
|
|
47
49
|
geturl --format (json|yaml|mustache) keyword1 keyword2
|
48
50
|
geturl --source [source] keyword1 keyword2
|
51
|
+
geturl --color keyword1 keyword2
|
49
52
|
|
50
53
|
# Local bookmarked urls
|
51
54
|
geturl --save http://www.example.com "Example website" --tags tag1,tag2 --description "This is an example"
|
@@ -195,10 +198,11 @@ module GetUrlCli
|
|
195
198
|
|
196
199
|
# Outputs the given item as text.
|
197
200
|
def output_item(item)
|
198
|
-
|
199
|
-
puts item['
|
201
|
+
String.disable_colorization = !@options['--color']
|
202
|
+
puts item['name'].colorize(:green)
|
203
|
+
puts item['url'].colorize(:light_blue)
|
200
204
|
puts item['description'] unless item['description'].to_s.empty?
|
201
|
-
puts 'Tags: ' + item['tags'].join(', ') unless item['tags'].empty?
|
205
|
+
puts 'Tags: ' + item['tags'].join(', ').colorize(:gray) unless item['tags'].empty?
|
202
206
|
if @options['--show-score']
|
203
207
|
score = item['score']
|
204
208
|
scored_keywords = item['scored_keywords']
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geturl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taco Jan Osinga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.8.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.8.1
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: mustache
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|