color_parser 0.1.0 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
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
metadata CHANGED
@@ -1,126 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 1.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Derek DeVries
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-02 00:00:00.000000000 Z
11
+ date: 2020-08-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: curb
14
+ name: stylesheet
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '0.8'
19
+ version: 0.1.8
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.8'
26
+ version: 0.1.8
30
27
  - !ruby/object:Gem::Dependency
31
- name: nokogiri
28
+ name: color_conversion
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
- version: '1.5'
33
+ version: 0.1.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
- version: '1.5'
40
+ version: 0.1.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
61
  version: '2.9'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
68
  version: '2.9'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: guard
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - "~>"
84
74
  - !ruby/object:Gem::Version
85
75
  version: '1.7'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - "~>"
92
81
  - !ruby/object:Gem::Version
93
82
  version: '1.7'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: guard-rspec
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ~>
87
+ - - "~>"
100
88
  - !ruby/object:Gem::Version
101
89
  version: '2.5'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ~>
94
+ - - "~>"
108
95
  - !ruby/object:Gem::Version
109
96
  version: '2.5'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rb-fsevent
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ~>
101
+ - - "~>"
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0.9'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ~>
108
+ - - "~>"
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0.9'
126
111
  description: Finds colors on a given webpage
@@ -130,7 +115,7 @@ executables: []
130
115
  extensions: []
131
116
  extra_rdoc_files: []
132
117
  files:
133
- - .gitignore
118
+ - ".gitignore"
134
119
  - Gemfile
135
120
  - Guardfile
136
121
  - LICENSE.txt
@@ -138,57 +123,17 @@ files:
138
123
  - Rakefile
139
124
  - color_parser.gemspec
140
125
  - lib/color_parser.rb
141
- - lib/color_parser/color.rb
142
126
  - lib/color_parser/errors.rb
143
- - lib/color_parser/image.rb
144
127
  - lib/color_parser/page.rb
145
- - lib/color_parser/request.rb
146
128
  - lib/color_parser/stylesheet.rb
147
129
  - lib/color_parser/version.rb
148
- - spec/color_parser_spec.rb
149
- - spec/color_spec.rb
150
- - spec/fixtures/css/absolute.html
151
- - spec/fixtures/css/inline.html
152
- - spec/fixtures/css/inline_import.html
153
- - spec/fixtures/css/invalid.html
154
- - spec/fixtures/css/relative.html
155
- - spec/fixtures/css/relative_root.html
156
- - spec/fixtures/css/stylesheets/colors.css
157
- - spec/fixtures/css/stylesheets/fonts.css
158
- - spec/fixtures/css/stylesheets/print.css
159
- - spec/fixtures/css/stylesheets/screen.css
160
130
  - spec/fixtures/css_color/frequency.html
161
131
  - spec/fixtures/css_color/stylesheets/color_styles.css
162
132
  - spec/fixtures/css_color/stylesheets/css_elements.css
163
133
  - spec/fixtures/css_color/stylesheets/frequency.css
164
134
  - spec/fixtures/css_color/stylesheets/imported_selectors.css
165
135
  - spec/fixtures/css_color/stylesheets/properties.css
166
- - spec/fixtures/css_images/images/apple.png
167
- - spec/fixtures/css_images/images/cantaloupe.png
168
- - spec/fixtures/css_images/images/kiwi.jpg
169
- - spec/fixtures/css_images/images/mango.png
170
- - spec/fixtures/css_images/images/pineapple.png
171
- - spec/fixtures/css_images/paths.html
172
- - spec/fixtures/css_images/stylesheets/import_paths.css
173
- - spec/fixtures/css_images/stylesheets/paths.css
174
- - spec/fixtures/css_images/stylesheets/quotes.css
175
- - spec/fixtures/css_import/index.html
176
- - spec/fixtures/css_import/stylesheets/borders.css
177
- - spec/fixtures/css_import/stylesheets/colors.css
178
- - spec/fixtures/css_import/stylesheets/fonts.css
179
- - spec/fixtures/css_import/stylesheets/ie.css
180
- - spec/fixtures/css_import/stylesheets/images.css
181
- - spec/fixtures/css_import/stylesheets/master.css
182
- - spec/fixtures/css_import/stylesheets/print.css
183
- - spec/fixtures/css_import/stylesheets/screen.css
184
- - spec/fixtures/inline_images/absolute.html
185
- - spec/fixtures/inline_images/images/apple.png
186
- - spec/fixtures/inline_images/images/kiwi.jpg
187
- - spec/fixtures/inline_images/relative.html
188
- - spec/fixtures/inline_images/relative_root.html
189
- - spec/image_spec.rb
190
136
  - spec/page_spec.rb
191
- - spec/request_spec.rb
192
137
  - spec/spec_helper.rb
193
138
  - spec/stubs/fake_request.rb
194
139
  - spec/stylesheet_spec.rb
@@ -196,75 +141,35 @@ files:
196
141
  homepage: https://github.com/devrieda/color_parser
197
142
  licenses:
198
143
  - MIT
199
- post_install_message:
144
+ metadata: {}
145
+ post_install_message:
200
146
  rdoc_options: []
201
147
  require_paths:
202
148
  - lib
203
149
  required_ruby_version: !ruby/object:Gem::Requirement
204
- none: false
205
150
  requirements:
206
- - - ! '>='
151
+ - - ">="
207
152
  - !ruby/object:Gem::Version
208
153
  version: 1.9.3
209
154
  required_rubygems_version: !ruby/object:Gem::Requirement
210
- none: false
211
155
  requirements:
212
- - - ! '>='
156
+ - - ">="
213
157
  - !ruby/object:Gem::Version
214
158
  version: '0'
215
159
  requirements: []
216
- rubyforge_project:
217
- rubygems_version: 1.8.25
218
- signing_key:
219
- specification_version: 3
160
+ rubygems_version: 3.1.2
161
+ signing_key:
162
+ specification_version: 4
220
163
  summary: Finds colors on a given webpage
221
164
  test_files:
222
- - spec/color_parser_spec.rb
223
- - spec/color_spec.rb
224
- - spec/fixtures/css/absolute.html
225
- - spec/fixtures/css/inline.html
226
- - spec/fixtures/css/inline_import.html
227
- - spec/fixtures/css/invalid.html
228
- - spec/fixtures/css/relative.html
229
- - spec/fixtures/css/relative_root.html
230
- - spec/fixtures/css/stylesheets/colors.css
231
- - spec/fixtures/css/stylesheets/fonts.css
232
- - spec/fixtures/css/stylesheets/print.css
233
- - spec/fixtures/css/stylesheets/screen.css
234
165
  - spec/fixtures/css_color/frequency.html
235
166
  - spec/fixtures/css_color/stylesheets/color_styles.css
236
167
  - spec/fixtures/css_color/stylesheets/css_elements.css
237
168
  - spec/fixtures/css_color/stylesheets/frequency.css
238
169
  - spec/fixtures/css_color/stylesheets/imported_selectors.css
239
170
  - spec/fixtures/css_color/stylesheets/properties.css
240
- - spec/fixtures/css_images/images/apple.png
241
- - spec/fixtures/css_images/images/cantaloupe.png
242
- - spec/fixtures/css_images/images/kiwi.jpg
243
- - spec/fixtures/css_images/images/mango.png
244
- - spec/fixtures/css_images/images/pineapple.png
245
- - spec/fixtures/css_images/paths.html
246
- - spec/fixtures/css_images/stylesheets/import_paths.css
247
- - spec/fixtures/css_images/stylesheets/paths.css
248
- - spec/fixtures/css_images/stylesheets/quotes.css
249
- - spec/fixtures/css_import/index.html
250
- - spec/fixtures/css_import/stylesheets/borders.css
251
- - spec/fixtures/css_import/stylesheets/colors.css
252
- - spec/fixtures/css_import/stylesheets/fonts.css
253
- - spec/fixtures/css_import/stylesheets/ie.css
254
- - spec/fixtures/css_import/stylesheets/images.css
255
- - spec/fixtures/css_import/stylesheets/master.css
256
- - spec/fixtures/css_import/stylesheets/print.css
257
- - spec/fixtures/css_import/stylesheets/screen.css
258
- - spec/fixtures/inline_images/absolute.html
259
- - spec/fixtures/inline_images/images/apple.png
260
- - spec/fixtures/inline_images/images/kiwi.jpg
261
- - spec/fixtures/inline_images/relative.html
262
- - spec/fixtures/inline_images/relative_root.html
263
- - spec/image_spec.rb
264
171
  - spec/page_spec.rb
265
- - spec/request_spec.rb
266
172
  - spec/spec_helper.rb
267
173
  - spec/stubs/fake_request.rb
268
174
  - spec/stylesheet_spec.rb
269
175
  - spec/version_spec.rb
270
- has_rdoc:
@@ -1,154 +0,0 @@
1
- module ColorParser
2
- class Color
3
-
4
- def self.text_colors
5
- { black: "000000",
6
- navy: "000080",
7
- darkblue: "00008b",
8
- mediumblue: "0000cd",
9
- blue: "0000ff",
10
- darkgreen: "006400",
11
- green: "008000",
12
- teal: "008080",
13
- darkcyan: "008b8b",
14
- deepskyblue: "00bfff",
15
- darkturquoise: "00ced1",
16
- mediumspringgreen: "00fa9a",
17
- lime: "00ff00",
18
- springgreen: "00ff7f",
19
- aqua: "00ffff",
20
- cyan: "00ffff",
21
- midnightblue: "191970",
22
- dodgerblue: "1e90ff",
23
- lightseagreen: "20b2aa",
24
- forestgreen: "228b22",
25
- seagreen: "2e8b57",
26
- darkslategray: "2f4f4f",
27
- darkslategrey: "2f4f4f",
28
- limegreen: "32cd32",
29
- mediumseagreen: "3cb371",
30
- turquoise: "40e0d0",
31
- royalblue: "4169e1",
32
- steelblue: "4682b4",
33
- darkslateblue: "483d8b",
34
- mediumturquoise: "48d1cc",
35
- indigo: "4b0082",
36
- darkolivegreen: "556b2f",
37
- cadetblue: "5f9ea0",
38
- cornflowerblue: "6495ed",
39
- mediumaquamarine: "66cdaa",
40
- dimgray: "696969",
41
- dimgrey: "696969",
42
- slateblue: "6a5acd",
43
- olivedrab: "6b8e23",
44
- slategray: "708090",
45
- slategrey: "708090",
46
- lightslategray: "778899",
47
- lightslategrey: "778899",
48
- mediumslateblue: "7b68ee",
49
- lawngreen: "7cfc00",
50
- chartreuse: "7fff00",
51
- aquamarine: "7fffd4",
52
- maroon: "800000",
53
- purple: "800080",
54
- olive: "808000",
55
- gray: "808080",
56
- grey: "808080",
57
- skyblue: "87ceeb",
58
- lightskyblue: "87cefa",
59
- blueviolet: "8a2be2",
60
- darkred: "8b0000",
61
- darkmagenta: "8b008b",
62
- saddlebrown: "8b4513",
63
- darkseagreen: "8fbc8f",
64
- lightgreen: "90ee90",
65
- mediumpurple: "9370db",
66
- darkviolet: "9400d3",
67
- palegreen: "98fb98",
68
- darkorchid: "9932cc",
69
- yellowgreen: "9acd32",
70
- sienna: "a0522d",
71
- brown: "a52a2a",
72
- darkgray: "a9a9a9",
73
- darkgrey: "a9a9a9",
74
- lightblue: "add8e6",
75
- greenyellow: "adff2f",
76
- paleturquoise: "afeeee",
77
- lightsteelblue: "b0c4de",
78
- powderblue: "b0e0e6",
79
- firebrick: "b22222",
80
- darkgoldenrod: "b8860b",
81
- mediumorchid: "ba55d3",
82
- rosybrown: "bc8f8f",
83
- darkkhaki: "bdb76b",
84
- silver: "c0c0c0",
85
- mediumvioletred: "c71585",
86
- indianred: "cd5c5c",
87
- peru: "cd853f",
88
- chocolate: "d2691e",
89
- tan: "d2b48c",
90
- lightgray: "d3d3d3",
91
- lightgrey: "d3d3d3",
92
- thistle: "d8bfd8",
93
- orchid: "da70d6",
94
- goldenrod: "daa520",
95
- palevioletred: "db7093",
96
- crimson: "dc143c",
97
- gainsboro: "dcdcdc",
98
- plum: "dda0dd",
99
- burlywood: "deb887",
100
- lightcyan: "e0ffff",
101
- lavender: "e6e6fa",
102
- darksalmon: "e9967a",
103
- violet: "ee82ee",
104
- palegoldenrod: "eee8aa",
105
- lightcoral: "f08080",
106
- khaki: "f0e68c",
107
- aliceblue: "f0f8ff",
108
- honeydew: "f0fff0",
109
- azure: "f0ffff",
110
- sandybrown: "f4a460",
111
- wheat: "f5deb3",
112
- beige: "f5f5dc",
113
- whitesmoke: "f5f5f5",
114
- mintcream: "f5fffa",
115
- ghostwhite: "f8f8ff",
116
- salmon: "fa8072",
117
- antiquewhite: "faebd7",
118
- linen: "faf0e6",
119
- lightgoldenrodyellow: "fafad2",
120
- oldlace: "fdf5e6",
121
- red: "ff0000",
122
- fuchsia: "ff00ff",
123
- magenta: "ff00ff",
124
- deeppink: "ff1493",
125
- orangered: "ff4500",
126
- tomato: "ff6347",
127
- hotpink: "ff69b4",
128
- coral: "ff7f50",
129
- darkorange: "ff8c00",
130
- lightsalmon: "ffa07a",
131
- orange: "ffa500",
132
- lightpink: "ffb6c1",
133
- pink: "ffc0cb",
134
- gold: "ffd700",
135
- peachpuff: "ffdab9",
136
- navajowhite: "ffdead",
137
- moccasin: "ffe4b5",
138
- bisque: "ffe4c4",
139
- mistyrose: "ffe4e1",
140
- blanchedalmond: "ffebcd",
141
- papayawhip: "ffefd5",
142
- lavenderblush: "fff0f5",
143
- seashell: "fff5ee",
144
- cornsilk: "fff8dc",
145
- lemonchiffon: "fffacd",
146
- floralwhite: "fffaf0",
147
- snow: "fffafa",
148
- yellow: "ffff00",
149
- lightyellow: "ffffe0",
150
- ivory: "fffff0",
151
- white: "ffffff" }
152
- end
153
- end
154
- end