juice_extractor 0.0.0.3 → 0.0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/juice_extractor.rb +2 -2
- data/lib/juice_extractor/version.rb +1 -1
- metadata +3 -3
data/lib/juice_extractor.rb
CHANGED
@@ -13,7 +13,7 @@ module ColorExtractor
|
|
13
13
|
image_path = Base.screenshot(site_url)
|
14
14
|
img = Magick::ImageList.new(image_path)
|
15
15
|
img = img.quantize(quantize) if quantize
|
16
|
-
img.color_histogram.map{|pixel| pixel.first.to_color(Magick::AllCompliance, false, 8, true) }
|
16
|
+
img.color_histogram.map{|pixel| pixel.first.to_color(Magick::AllCompliance, false, 8, true) }
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.explicit_colors(site_url, attributes = ['background-color', "border-color", 'color'], quantize = nil)
|
@@ -21,7 +21,7 @@ module ColorExtractor
|
|
21
21
|
phantom_script = File.expand_path(File.dirname(__FILE__) + "/juice_extractor/js/styles.phantom.js")
|
22
22
|
val = `phantomjs #{phantom_script} #{site_url} #{ File.dirname(__FILE__) } '#{attributes.to_json}'`
|
23
23
|
colors= Base.build_explicit_colors(val, attributes, quantize)
|
24
|
-
colors
|
24
|
+
colors
|
25
25
|
end
|
26
26
|
|
27
27
|
module Base
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juice_extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 71
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.0.0.
|
10
|
+
- 4
|
11
|
+
version: 0.0.0.4
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Adrian Castillo
|