wordstress 0.25.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wordstress/site.rb +10 -4
- data/lib/wordstress/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec2d1bdf19fed96cb2415b71df03a5a6e81422bb
|
4
|
+
data.tar.gz: 653958b73a60f4dac746d88d7a3af073ee8eab83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94d66e0a989016ffaac389867c1f214194b713a457eabf5f7e18cea65b5a601f111714ef01b79c488387e44661563e78d583a98fa207613e69b222aae1378118
|
7
|
+
data.tar.gz: 68de0225374d311b219056ecc05b3c8698a29a58000c7286ab27a7e7dd91022aab7d637681a70f951db2a0a7eea2214e1be0d9cf025ee6f876b20ed469d4ee5f
|
data/lib/wordstress/site.rb
CHANGED
@@ -152,12 +152,18 @@ module Wordstress
|
|
152
152
|
end
|
153
153
|
|
154
154
|
private
|
155
|
+
def is_already_detected?(array, name)
|
156
|
+
a = array.detect {|elem| elem[:name] == name }
|
157
|
+
return false if array.empty?
|
158
|
+
return (!a.nil?)
|
159
|
+
end
|
160
|
+
|
155
161
|
def find_plugins_interactive
|
156
162
|
ret = []
|
157
163
|
doc = Nokogiri::HTML(@wordstress_page.body)
|
158
164
|
doc.css('#all_plugin').each do |link|
|
159
165
|
l=link.text.split(',')
|
160
|
-
ret << {:name=>l[2], :version=>l[1], :status=>l[3]}
|
166
|
+
ret << {:name=>l[2], :version=>l[1], :status=>l[3]} unless is_already_detected?(ret, l[2])
|
161
167
|
end
|
162
168
|
$logger.debug ret
|
163
169
|
ret
|
@@ -167,7 +173,7 @@ module Wordstress
|
|
167
173
|
doc = Nokogiri::HTML(@wordstress_page.body)
|
168
174
|
doc.css('#all_theme').each do |link|
|
169
175
|
l=link.text.split(',')
|
170
|
-
ret << {:name=>l[2], :version=>l[1]}
|
176
|
+
ret << {:name=>l[2], :version=>l[1]} unless is_already_detected?(ret, l[2])
|
171
177
|
end
|
172
178
|
$logger.debug ret
|
173
179
|
ret
|
@@ -179,7 +185,7 @@ module Wordstress
|
|
179
185
|
doc.css('link').each do |link|
|
180
186
|
if link.attr('href').include?("wp-content/themes")
|
181
187
|
theme = theme_name(link.attr('href'))
|
182
|
-
ret << {:name=>theme, :version=>""}
|
188
|
+
ret << {:name=>theme, :version=>""} unless is_already_detected?(ret, theme)
|
183
189
|
end
|
184
190
|
end
|
185
191
|
ret
|
@@ -199,7 +205,7 @@ module Wordstress
|
|
199
205
|
if ! link.attr('src').nil?
|
200
206
|
if link.attr('src').include?("wp-content/plugins")
|
201
207
|
plugin = plugin_name(link.attr('src'))
|
202
|
-
ret << {:name=>plugin, :version=>"", :status=>"active"}
|
208
|
+
ret << {:name=>plugin, :version=>"", :status=>"active"} unless is_already_detected?(ret, plugin)
|
203
209
|
end
|
204
210
|
end
|
205
211
|
end
|
data/lib/wordstress/version.rb
CHANGED