bunchcli 1.1.3 → 1.1.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/bunch +6 -1
- data/lib/bunch/bunchCLI.rb +25 -7
- data/lib/bunch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c85d1416d51d972ef7c577b1f143b2b646e9fcd4bb1871253b6ed5f98c5bbb4c
|
4
|
+
data.tar.gz: 5986ff8fdd90521530e7b10c5a151eb0144074fdbed534f869ca03345f8f1988
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d93fa5c16bc0e49dd24ead5c7d33ba786024e115b71c290142afc520118fc99a601de1bb0b35205aa102317a1a9af430f16d379ff803816ebe92c4fef4ad72af
|
7
|
+
data.tar.gz: 24bb5364188045b58253836044a9980ff1e99adb716841c5af206b08074467eb154a7e29484ad7f311528037eb61463711be43dcdcc7a9d873727670d802a057
|
data/CHANGELOG.md
CHANGED
data/bin/bunch
CHANGED
@@ -65,11 +65,16 @@ optparse = OptionParser.new do |opts|
|
|
65
65
|
Process.exit 0
|
66
66
|
end
|
67
67
|
|
68
|
-
opts.on('--show-config', 'Display configuration values') do |opt|
|
68
|
+
opts.on('--show-config', 'Display all configuration values') do |opt|
|
69
69
|
bunch.show_config
|
70
70
|
Process.exit 0
|
71
71
|
end
|
72
72
|
|
73
|
+
opts.on('--show-config-key KEY', 'Display a config value [dir, toggle, method]') do |opt|
|
74
|
+
bunch.show_config(opt)
|
75
|
+
Process.exit 0
|
76
|
+
end
|
77
|
+
|
73
78
|
opts.on('-f', '--force-refresh', 'Force refresh cached preferences') do |opt|
|
74
79
|
bunch.update_cache
|
75
80
|
end
|
data/lib/bunch/bunchCLI.rb
CHANGED
@@ -13,6 +13,14 @@ class Bunch
|
|
13
13
|
get_cache
|
14
14
|
end
|
15
15
|
|
16
|
+
def launch_if_needed
|
17
|
+
pid = `ps ax | grep 'MacOS/Bunch'|grep -v grep`.strip
|
18
|
+
if pid == ""
|
19
|
+
`open -a Bunch`
|
20
|
+
sleep 2
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
16
24
|
def update_cache
|
17
25
|
@bunch_dir = nil
|
18
26
|
@url_method = nil
|
@@ -139,6 +147,7 @@ EOF
|
|
139
147
|
|
140
148
|
|
141
149
|
def open(str)
|
150
|
+
launch_if_needed
|
142
151
|
# get front app
|
143
152
|
front_app = %x{osascript -e 'tell application "System Events" to return name of first application process whose frontmost is true'}.strip
|
144
153
|
bid = bundle_id(front_app)
|
@@ -210,12 +219,21 @@ EOF
|
|
210
219
|
puts output
|
211
220
|
end
|
212
221
|
|
213
|
-
def show_config
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
puts
|
219
|
-
|
222
|
+
def show_config(key=nil)
|
223
|
+
case key
|
224
|
+
when /(folder|dir)/
|
225
|
+
puts bunch_dir
|
226
|
+
when /toggle/
|
227
|
+
puts url_method == 'toggle' ? 'true' : 'false'
|
228
|
+
when /method/
|
229
|
+
puts url_method
|
230
|
+
else
|
231
|
+
puts "Bunches Folder: #{bunch_dir}"
|
232
|
+
puts "Default URL Method: #{url_method}"
|
233
|
+
puts "Cached Bunches"
|
234
|
+
bunches.each {|b|
|
235
|
+
puts " - #{b[:title]}"
|
236
|
+
}
|
237
|
+
end
|
220
238
|
end
|
221
239
|
end
|
data/lib/bunch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunchcli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|