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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61f0246afc971fcc1a0e23f4d52bcc7eb6308047
4
- data.tar.gz: 7287c6ccc22deaf0fc375f47b56f1e14a6af8c3e
3
+ metadata.gz: e81eed58979e684ec78cc73f02cc030460529674
4
+ data.tar.gz: b92f26d520f2879fa725c2956d7adfc385612efe
5
5
  SHA512:
6
- metadata.gz: 7b9ae3b2c55af426048647b12897a035cb72b9644d96522dfaddcf8514bf42401e892492684fbda754bcdde6828057576ac858f71e4639015dfbaab5951b827d
7
- data.tar.gz: ad3b42dde7eec3635b6560c3d9b4136ba3eda76f146411aa666398adc83f413c1ea04bbb684a1dbd182e566b9ed533be05de251094c929cb7e1d72943e48bbc5
6
+ metadata.gz: 27791cb2dbc5670d6f31fed36a130b3593d477b5fc2a923a2d0a5cf50bd418eba8f90482dfab7f12e6763a67aa3c2650a045e973de49841f627501d82307a713
7
+ data.tar.gz: 91134317233f017739f83bb4bdcbadacc293d253f146a95a26dc5f59dac21f0d7454a3fdfd77597859ea6e3df2a15b41ced7dec7fb165f16a77e500de2df5085
@@ -1,3 +1,3 @@
1
1
  module Wovnrb
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.01"
3
3
  end
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/ || lang === STORE.settings['default_lang']
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
- if text_index[node_text] && text_index[node_text][lang]
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
- if src_index[src] && src_index[src][lang]
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.prepend_child(insert_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.0
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: