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.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +0 -2
  3. data/Guardfile +2 -2
  4. data/README.md +9 -18
  5. data/color_parser.gemspec +3 -3
  6. data/lib/color_parser.rb +2 -48
  7. data/lib/color_parser/page.rb +14 -57
  8. data/lib/color_parser/stylesheet.rb +27 -116
  9. data/lib/color_parser/version.rb +1 -1
  10. data/spec/fixtures/css_color/stylesheets/color_styles.css +7 -7
  11. data/spec/fixtures/css_color/stylesheets/frequency.css +9 -9
  12. data/spec/page_spec.rb +27 -182
  13. data/spec/stylesheet_spec.rb +43 -153
  14. metadata +31 -126
  15. data/lib/color_parser/color.rb +0 -154
  16. data/lib/color_parser/image.rb +0 -20
  17. data/lib/color_parser/request.rb +0 -21
  18. data/spec/color_parser_spec.rb +0 -88
  19. data/spec/color_spec.rb +0 -10
  20. data/spec/fixtures/css/absolute.html +0 -15
  21. data/spec/fixtures/css/inline.html +0 -34
  22. data/spec/fixtures/css/inline_import.html +0 -16
  23. data/spec/fixtures/css/invalid.html +0 -15
  24. data/spec/fixtures/css/relative.html +0 -15
  25. data/spec/fixtures/css/relative_root.html +0 -15
  26. data/spec/fixtures/css/stylesheets/colors.css +0 -0
  27. data/spec/fixtures/css/stylesheets/fonts.css +0 -0
  28. data/spec/fixtures/css/stylesheets/print.css +0 -3
  29. data/spec/fixtures/css/stylesheets/screen.css +0 -16
  30. data/spec/fixtures/css_images/images/apple.png +0 -0
  31. data/spec/fixtures/css_images/images/cantaloupe.png +0 -0
  32. data/spec/fixtures/css_images/images/kiwi.jpg +0 -0
  33. data/spec/fixtures/css_images/images/mango.png +0 -0
  34. data/spec/fixtures/css_images/images/pineapple.png +0 -0
  35. data/spec/fixtures/css_images/paths.html +0 -14
  36. data/spec/fixtures/css_images/stylesheets/import_paths.css +0 -4
  37. data/spec/fixtures/css_images/stylesheets/paths.css +0 -17
  38. data/spec/fixtures/css_images/stylesheets/quotes.css +0 -14
  39. data/spec/fixtures/css_import/index.html +0 -15
  40. data/spec/fixtures/css_import/stylesheets/borders.css +0 -0
  41. data/spec/fixtures/css_import/stylesheets/colors.css +0 -0
  42. data/spec/fixtures/css_import/stylesheets/fonts.css +0 -3
  43. data/spec/fixtures/css_import/stylesheets/ie.css +0 -3
  44. data/spec/fixtures/css_import/stylesheets/images.css +0 -0
  45. data/spec/fixtures/css_import/stylesheets/master.css +0 -12
  46. data/spec/fixtures/css_import/stylesheets/print.css +0 -3
  47. data/spec/fixtures/css_import/stylesheets/screen.css +0 -12
  48. data/spec/fixtures/inline_images/absolute.html +0 -14
  49. data/spec/fixtures/inline_images/images/apple.png +0 -0
  50. data/spec/fixtures/inline_images/images/kiwi.jpg +0 -0
  51. data/spec/fixtures/inline_images/relative.html +0 -14
  52. data/spec/fixtures/inline_images/relative_root.html +0 -14
  53. data/spec/image_spec.rb +0 -33
  54. 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>
@@ -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
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ColorParser do
4
- describe "#get" do
5
- it "must return results" do
6
- request = Request.new
7
-
8
- # body = request.get("http://google.com")
9
- # expect(body).to include "<html"
10
- end
11
- end
12
- end