biased 0.0.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 +7 -0
- data/bin/biased +5 -0
- data/lib/biased/client.rb +22 -0
- data/lib/biased/version.rb +4 -0
- data/lib/biased.rb +2 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4366ba485df95ae97ba2d10981b14bcaaf91d0c9
|
4
|
+
data.tar.gz: 03aaf2f7bbe0c819fa495a93a7e6d2cbcd1a33b3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c9342c0dc3926bf929f1b7a7800e59455d3b09fdf7374f556cc71305f45dd3851edb1e195cad2318b06e5e9ab54cb70b1e11114828e1fd2203ea00bc37685476
|
7
|
+
data.tar.gz: a11137b2dbae905d1098dcd9233f23fe008ab45d4b8f623e40aeb4773692903cf68691d34d5c39cecee875a59740323c245519a8a216606e0905ce4bf7c22c15
|
data/bin/biased
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "httparty"
|
2
|
+
require "wikipedia"
|
3
|
+
|
4
|
+
module Biased
|
5
|
+
# @author Justin Harrison
|
6
|
+
class Client
|
7
|
+
# The potentially biased website's parent organization.
|
8
|
+
attr_reader(:parent)
|
9
|
+
|
10
|
+
# @param [String] domain The potentially biased website's domain.
|
11
|
+
def initialize(domain)
|
12
|
+
@domain = domain
|
13
|
+
@parent = gather_from_wikipedia
|
14
|
+
end
|
15
|
+
|
16
|
+
def gather_from_wikipedia
|
17
|
+
content = Wikipedia.find(@domain).content
|
18
|
+
/parent\s*=\s\[\[([A-Z])\w+/.match(content).to_s.split("[[")[1]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
data/lib/biased.rb
ADDED
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: biased
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Harrison
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.13'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.13'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: wikipedia-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
description:
|
42
|
+
email: justin@matthin.com
|
43
|
+
executables:
|
44
|
+
- biased
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- bin/biased
|
49
|
+
- lib/biased.rb
|
50
|
+
- lib/biased/client.rb
|
51
|
+
- lib/biased/version.rb
|
52
|
+
homepage: https://github.com/matthin/biased
|
53
|
+
licenses:
|
54
|
+
- MIT
|
55
|
+
metadata: {}
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
requirements: []
|
71
|
+
rubyforge_project:
|
72
|
+
rubygems_version: 2.4.5
|
73
|
+
signing_key:
|
74
|
+
specification_version: 4
|
75
|
+
summary: Provides the parent organization of any website, if possible.
|
76
|
+
test_files: []
|