hubdown 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hubdown/style_sheet.rb +3 -2
- data/lib/hubdown/version.rb +1 -1
- data/spec/style_sheet_spec.rb +3 -3
- metadata +3 -2
data/lib/hubdown/style_sheet.rb
CHANGED
@@ -7,10 +7,11 @@ class StyleSheet
|
|
7
7
|
|
8
8
|
|
9
9
|
def from_tag tag
|
10
|
-
matcher = /href=['|"](([\w
|
10
|
+
matcher = /href=['|"]((?:[\w:.\/-])*)\/([\w|-]+.css)/.match( tag.to_s )
|
11
|
+
|
11
12
|
if matcher
|
12
13
|
@url = matcher.captures[0]
|
13
|
-
@name = matcher.captures[
|
14
|
+
@name = matcher.captures[1]
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
data/lib/hubdown/version.rb
CHANGED
data/spec/style_sheet_spec.rb
CHANGED
@@ -12,10 +12,10 @@ describe StyleSheet do
|
|
12
12
|
|
13
13
|
it "strips attributes from a given tag" do
|
14
14
|
sh = StyleSheet.new
|
15
|
-
sh.from_tag "<link href=\"https://
|
15
|
+
sh.from_tag "<link href=\"https://assets-cdn.github.com/assets/github-da7475c114a3c2eab7b91a0584202a89fd188935.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\">"
|
16
16
|
|
17
|
-
sh.name.should eq "github-
|
18
|
-
sh.url.should eq "https://
|
17
|
+
sh.name.should eq "github-da7475c114a3c2eab7b91a0584202a89fd188935.css"
|
18
|
+
sh.url.should eq "https://assets-cdn.github.com/assets"
|
19
19
|
end
|
20
20
|
|
21
21
|
it "loads web content" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-05-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mixlib-cli
|
@@ -164,3 +164,4 @@ summary: CLI for GitHub Flavored markdown to html conversion
|
|
164
164
|
test_files:
|
165
165
|
- spec/spec_helper.rb
|
166
166
|
- spec/style_sheet_spec.rb
|
167
|
+
has_rdoc:
|