snatch 0.0.9 → 0.0.10
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.
- data/VERSION +1 -1
- data/lib/snatch/clean.rb +4 -5
- data/snatch.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.10
|
data/lib/snatch/clean.rb
CHANGED
|
@@ -19,16 +19,15 @@ class Snatch
|
|
|
19
19
|
instance
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
# Loop through each link with a stylesheet rel attribute and remove
|
|
23
|
-
# dynamic PHP hrefs, replacing with plain CSS paths.
|
|
24
|
-
#
|
|
25
|
-
# Returns link tags
|
|
26
22
|
def process
|
|
27
23
|
@doc.css('link[rel=stylesheet]').each do |stylesheet_node|
|
|
28
24
|
stylesheet_node['href'] = rewrite_href(stylesheet_node['href'])
|
|
29
25
|
end
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
@doc.css('a[href]').each do |anchor|
|
|
28
|
+
anchor['href'].sub!(%r{\.html?$}, '')
|
|
29
|
+
end
|
|
30
|
+
|
|
32
31
|
File.open(@file_name, 'w') { |f| f.write @doc.to_html }
|
|
33
32
|
end
|
|
34
33
|
|
data/snatch.gemspec
CHANGED