web_stat 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/web_stat.rb +1 -0
- data/lib/web_stat/config/web_stat.yml +1 -0
- data/lib/web_stat/configure.rb +2 -2
- data/lib/web_stat/fetch.rb +1 -1
- data/lib/web_stat/version.rb +1 -1
- data/spec/web_stat/configure_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6272119868a8870fda3ab8c33fee1238c5a8ca6c0859ce96f77e127c097cd2a8
|
4
|
+
data.tar.gz: a54ba5ce70af23594694cf6d8585391b6632b75ff4f6ee9f3067c987146b4752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61fbcb05d550f7363c14da7cb951fcf282dc500485cc8be82467a3c991dfce86822c7670a0d0a06ba45caf1718a37492b0830394dea444d9d6d339787c912956
|
7
|
+
data.tar.gz: aaef967c6dbfe7883154fcca87e2f0a1f8f12fc12ee42a6c232d65283850f3948d7cc58a0f974bc60572da6fa164b85c8aee571690450fd59ae88481372ecd7b
|
data/lib/web_stat.rb
CHANGED
data/lib/web_stat/configure.rb
CHANGED
@@ -7,9 +7,9 @@ module WebStat
|
|
7
7
|
# Get yaml
|
8
8
|
def get
|
9
9
|
if defined? Rails
|
10
|
-
YAML.
|
10
|
+
YAML.load(ERB.new(File.read(get_configure_path)).result)[Rails.env]
|
11
11
|
else
|
12
|
-
YAML.
|
12
|
+
YAML.load(ERB.new(File.read(get_configure_path)).result)[ENV["ENV"] || "production"]
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
data/lib/web_stat/fetch.rb
CHANGED
@@ -34,7 +34,7 @@ module WebStat
|
|
34
34
|
end
|
35
35
|
# Get main section
|
36
36
|
def content
|
37
|
-
if @url
|
37
|
+
if @url&.match(WebStat::Configure.get["id_extraction_regexs"]["youtube"])
|
38
38
|
youtube_decscription
|
39
39
|
else
|
40
40
|
Sanitize.clean(Readability::Document.new(@nokogiri.at('body').to_s).content)
|
data/lib/web_stat/version.rb
CHANGED