color_parser 0.1.0 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +0 -2
- data/Guardfile +2 -2
- data/README.md +9 -18
- data/color_parser.gemspec +3 -3
- data/lib/color_parser.rb +2 -48
- data/lib/color_parser/page.rb +14 -57
- data/lib/color_parser/stylesheet.rb +27 -116
- data/lib/color_parser/version.rb +1 -1
- data/spec/fixtures/css_color/stylesheets/color_styles.css +7 -7
- data/spec/fixtures/css_color/stylesheets/frequency.css +9 -9
- data/spec/page_spec.rb +27 -182
- data/spec/stylesheet_spec.rb +43 -153
- metadata +31 -126
- data/lib/color_parser/color.rb +0 -154
- data/lib/color_parser/image.rb +0 -20
- data/lib/color_parser/request.rb +0 -21
- data/spec/color_parser_spec.rb +0 -88
- data/spec/color_spec.rb +0 -10
- data/spec/fixtures/css/absolute.html +0 -15
- data/spec/fixtures/css/inline.html +0 -34
- data/spec/fixtures/css/inline_import.html +0 -16
- data/spec/fixtures/css/invalid.html +0 -15
- data/spec/fixtures/css/relative.html +0 -15
- data/spec/fixtures/css/relative_root.html +0 -15
- data/spec/fixtures/css/stylesheets/colors.css +0 -0
- data/spec/fixtures/css/stylesheets/fonts.css +0 -0
- data/spec/fixtures/css/stylesheets/print.css +0 -3
- data/spec/fixtures/css/stylesheets/screen.css +0 -16
- data/spec/fixtures/css_images/images/apple.png +0 -0
- data/spec/fixtures/css_images/images/cantaloupe.png +0 -0
- data/spec/fixtures/css_images/images/kiwi.jpg +0 -0
- data/spec/fixtures/css_images/images/mango.png +0 -0
- data/spec/fixtures/css_images/images/pineapple.png +0 -0
- data/spec/fixtures/css_images/paths.html +0 -14
- data/spec/fixtures/css_images/stylesheets/import_paths.css +0 -4
- data/spec/fixtures/css_images/stylesheets/paths.css +0 -17
- data/spec/fixtures/css_images/stylesheets/quotes.css +0 -14
- data/spec/fixtures/css_import/index.html +0 -15
- data/spec/fixtures/css_import/stylesheets/borders.css +0 -0
- data/spec/fixtures/css_import/stylesheets/colors.css +0 -0
- data/spec/fixtures/css_import/stylesheets/fonts.css +0 -3
- data/spec/fixtures/css_import/stylesheets/ie.css +0 -3
- data/spec/fixtures/css_import/stylesheets/images.css +0 -0
- data/spec/fixtures/css_import/stylesheets/master.css +0 -12
- data/spec/fixtures/css_import/stylesheets/print.css +0 -3
- data/spec/fixtures/css_import/stylesheets/screen.css +0 -12
- data/spec/fixtures/inline_images/absolute.html +0 -14
- data/spec/fixtures/inline_images/images/apple.png +0 -0
- data/spec/fixtures/inline_images/images/kiwi.jpg +0 -0
- data/spec/fixtures/inline_images/relative.html +0 -14
- data/spec/fixtures/inline_images/relative_root.html +0 -14
- data/spec/image_spec.rb +0 -33
- data/spec/request_spec.rb +0 -12
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
|
4
|
-
|
5
|
-
<head>
|
6
|
-
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
7
|
-
<title>Color Parser</title>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
<img src="/inline_images/images/apple.png" />
|
11
|
-
<p>Something</p>
|
12
|
-
<img src='/inline_images/images/kiwi.jpg' />
|
13
|
-
</body>
|
14
|
-
</html>
|
data/spec/image_spec.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Image do
|
4
|
-
before(:each) do
|
5
|
-
ColorParser.request = FakeRequest.new
|
6
|
-
end
|
7
|
-
|
8
|
-
describe "" do
|
9
|
-
it "should assign url" do
|
10
|
-
image = ColorParser::Image.new("http://example.com/foo/bar.png")
|
11
|
-
|
12
|
-
expect(image.url).to eq "http://example.com/foo/bar.png"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "" do
|
17
|
-
it "should parse host path and query from url" do
|
18
|
-
image = ColorParser::Image.new("http://example.com/foo/bar.png?baz=bar")
|
19
|
-
|
20
|
-
expect(image.host).to eq "example.com"
|
21
|
-
expect(image.path).to eq "/foo/bar.png"
|
22
|
-
expect(image.query).to eq "baz=bar"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "" do
|
27
|
-
it "should parse name" do
|
28
|
-
image = ColorParser::Image.new("http://example.com/foo/bar.png?baz=bar")
|
29
|
-
|
30
|
-
expect("bar.png").to eq image.name
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/spec/request_spec.rb
DELETED