blockr 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -1
- data/README.md +11 -4
- data/lib/blockr/manager.rb +1 -1
- data/lib/blockr/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: 249e6df4f8bb2cda72b5e6af4ca28456ba51f074561976f0455f80797a6b0fb7
|
4
|
+
data.tar.gz: fe29efc0ee97f36cb3cb45da93da977e0743b8cadf34f7a0d48ea84e441d8a01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7b0780ad2ba0350bec6155b48d11b3b450a36cb5c2c6f56ec0a2c6163d9430c496404cfd69411dee0a122f78cfc2b714737fa1db32967623c06918bab9f2e9
|
7
|
+
data.tar.gz: ded14e00605b0547c009209d04227172427c47586b760a6b7215563803f5415800872eba1171d411553db6b9b627913176e60379ec55105617787156b75603c9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# blockr
|
2
2
|
|
3
|
-
|
3
|
+
blockr is a command line tool to help you easily block websites, and unblock them when you need them. It modifies /etc/hosts file and add appropriate configuration.
|
4
4
|
|
5
|
-
In today’s world though it is difficult to
|
5
|
+
In today’s world though it is difficult to permanently block websites because they are quite useful too. And hence, blockr lets you activate and deactivate focus mode, so that you are able to access blocked websites when you are relaxing.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
You can install blockr using following command
|
@@ -13,7 +13,8 @@ You can install blockr using following command
|
|
13
13
|
### block (shortcut b or -b)
|
14
14
|
Use this command to block any website you want. It can take one or more websites as input, just separate them by space.
|
15
15
|
Please take care to add the exact website URL you want to block - a few websites add www as a subdomain and to block them you will have to add that to in the name of the website.
|
16
|
-
|
16
|
+
|
17
|
+
**examples**
|
17
18
|
```
|
18
19
|
$ # block youtube
|
19
20
|
$ sudo blockr block www.youtube.com
|
@@ -32,6 +33,8 @@ $ sudo blockr -b www.facebook.com m.facebook.com
|
|
32
33
|
Use this command to unblock any website you have previously blocked using blockr. It can take one or more space separated websites as input.
|
33
34
|
|
34
35
|
It is a safe command, and does not return error if website was not blocked.
|
36
|
+
|
37
|
+
**examples**
|
35
38
|
```
|
36
39
|
$ # unblock youtube
|
37
40
|
$ sudo blockr unblock www.youtube.com
|
@@ -49,6 +52,7 @@ $ sudo blockr -u www.facebook.com m.facebook.com
|
|
49
52
|
### activate (shortcut a or -a)
|
50
53
|
Use this command to activate focus mode. This is a sort of shortcut to block all the websites you have added to blockr and remove all the distracting websites.
|
51
54
|
|
55
|
+
**examples**
|
52
56
|
```
|
53
57
|
$ # activate focus mode
|
54
58
|
$ sudo blockr -activate
|
@@ -60,6 +64,7 @@ $ sudo blockr -a
|
|
60
64
|
### deactivate (shortcut d or -d)
|
61
65
|
Use this command to deactivate focus mode. This unblocks all the websites you have added to blockr.
|
62
66
|
|
67
|
+
**examples**
|
63
68
|
```
|
64
69
|
$ # deactivate focus mode
|
65
70
|
$ sudo blockr deactivate
|
@@ -71,6 +76,7 @@ $ sudo blockr -d
|
|
71
76
|
### help (or -h)
|
72
77
|
Use this command to know more about blockr commands. You can also use this command with other commands to get command specific help.
|
73
78
|
|
79
|
+
**examples**
|
74
80
|
```
|
75
81
|
$ # see all blockr commands
|
76
82
|
$ sudo blockr help
|
@@ -82,6 +88,7 @@ $ sudo blockr activate -h
|
|
82
88
|
###### Please Note
|
83
89
|
* Given we are modifying /etc/hosts file, you will have to run blockr as an administrator or as a root user.
|
84
90
|
* blockr also uses special markers to identify changes done by it, so please don’t manually update entries added by blockr, use blockr commands instead
|
91
|
+
* blockr at the moment clears DNS cache for Apple's OSX systems. Please see [this link](http://www.abhinav.co/clear-dns-cache.html) to find out command specific to your platform.
|
85
92
|
|
86
93
|
### TODO
|
87
94
|
* Write tests
|
@@ -103,7 +110,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/abhina
|
|
103
110
|
|
104
111
|
## Code of Conduct
|
105
112
|
|
106
|
-
Everyone interacting in the
|
113
|
+
Everyone interacting in the blockr project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/blockr/blob/master/CODE_OF_CONDUCT.md).
|
107
114
|
|
108
115
|
## Copyright
|
109
116
|
|
data/lib/blockr/manager.rb
CHANGED
@@ -155,7 +155,7 @@ module Blockr
|
|
155
155
|
$stdout.puts "Clearing DNS cache"
|
156
156
|
|
157
157
|
# XXX mac specific
|
158
|
-
out, _ = cmd.run("sudo
|
158
|
+
out, _ = cmd.run("sudo killall -HUP mDNSResponder", only_output_on_error: true)
|
159
159
|
$stdout.puts out
|
160
160
|
rescue
|
161
161
|
$stderr.puts "Couldn't clear the cache, please clear cache manually."
|
data/lib/blockr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blockr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abhinav Saxena
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|