applied_css 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +53 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +81 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +9 -0
- data/Rakefile +1 -0
- data/applied_css.gemspec +30 -0
- data/lib/applied_css.rb +151 -0
- data/lib/applied_css/version.rb +3 -0
- data/samples/imported.css +1 -0
- data/samples/sample.html +17 -0
- data/samples/sample1.css +8 -0
- data/samples/sample2.css +5 -0
- data/spec/applied_css/applied_css_spec.rb +121 -0
- data/spec/samples/imported.css +1 -0
- data/spec/samples/sample.html +17 -0
- data/spec/samples/sample1.css +9 -0
- data/spec/samples/sample2.css +5 -0
- data/spec/spec_helper.rb +12 -0
- data/spec_helper.rb +12 -0
- metadata +161 -0
data/.gitignore
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
|
4
|
+
# rdoc generated
|
5
|
+
rdoc
|
6
|
+
|
7
|
+
# yard generated
|
8
|
+
doc
|
9
|
+
.yardoc
|
10
|
+
|
11
|
+
# bundler
|
12
|
+
.bundle
|
13
|
+
|
14
|
+
# jeweler generated
|
15
|
+
pkg
|
16
|
+
|
17
|
+
|
18
|
+
.redcar
|
19
|
+
|
20
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
21
|
+
#
|
22
|
+
# * Create a file at ~/.gitignore
|
23
|
+
# * Include files you want ignored
|
24
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
25
|
+
#
|
26
|
+
# After doing this, these files will be ignored in all your git projects,
|
27
|
+
# saving you from having to 'pollute' every project you touch with them
|
28
|
+
#
|
29
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
30
|
+
#
|
31
|
+
# For MacOS:
|
32
|
+
#
|
33
|
+
#.DS_Store
|
34
|
+
|
35
|
+
# For TextMate
|
36
|
+
#*.tmproj
|
37
|
+
#tmtags
|
38
|
+
|
39
|
+
# For emacs:
|
40
|
+
#*~
|
41
|
+
#\#*
|
42
|
+
#.\#*
|
43
|
+
|
44
|
+
# For vim:
|
45
|
+
#*.swp
|
46
|
+
|
47
|
+
# For redcar:
|
48
|
+
#.redcar
|
49
|
+
|
50
|
+
# For rubinius:
|
51
|
+
#*.rbc
|
52
|
+
#
|
53
|
+
|
data/.rspec
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.2@applied_css
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
applied_css (0.0.1)
|
5
|
+
addressable
|
6
|
+
awesome_print
|
7
|
+
bundler
|
8
|
+
cobweb
|
9
|
+
css_parser
|
10
|
+
fakeweb
|
11
|
+
nokogiri
|
12
|
+
rspec
|
13
|
+
|
14
|
+
GEM
|
15
|
+
remote: http://rubygems.org/
|
16
|
+
specs:
|
17
|
+
addressable (2.3.2)
|
18
|
+
awesome_print (1.1.0)
|
19
|
+
cobweb (1.0.1)
|
20
|
+
addressable
|
21
|
+
awesome_print
|
22
|
+
haml
|
23
|
+
json
|
24
|
+
namespaced_redis (>= 1.0.2)
|
25
|
+
nokogiri
|
26
|
+
redis
|
27
|
+
resque
|
28
|
+
rspec
|
29
|
+
sinatra
|
30
|
+
thin
|
31
|
+
css_parser (1.2.6)
|
32
|
+
addressable
|
33
|
+
rdoc
|
34
|
+
daemons (1.1.9)
|
35
|
+
diff-lcs (1.1.3)
|
36
|
+
eventmachine (1.0.0)
|
37
|
+
fakeweb (1.3.0)
|
38
|
+
haml (3.1.7)
|
39
|
+
json (1.7.5)
|
40
|
+
multi_json (1.5.0)
|
41
|
+
namespaced_redis (1.0.4)
|
42
|
+
redis
|
43
|
+
nokogiri (1.5.6)
|
44
|
+
rack (1.4.1)
|
45
|
+
rack-protection (1.3.2)
|
46
|
+
rack
|
47
|
+
rdoc (3.12)
|
48
|
+
json (~> 1.4)
|
49
|
+
redis (3.0.2)
|
50
|
+
redis-namespace (1.2.1)
|
51
|
+
redis (~> 3.0.0)
|
52
|
+
resque (1.23.0)
|
53
|
+
multi_json (~> 1.0)
|
54
|
+
redis-namespace (~> 1.0)
|
55
|
+
sinatra (>= 0.9.2)
|
56
|
+
vegas (~> 0.1.2)
|
57
|
+
rspec (2.12.0)
|
58
|
+
rspec-core (~> 2.12.0)
|
59
|
+
rspec-expectations (~> 2.12.0)
|
60
|
+
rspec-mocks (~> 2.12.0)
|
61
|
+
rspec-core (2.12.2)
|
62
|
+
rspec-expectations (2.12.1)
|
63
|
+
diff-lcs (~> 1.1.3)
|
64
|
+
rspec-mocks (2.12.1)
|
65
|
+
sinatra (1.3.3)
|
66
|
+
rack (~> 1.3, >= 1.3.6)
|
67
|
+
rack-protection (~> 1.2)
|
68
|
+
tilt (~> 1.3, >= 1.3.3)
|
69
|
+
thin (1.5.0)
|
70
|
+
daemons (>= 1.0.9)
|
71
|
+
eventmachine (>= 0.12.6)
|
72
|
+
rack (>= 1.0.0)
|
73
|
+
tilt (1.3.3)
|
74
|
+
vegas (0.1.11)
|
75
|
+
rack (>= 1.0.0)
|
76
|
+
|
77
|
+
PLATFORMS
|
78
|
+
ruby
|
79
|
+
|
80
|
+
DEPENDENCIES
|
81
|
+
applied_css!
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Stewart McKee
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/applied_css.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "applied_css/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "applied_css"
|
7
|
+
s.version = AppliedCss::VERSION
|
8
|
+
s.authors = ["Stewart McKee"]
|
9
|
+
s.email = ["stewart@theizone.co.uk"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = "CSS and Script extraction tool for html documents"
|
12
|
+
s.description = "Gem for interrogating CSS and Script elements of a html document"
|
13
|
+
|
14
|
+
s.rubyforge_project = "applied_css"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
s.add_dependency "rspec"
|
23
|
+
s.add_dependency "bundler"
|
24
|
+
s.add_dependency "nokogiri"
|
25
|
+
s.add_dependency "css_parser"
|
26
|
+
s.add_dependency "fakeweb"
|
27
|
+
s.add_dependency "awesome_print"
|
28
|
+
s.add_dependency "addressable"
|
29
|
+
s.add_dependency "cobweb"
|
30
|
+
end
|
data/lib/applied_css.rb
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
|
2
|
+
require "nokogiri"
|
3
|
+
require "awesome_print"
|
4
|
+
require "css_parser"
|
5
|
+
require "cobweb"
|
6
|
+
|
7
|
+
class AppliedCSS
|
8
|
+
|
9
|
+
@@MAX_ATTEMPTS = 3
|
10
|
+
|
11
|
+
def initialize(options = {})
|
12
|
+
@options = {:ancestors => false}.merge(options)
|
13
|
+
@options[:cache] = 120 unless @options.has_key? :cache
|
14
|
+
@options[:cache_type] = :full unless @options.has_key? :cache_type
|
15
|
+
|
16
|
+
@base_uri = Addressable::URI.parse(@options[:url])
|
17
|
+
raise "url must be specified" unless @base_uri
|
18
|
+
|
19
|
+
@doc = @options[:document]
|
20
|
+
|
21
|
+
unless @doc
|
22
|
+
html = get(@base_uri.to_s)
|
23
|
+
@doc = Nokogiri::HTML.parse(html) unless html.nil?
|
24
|
+
end
|
25
|
+
|
26
|
+
@parser = CssParser::Parser.new
|
27
|
+
styles.each do |uri, style|
|
28
|
+
@parser.add_block! style
|
29
|
+
end
|
30
|
+
@doc.css("style").each do |style_node|
|
31
|
+
@parser.add_block! style_node.text()
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def css(path)
|
36
|
+
css_declarations = {}
|
37
|
+
ancestors_and_self(path).each do |node|
|
38
|
+
css_declarations.merge!(node_declarations(node))
|
39
|
+
end
|
40
|
+
css_declarations
|
41
|
+
end
|
42
|
+
|
43
|
+
def doc
|
44
|
+
@doc
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_s
|
48
|
+
@parser.to_s
|
49
|
+
end
|
50
|
+
|
51
|
+
def styles
|
52
|
+
populate_style_hash if @style_hash.nil?
|
53
|
+
@style_hash
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
def populate_style_hash
|
58
|
+
@style_hash = {}
|
59
|
+
@doc.css("link[rel='stylesheet']").each do |link|
|
60
|
+
uri = @base_uri.join(link["href"]).to_s
|
61
|
+
get_style(uri)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def get_style(uri)
|
66
|
+
unless @style_hash.has_key?(uri)
|
67
|
+
begin
|
68
|
+
@style_hash[uri] = get(uri)
|
69
|
+
rescue => e
|
70
|
+
puts "Error: #{e.message}"
|
71
|
+
end
|
72
|
+
process_imports(uri)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def process_imports(uri)
|
77
|
+
if @style_hash[uri] =~ /@import (url\()?[\s'"]*([^"'\)]*?)[\s'"\)]*$/
|
78
|
+
url = Addressable::URI.parse(uri).join($2)
|
79
|
+
get_style(url)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def node_declarations(node)
|
84
|
+
declarations = {}
|
85
|
+
node_identifications(node).each do |node_path|
|
86
|
+
@parser.find_by_selector(node_path).each do |detected_decs|
|
87
|
+
detected_decs.split(";").map{|detected_dec| declarations[detected_dec.split(":")[0].strip.to_sym] = detected_dec.split(":")[1].strip}
|
88
|
+
end
|
89
|
+
end
|
90
|
+
declarations
|
91
|
+
end
|
92
|
+
def node_identifications(node)
|
93
|
+
|
94
|
+
# need to create a class for these and add a specificity to order based on priority
|
95
|
+
|
96
|
+
# puts "\033[31m WARNING - specificity has not been applied yet.\033[0m"
|
97
|
+
|
98
|
+
identifications = []
|
99
|
+
identifications << node.name
|
100
|
+
|
101
|
+
unless node["id"].nil?
|
102
|
+
identifications << "##{node["id"]}"
|
103
|
+
end
|
104
|
+
|
105
|
+
unless node["class"].nil?
|
106
|
+
node["class"].split(" ").map{|css_class| identifications << ".#{css_class}"}
|
107
|
+
end
|
108
|
+
identifications
|
109
|
+
end
|
110
|
+
def ancestors_and_self(path)
|
111
|
+
nodes = []
|
112
|
+
node = @doc.at(path)
|
113
|
+
if @options[:ancestors]
|
114
|
+
nodes += node.ancestors[0..-2].reverse
|
115
|
+
end
|
116
|
+
nodes << node
|
117
|
+
nodes
|
118
|
+
end
|
119
|
+
|
120
|
+
def get(url)
|
121
|
+
|
122
|
+
response = Cobweb.new(@options).get(url)
|
123
|
+
raise "The style #{url} doesen't exist (404)" if response[:status_code].to_i == 404
|
124
|
+
return response[:body]
|
125
|
+
|
126
|
+
found = false
|
127
|
+
attempts = 0
|
128
|
+
@url = url
|
129
|
+
uri = URI.parse(url)
|
130
|
+
until( found || attempts>=@@MAX_ATTEMPTS)
|
131
|
+
uri.path = "/" if uri.path.empty?
|
132
|
+
path = "#{uri.path}"
|
133
|
+
path += "?#{uri.query}" unless uri.query.nil?
|
134
|
+
request = Net::HTTP::Get.new(path, @http_options)
|
135
|
+
response = Net::HTTP.start(uri.host, uri.port) {|http|
|
136
|
+
http.request(request)
|
137
|
+
}
|
138
|
+
if response.code.to_i.between? 300, 399
|
139
|
+
puts "redirecting to #{response["location"]}"
|
140
|
+
uri = uri.merge(response["location"])
|
141
|
+
elsif response.code.to_i == 404
|
142
|
+
raise "The style #{url} doesen't exist (404)"
|
143
|
+
elsif response.code.to_i.between? 400, 599
|
144
|
+
raise "Error retrieving #{url} code #{response.code}"
|
145
|
+
end
|
146
|
+
found = true if response.code == "200"
|
147
|
+
attempts += 1
|
148
|
+
end
|
149
|
+
response.body
|
150
|
+
end
|
151
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
#from-imported {color: green;}
|
data/samples/sample.html
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Sample Document for testing CSS</title>
|
5
|
+
<link rel="stylesheet" href="/home/smckee/code/applied_css/spec/samples/sample1.css" type="text/css" media=screen>
|
6
|
+
<link rel="stylesheet" href="/home/smckee/code/applied_css/spec/samples/sample2.css" type="text/css" media=screen>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="container">
|
10
|
+
<span class="red title">
|
11
|
+
This is a RED TITLE
|
12
|
+
</span>
|
13
|
+
</div>
|
14
|
+
<div id="from-imported">
|
15
|
+
</div>
|
16
|
+
</body>
|
17
|
+
</html>
|
data/samples/sample1.css
ADDED
data/samples/sample2.css
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe AppliedCSS do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
FakeWeb.register_uri(:get, "http://local.test.net/sample.html", :body => open(File.expand_path(File.dirname(__FILE__) + '/../samples/sample.html')).read, :content_type => "text/html")
|
7
|
+
FakeWeb.register_uri(:get, "http://local.test.net/css/sample1.css", :body => open(File.expand_path(File.dirname(__FILE__) + '/../samples/sample1.css')).read, :content_type => "text/css")
|
8
|
+
FakeWeb.register_uri(:get, "http://local.test.net/css/sample2.css", :body => open(File.expand_path(File.dirname(__FILE__) + '/../samples/sample2.css')).read, :content_type => "text/css")
|
9
|
+
FakeWeb.register_uri(:get, "http://local.test.net/css/imported.css", :body => open(File.expand_path(File.dirname(__FILE__) + '/../samples/imported.css')).read, :content_type => "text/css")
|
10
|
+
end
|
11
|
+
|
12
|
+
before(:each) do
|
13
|
+
path = File.expand_path(File.dirname(__FILE__) + '/..')
|
14
|
+
@sample_html = [path, "samples/sample.html"].join("/")
|
15
|
+
@sample_html = "http://local.test.net/sample.html"
|
16
|
+
end
|
17
|
+
|
18
|
+
# describe "with bbc homepage" do
|
19
|
+
# before(:each) do
|
20
|
+
# @applied_css = AppliedCSS.new("http://www.bbc.co.uk/")
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# it "should load successfully" do
|
24
|
+
# @applied_css.css("html").should be_an_instance_of Hash
|
25
|
+
# end
|
26
|
+
# it "should determine css declarations" do
|
27
|
+
# @applied_css.css("#blq-container").should == {
|
28
|
+
#
|
29
|
+
# :position => "relative",
|
30
|
+
# :"padding-bottom" => "10px",
|
31
|
+
# :background => "url(../img/body_bg.gif) center repeat-y",
|
32
|
+
# }
|
33
|
+
#
|
34
|
+
# end
|
35
|
+
# describe "with ancestors" do
|
36
|
+
# before(:each) do
|
37
|
+
# @applied_css = AppliedCSS.new("http://www.bbc.co.uk/", :ancestors => true)
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# it "should load successfully" do
|
41
|
+
# @applied_css.css("html").should be_an_instance_of Hash
|
42
|
+
# end
|
43
|
+
# it "should determine css declarations" do
|
44
|
+
# @applied_css.css("#blq-container").should == {
|
45
|
+
#
|
46
|
+
# :position => "relative",
|
47
|
+
# :"padding-bottom" => "10px",
|
48
|
+
# :padding => "0",
|
49
|
+
# :"font-size" => "62.5%",
|
50
|
+
# :background => "url(../img/body_bg.gif) center repeat-y",
|
51
|
+
# :"font-family" => "verdana,helvetica,arial,sans-serif",
|
52
|
+
# :color => "#111",
|
53
|
+
# :margin => "0",
|
54
|
+
# :"line-height" => "1"
|
55
|
+
# }
|
56
|
+
#
|
57
|
+
# end
|
58
|
+
# end
|
59
|
+
# end
|
60
|
+
|
61
|
+
describe "with default css" do
|
62
|
+
before(:each) do
|
63
|
+
@applied_css = AppliedCSS.new(:url => @sample_html)
|
64
|
+
end
|
65
|
+
|
66
|
+
describe "methods" do
|
67
|
+
it "should be an AppliedCSS class" do
|
68
|
+
@applied_css.should be_an_instance_of AppliedCSS
|
69
|
+
end
|
70
|
+
it "should parse the html" do
|
71
|
+
@applied_css.doc.should_not be_nil
|
72
|
+
end
|
73
|
+
it "should return a valid nokogiri document" do
|
74
|
+
@applied_css.doc.should be_an_instance_of Nokogiri::HTML::Document
|
75
|
+
end
|
76
|
+
it "should return a hash for the css method" do
|
77
|
+
@applied_css.css("#container").should be_an_instance_of Hash
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe "load ordering" do
|
82
|
+
it "should overwrite earlier declarations" do
|
83
|
+
@applied_css.css("#container")[:height].should == "600px"
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should not take settings from ancestors" do
|
87
|
+
@applied_css.css("#container")[:"font-size"].should be_nil
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "with ancestors" do
|
91
|
+
before(:each) do
|
92
|
+
@applied_css = AppliedCSS.new(:url => @sample_html, :ancestors => true)
|
93
|
+
end
|
94
|
+
it "should take settings from ancestors" do
|
95
|
+
@applied_css.css("#container")[:"font-size"].should == "20px"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe "using ids" do
|
101
|
+
it "should find declarations using ids" do
|
102
|
+
@applied_css.css("#container")[:width].should == "900px"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe "using classes" do
|
107
|
+
it "should find declarations using classes" do
|
108
|
+
@applied_css.css("#container > span").keys.should include :color
|
109
|
+
@applied_css.css("#container > span")[:color].should == "#ff0000"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "for imported stylesheets using @import" do
|
114
|
+
it "should find declarations delared on imported stylesheets" do
|
115
|
+
@applied_css.css("#from-imported").keys.should include :color
|
116
|
+
@applied_css.css("#from-imported")[:color].should == "green"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
#from-imported {color: green;}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Sample Document for testing CSS</title>
|
5
|
+
<link rel="stylesheet" href="css/sample1.css" type="text/css" media=screen>
|
6
|
+
<link rel="stylesheet" href="css/sample2.css" type="text/css" media=screen>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="container">
|
10
|
+
<span class="red title">
|
11
|
+
This is a RED TITLE
|
12
|
+
</span>
|
13
|
+
</div>
|
14
|
+
<div id="from-imported">
|
15
|
+
</div>
|
16
|
+
</body>
|
17
|
+
</html>
|
data/spec/spec_helper.rb
ADDED
data/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: applied_css
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Stewart McKee
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-28 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &70166700522100 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70166700522100
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bundler
|
27
|
+
requirement: &70166700520840 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70166700520840
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: nokogiri
|
38
|
+
requirement: &70166700519920 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70166700519920
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: css_parser
|
49
|
+
requirement: &70166700519100 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70166700519100
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: fakeweb
|
60
|
+
requirement: &70166700518260 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70166700518260
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: awesome_print
|
71
|
+
requirement: &70166700517300 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70166700517300
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: addressable
|
82
|
+
requirement: &70166700516040 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70166700516040
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: cobweb
|
93
|
+
requirement: &70166700515320 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
type: :runtime
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70166700515320
|
102
|
+
description: Gem for interrogating CSS and Script elements of a html document
|
103
|
+
email:
|
104
|
+
- stewart@theizone.co.uk
|
105
|
+
executables: []
|
106
|
+
extensions: []
|
107
|
+
extra_rdoc_files: []
|
108
|
+
files:
|
109
|
+
- .gitignore
|
110
|
+
- .rspec
|
111
|
+
- .rvmrc
|
112
|
+
- Gemfile
|
113
|
+
- Gemfile.lock
|
114
|
+
- LICENSE.txt
|
115
|
+
- README.rdoc
|
116
|
+
- Rakefile
|
117
|
+
- applied_css.gemspec
|
118
|
+
- lib/applied_css.rb
|
119
|
+
- lib/applied_css/version.rb
|
120
|
+
- samples/imported.css
|
121
|
+
- samples/sample.html
|
122
|
+
- samples/sample1.css
|
123
|
+
- samples/sample2.css
|
124
|
+
- spec/applied_css/applied_css_spec.rb
|
125
|
+
- spec/samples/imported.css
|
126
|
+
- spec/samples/sample.html
|
127
|
+
- spec/samples/sample1.css
|
128
|
+
- spec/samples/sample2.css
|
129
|
+
- spec/spec_helper.rb
|
130
|
+
- spec_helper.rb
|
131
|
+
homepage: ''
|
132
|
+
licenses: []
|
133
|
+
post_install_message:
|
134
|
+
rdoc_options: []
|
135
|
+
require_paths:
|
136
|
+
- lib
|
137
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
145
|
+
requirements:
|
146
|
+
- - ! '>='
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
requirements: []
|
150
|
+
rubyforge_project: applied_css
|
151
|
+
rubygems_version: 1.8.10
|
152
|
+
signing_key:
|
153
|
+
specification_version: 3
|
154
|
+
summary: CSS and Script extraction tool for html documents
|
155
|
+
test_files:
|
156
|
+
- spec/applied_css/applied_css_spec.rb
|
157
|
+
- spec/samples/imported.css
|
158
|
+
- spec/samples/sample.html
|
159
|
+
- spec/samples/sample1.css
|
160
|
+
- spec/samples/sample2.css
|
161
|
+
- spec/spec_helper.rb
|