humans_rb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/humans_rb.gemspec +1 -1
- data/lib/{humans → humans_rb}/parser.rb +0 -0
- data/lib/{humans → humans_rb}/transform.rb +0 -0
- data/lib/humans_rb/version.rb +3 -0
- data/lib/{humans.rb → humans_rb.rb} +6 -6
- data/spec/spec_helper.rb +1 -1
- metadata +6 -6
- data/lib/humans/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31b3837efb29afc20a4f3aa6f39920fc898d3254
|
4
|
+
data.tar.gz: 47a5f07517c293edefb26a7280b50214db3e40e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e801c5cda34580bc115be26192166688840c103805b29912929cea5df0e3d815bdf66c6df8faebfdb6fb891f5376a76efa3ebd751300c3382b56507482e7ed08
|
7
|
+
data.tar.gz: f0dd43a448f032183953f64f051e1ae7e4ffa9c55db698d28273937c92e16b0c24405cf1faeeeea980ec082791336db5c5b3d3227b54186b933b431653db62e7
|
data/humans_rb.gemspec
CHANGED
File without changes
|
File without changes
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require 'typhoeus'
|
2
2
|
require 'parslet'
|
3
|
-
require "
|
4
|
-
require "
|
5
|
-
require "humans/transform"
|
3
|
+
require "humans_rb/parser"
|
4
|
+
require "humans_rb/transform"
|
6
5
|
|
7
6
|
class HumansRb
|
8
7
|
def initialize(url_or_string)
|
@@ -10,11 +9,12 @@ class HumansRb
|
|
10
9
|
end
|
11
10
|
|
12
11
|
def body
|
13
|
-
if @url_or_string =~ /^http/
|
12
|
+
@body ||= if @url_or_string =~ /^http/
|
14
13
|
@url_or_string << "/humans.txt" if !(@url_or_string =~ /humans\.txt$/)
|
15
|
-
@url_or_string = Typhoeus.get(@url_or_string, accept_encoding: "gzip").body
|
14
|
+
@url_or_string = Typhoeus.get(@url_or_string, accept_encoding: "gzip").body.
|
15
|
+
encode('UTF-8', {:invalid => :replace, :undef => :replace, :replace => '?'})
|
16
16
|
else
|
17
|
-
@url_or_string
|
17
|
+
@url_or_string.encode('UTF-8', {:invalid => :replace, :undef => :replace, :replace => '?'})
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: humans_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -122,10 +122,10 @@ files:
|
|
122
122
|
- README.md
|
123
123
|
- Rakefile
|
124
124
|
- humans_rb.gemspec
|
125
|
-
- lib/
|
126
|
-
- lib/
|
127
|
-
- lib/
|
128
|
-
- lib/
|
125
|
+
- lib/humans_rb.rb
|
126
|
+
- lib/humans_rb/parser.rb
|
127
|
+
- lib/humans_rb/transform.rb
|
128
|
+
- lib/humans_rb/version.rb
|
129
129
|
- script/bootstrap
|
130
130
|
- script/cibuild
|
131
131
|
- script/console
|
data/lib/humans/version.rb
DELETED