web-gem 1.0.0
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 +7 -0
- data/lib/web-gem.rb +22 -0
- data/lib/web-gem/libhosts.rb +11 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ae6bb9059a3cf2e6476a90ffbee75687748276c9
|
4
|
+
data.tar.gz: 66dfe91a0926673c44374a5823d9f889b8aa897c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 70dd266c3271d485ab90c917915d9bd6269cc5bd303539faea68c1102878abc1de875b1b6d3096009efa5b3000580530d8bd33a0d8bee58a309e32d31d49eb10
|
7
|
+
data.tar.gz: a4a2fe719047d6862546c20fef2aeae52901d813e64984289e965b75bfc3a43e6cab2bc62def862e42741e5f3e97c3eb2f10dd8168b4ae0ccc44fb02f31e40da
|
data/lib/web-gem.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
puts "Welcome to Web Gem!"
|
2
|
+
puts "Enter a website"
|
3
|
+
website = gets.chomp
|
4
|
+
puts "Would you like to approve or deny?"
|
5
|
+
puts "a -- approve"
|
6
|
+
puts "d -- deny"
|
7
|
+
approve = gets.chomp
|
8
|
+
approve.downcase!
|
9
|
+
case approve
|
10
|
+
when "a"
|
11
|
+
puts "Enter the IP of the website. Use an IP finder service to find (http://www.hcidata.info/host2ip.htm)"
|
12
|
+
ip = gets.chomp
|
13
|
+
WebFilter.approve(website, ip)
|
14
|
+
puts "Approved!"
|
15
|
+
puts "Please consult the README or man page."
|
16
|
+
when "d"
|
17
|
+
WebFilter.deny(website)
|
18
|
+
puts "Denied!"
|
19
|
+
puts "Please consult the README or man page."
|
20
|
+
else
|
21
|
+
puts "Sorry, that wasn't a choice."
|
22
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module WebFilter
|
2
|
+
HOSTS = "/etc/hosts"
|
3
|
+
@hostsFile = File.read(HOSTS)
|
4
|
+
def WebFilter.approve (hostname, ip)
|
5
|
+
File.write(HOSTS, "#{@hostsFile} \n#{ip} #{hostname}")
|
6
|
+
end
|
7
|
+
|
8
|
+
def WebFilter.deny (hostname)
|
9
|
+
File.write(HOSTS, "#{@hostsFile} \n0.0.0.0 #{hostname}")
|
10
|
+
end
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: web-gem
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Joseph G.
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: This is a simple web filtering gem that is easy to use. Note that you
|
14
|
+
must feel comfortable getting your hands dirty in the system to use this.
|
15
|
+
email: geis28@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/web-gem.rb
|
21
|
+
- lib/web-gem/libhosts.rb
|
22
|
+
homepage: http://rubygems.org/gems/web-gem
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.2.2
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: Easy web filtering
|
46
|
+
test_files: []
|