hosts_updater 1.0.3 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2eb07e28d3e57d43aafd0040ad133a48af96d9a
4
- data.tar.gz: e9c767da9dfedb5cb372efb3c41c3896dc825f95
3
+ metadata.gz: 59b543501b8a9d722a6d33ce5ae0f9264a1cefa8
4
+ data.tar.gz: 51f4a04d2f38524f0a91d8e5c81f4c0c9cef83dc
5
5
  SHA512:
6
- metadata.gz: af37d143427cfe6b4971f41a816b103360d3d5884c14c572715142ed534d144e53865338888100d654f018a0e220919313fe5bb3e795c442bf5ed92e3af649b4
7
- data.tar.gz: 58a9c208f8e45379014d7e7d75f6ab61c930595f6a42867fb14c2fe91995bed6ced67761ae250abf4de7cf2db84fc753d6e0d01fa11a4b66fa2786c25299135d
6
+ metadata.gz: ae5ffd2eab09f6b5d9b4a444d78cc447ed1c90404e47421d4e1f63f257780f55288a848aac1f5fbf6f523f2f6354c81f0bc7782ebe80e8a2f746add7f1c82dcb
7
+ data.tar.gz: c4836da3eca9e75d8d97f7e64653d52c7fb6ab7139efba7834c3696f9206349ce67facc1b8e5608b4246c944d2b5748b5d24cb5f74330e46073f6d3c8e6790e6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.4
4
+
5
+ - check process uid instead of env var (@ZJvandeWeg)
6
+
3
7
  ## 1.0.3
4
8
 
5
9
  - add `--clear` flag that will remove all fetched records from blacklist
data/README.md CHANGED
@@ -24,10 +24,14 @@ Unique entries from those lists are added together, and results are combined wit
24
24
 
25
25
  ## How is it better than AdBlock/Ghostery etc?
26
26
 
27
- Each browser plugin that blocks ads is using [large amount of resources, hogs browser, and often causes strange errors](http://www.reddit.com/r/programming/comments/25j41u/adblock_pluss_effect_on_firefoxs_memory_usage/chhpomw). In constrast to this, blacklisting domains in `/etc/hosts` only takes couple seconds after file change, and besides that has nearly zero impact on performance. Additionally AdBlock is removing parts of websites very aggresively, often leaving broken layout - it should be less common problem with domain blacklisting.
27
+ Each browser plugin that blocks ads is using [large amount of resources, hogs browser, and often causes strange errors](http://www.reddit.com/r/programming/comments/25j41u/adblock_pluss_effect_on_firefoxs_memory_usage/chhpomw). In constrast to this, blacklisting domains in `/etc/hosts` only takes couple seconds after file change, and besides that has nearly zero impact on performance. Additionally AdBlock is removing parts of websites very aggressively, often leaving broken layout - it should be less common problem with domain blacklisting.
28
28
 
29
29
  On the other hand there is a small amount of ads that are unblockable by domain blacklisting - that are visible from time to time, but probably not often enough to complain ;)
30
30
 
31
+ ### Slow auto complete
32
+
33
+ As a lot of hosts are added to your system, autocomplete might slow down. To solve this in [zsh prezto](https://github.com/sorin-ionescu/prezto) one could replace `cat /etc/hosts (|)(N)` with `sed /0\.0\.0\.0/d`. This prevents the domains to be loaded for completion.
34
+
31
35
  ## How to configure what domains I want whitelisted/blacklisted?
32
36
 
33
37
  During first run `hosts-updater` will create folder in `/etc/hosts.d`, in which it will store all configuration files:
data/lib/hosts_updater.rb CHANGED
@@ -35,7 +35,7 @@ class HostsUpdater
35
35
  # Create required files, update auto file if necessary and generate hosts file.
36
36
  # Need to be ran as root in order to access /etc/hosts
37
37
  def run
38
- unless ENV['USER'] == 'root'
38
+ unless Process.uid == 0
39
39
  logger.error 'Error: Must run as root'
40
40
  exit
41
41
  end
@@ -1,3 +1,3 @@
1
1
  class HostsUpdater
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hosts_updater
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Potocki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hosts
@@ -62,9 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
- rubygems_version: 2.4.5
65
+ rubygems_version: 2.4.5.1
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Update your /etc/hosts with list of unwanted domains
69
69
  test_files: []
70
- has_rdoc: