overpath 0.0.3 → 0.0.4
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 +5 -5
- data/bin/overpath +5 -2
- data/lib/overpath/path_table.rb +5 -3
- metadata +6 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 7701400b7e111921fcecd7a63af95cf328bdedbb103183c290cf03965d20d0a6
|
|
4
|
+
data.tar.gz: 06c1ce63231fbafd88c84aed4bc34e68a3080e6ae5b0ed5aa445d6bd264d6559
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5cadc134f69d52ac690a9409722b395a1a9b5386def1fa8a6f0dcb1971e3ae11350c2408b7ca9bb78a0d0ba45ea364a7c1160a8ed14382d317a7bd50fc66744
|
|
7
|
+
data.tar.gz: 30d77e8425f82587163179f7e6d0e87b6583bfad3a5f0b5aac01a70c7635141782f1cddd7a1c3636acf45d4a5eb2c36504aad99a0e4a8d798cde1fb5a9e07df5
|
data/bin/overpath
CHANGED
|
@@ -7,7 +7,7 @@ program_desc 'Valhalla awaits!'
|
|
|
7
7
|
program_long_desc 'Find your path before Ragnarök comes!'
|
|
8
8
|
default_command 'help'
|
|
9
9
|
hide_commands_without_desc true
|
|
10
|
-
version '0.0.
|
|
10
|
+
version '0.0.4'
|
|
11
11
|
sort_help :manually
|
|
12
12
|
accept(File) do |string|
|
|
13
13
|
File.path(string)
|
|
@@ -35,12 +35,15 @@ desc 'Set one path with one key'
|
|
|
35
35
|
arg 'key'
|
|
36
36
|
arg 'path', :optional
|
|
37
37
|
command :add do |c|
|
|
38
|
+
c.desc 'Don\'t escape the path'
|
|
39
|
+
c.switch [:E]
|
|
38
40
|
c.desc 'Set favorite path'
|
|
39
41
|
c.switch %i[f favorite]
|
|
40
42
|
c.action do |_global_options, options, args|
|
|
41
43
|
key = args[0]
|
|
42
44
|
if key
|
|
43
|
-
value =
|
|
45
|
+
value = args[1] ? args[1] : Dir.pwd
|
|
46
|
+
value = File.expand_path(value) unless options[:E]
|
|
44
47
|
@table.table[key] = value
|
|
45
48
|
puts PathPrinter.str([key, value])
|
|
46
49
|
@table.favorite = key if options[:f]
|
data/lib/overpath/path_table.rb
CHANGED
|
@@ -20,9 +20,11 @@ class PathTable
|
|
|
20
20
|
favorite = { PATHTABLE_FAVORITE_KEY => @favorite }
|
|
21
21
|
table = @favorite ? @table.merge(favorite) : @table
|
|
22
22
|
file.puts JSON.generate(table)
|
|
23
|
-
File.
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
if File.exist?(@file_path)
|
|
24
|
+
File.foreach(@file_path).with_index do |line, i|
|
|
25
|
+
break if i > (@history_limit - 1)
|
|
26
|
+
file.puts line
|
|
27
|
+
end
|
|
26
28
|
end
|
|
27
29
|
end
|
|
28
30
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: overpath
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fang Qiuming
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-11-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gli
|
|
@@ -55,7 +55,7 @@ homepage: http://rubygems.org/gems/overpath
|
|
|
55
55
|
licenses:
|
|
56
56
|
- MIT
|
|
57
57
|
metadata: {}
|
|
58
|
-
post_install_message:
|
|
58
|
+
post_install_message:
|
|
59
59
|
rdoc_options: []
|
|
60
60
|
require_paths:
|
|
61
61
|
- lib
|
|
@@ -70,9 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
70
70
|
- !ruby/object:Gem::Version
|
|
71
71
|
version: '0'
|
|
72
72
|
requirements: []
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
signing_key:
|
|
73
|
+
rubygems_version: 3.1.2
|
|
74
|
+
signing_key:
|
|
76
75
|
specification_version: 4
|
|
77
76
|
summary: Drive in Shell like a Pro
|
|
78
77
|
test_files: []
|