focus.rb 1.1.0 → 1.1.1
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/focus +2 -2
- data/lib/focus/config.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1df428809adafd42b392926175afb6d8b4ba2919b2aa089d55fe92f8a9f6bc4b
|
4
|
+
data.tar.gz: 1c7218d6b73f81b58a6d9ca6dbafaa26b0b5df57d6a464cf23774886cdf5e7e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53c969c851742f456d2fd003e1d738ebf51bac2e1f162c7b351aa7f360659f21b13c702563ae77684848bd5a65ad377ed3fb3649f1ed9e9e9cec9bd9ef972934
|
7
|
+
data.tar.gz: 5893453871608649f0b26bcd84d753acb4768e2d9f256f9f10827bb19d49abe9e45375ea4e37203ad42d1b7f065af3feab4d852b65e13e0fe9dafde24c0341f5
|
data/bin/focus
CHANGED
@@ -24,7 +24,7 @@ Help to focus on your work, block leasure website while you need working, unbloc
|
|
24
24
|
opts.on("-c=PATH", "--config=PATH", "Change the default config path") { |path| config_path = path }
|
25
25
|
|
26
26
|
opts.on("-a=BLOCK", "--add-block-host=BLOCK", "Add a new host to block") { |block| action = :add_block_host; args = [block] }
|
27
|
-
opts.on("
|
27
|
+
opts.on("--delete-block-host=BLOCK", "Delete a host to block") { |block| action = :delete_block_host; args = [block] }
|
28
28
|
|
29
29
|
opts.on("-b", "--block", "Block non-work website") { action = :block }
|
30
30
|
opts.on("-r", "--restore", "Restore non-work website") { action = :restore }
|
@@ -44,7 +44,7 @@ host_file = "/dev/null" if dry
|
|
44
44
|
ACTIONS = {
|
45
45
|
list_block_hosts: lambda { puts config.block_hosts },
|
46
46
|
add_block_host: lambda { config.add_block_host(*args) },
|
47
|
-
delete_block_host: lambda { config.
|
47
|
+
delete_block_host: lambda { config.delete_block_host(*args) },
|
48
48
|
block: lambda { Focus::Host.new(host_file).block!(config) },
|
49
49
|
restore: lambda { Focus::Host.new(host_file).restore!(config) },
|
50
50
|
help: lambda { puts options_parser }
|
data/lib/focus/config.rb
CHANGED
@@ -50,7 +50,7 @@ module Focus
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def delete_block_host(blocks)
|
53
|
-
puts "This operation
|
53
|
+
puts "This operation deletes \"#{blocks}\" to the list of blocked hosts.".yellow
|
54
54
|
puts "This operation does not unblock the hosts. Execute -b to refresh the blocking or -r to reset it.".yellow
|
55
55
|
blocks.split(",").each do |block|
|
56
56
|
data = read
|