wovnrb 0.1.0 → 0.1.01
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wovnrb/version.rb +1 -1
- data/lib/wovnrb.rb +6 -4
- data/wovnrb-0.1.0.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e81eed58979e684ec78cc73f02cc030460529674
|
4
|
+
data.tar.gz: b92f26d520f2879fa725c2956d7adfc385612efe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27791cb2dbc5670d6f31fed36a130b3593d477b5fc2a923a2d0a5cf50bd418eba8f90482dfab7f12e6763a67aa3c2650a045e973de49841f627501d82307a713
|
7
|
+
data.tar.gz: 91134317233f017739f83bb4bdcbadacc293d253f146a95a26dc5f59dac21f0d7454a3fdfd77597859ea6e3df2a15b41ced7dec7fb165f16a77e500de2df5085
|
data/lib/wovnrb/version.rb
CHANGED
data/lib/wovnrb.rb
CHANGED
@@ -40,7 +40,7 @@ module Wovnrb
|
|
40
40
|
:host => headers.host,
|
41
41
|
:pathname => headers.pathname
|
42
42
|
}
|
43
|
-
switch_lang(body, values, url, lang) unless status.to_s =~ /^1|302/
|
43
|
+
switch_lang(body, values, url, lang) unless status.to_s =~ /^1|302/
|
44
44
|
#d = Dom.new(storage.get_values, body, lang)
|
45
45
|
end
|
46
46
|
|
@@ -60,7 +60,8 @@ module Wovnrb
|
|
60
60
|
d = Nokogiri::HTML5(b)
|
61
61
|
d.xpath('//text()').each do |node|
|
62
62
|
node_text = node.content.strip
|
63
|
-
|
63
|
+
# shouldn't need size check, but for now...
|
64
|
+
if text_index[node_text] && text_index[node_text][lang] && text_index[node_text][lang].size > 0
|
64
65
|
node.content = node.content.gsub(/^(\s*)[\S\s]*(\s*)$/, '\1' + text_index[node_text][lang][0]['data'] + '\2')
|
65
66
|
end
|
66
67
|
end
|
@@ -80,7 +81,8 @@ module Wovnrb
|
|
80
81
|
end
|
81
82
|
end
|
82
83
|
|
83
|
-
|
84
|
+
# shouldn't need size check, but for now...
|
85
|
+
if src_index[src] && src_index[src][lang] && src_index[src][lang].size > 0
|
84
86
|
node.attribute('src').value = "#{img_src_prefix}#{src_index[src][lang][0]['data']}"
|
85
87
|
end
|
86
88
|
end
|
@@ -104,7 +106,7 @@ module Wovnrb
|
|
104
106
|
# do this so that there will be a closing tag (better compatibility with browsers)
|
105
107
|
insert_node.content = ' '
|
106
108
|
parent_node = d.at_css('head') || d.at_css('body') || d.at_css('html')
|
107
|
-
parent_node.
|
109
|
+
parent_node.children.first.add_previous_sibling(insert_node)
|
108
110
|
|
109
111
|
d.to_html
|
110
112
|
end
|
data/wovnrb-0.1.0.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wovnrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.01
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Sandford
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- test/lib/test_headers.rb
|
246
246
|
- test/lib/test_lang.rb
|
247
247
|
- values/values
|
248
|
+
- wovnrb-0.1.0.gem
|
248
249
|
- wovnrb.gemspec
|
249
250
|
homepage: ''
|
250
251
|
licenses:
|