snatch 1.0.2 → 1.0.3
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/README.rdoc +11 -13
- data/VERSION +1 -1
- data/lib/snatch/clean.rb +1 -1
- data/lib/snatch/clean/html.rb +3 -3
- data/snatch.gemspec +2 -2
- data/spec/snatch/clean/html_spec.rb +12 -4
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,19 +1,17 @@
|
|
1
1
|
= snatch
|
2
2
|
|
3
|
-
|
3
|
+
*Snatch* a site.
|
4
4
|
|
5
|
-
|
5
|
+
snatch = Snatch.new
|
6
|
+
snatch.run
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
* Fork the project.
|
10
|
-
* Make your feature addition or bug fix.
|
11
|
-
* Add tests for it. This is important so I don't break it in a
|
12
|
-
future version unintentionally.
|
13
|
-
* Commit, do not mess with rakefile, version, or history.
|
14
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
15
|
-
* Send me a pull request. Bonus points for topic branches.
|
8
|
+
Usage:
|
9
|
+
snatch.rb [OPTIONS] SITE_URI(s)
|
16
10
|
|
17
|
-
|
11
|
+
Specific Options:
|
12
|
+
-w, --wget Specify the full path to the wget binary (Must be at least version 1.12.)
|
13
|
+
-g, --git Specify the full path to the git binary.
|
14
|
+
Common Options:
|
15
|
+
-h, --help Show this message.
|
18
16
|
|
19
|
-
|
17
|
+
You can pass multiple URIs to snatch.rb. You need to have wget v1.12 and git installed within $PATH. snatch.rb will optionally search for wget and git if they can not be found.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/lib/snatch/clean.rb
CHANGED
data/lib/snatch/clean/html.rb
CHANGED
@@ -2,9 +2,9 @@ class Snatch
|
|
2
2
|
class Clean
|
3
3
|
class HTML
|
4
4
|
module HrefFixMethods
|
5
|
-
def remove_index_html(a)
|
6
|
-
|
7
|
-
end
|
5
|
+
# def remove_index_html(a)
|
6
|
+
# a['href'] = a['href'].sub(%r{index\.html?$}, '')
|
7
|
+
# end
|
8
8
|
|
9
9
|
def replace_absolute(a)
|
10
10
|
a['href'] = a['href'].sub(%r{(https?)://#{MARKETING_SITE}/}, '/')
|
data/snatch.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{snatch}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["James Conroy-Finn"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-18}
|
13
13
|
s.description = %q{Simple site downloaded that wraps wget and converts PHP CSS files in to regular CSS files.}
|
14
14
|
s.email = %q{james@logi.cl}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -33,10 +33,18 @@ describe Snatch::Clean::HTML do
|
|
33
33
|
describe Snatch::Clean::HTML::HrefFixMethods do
|
34
34
|
subject { mock.extend(Snatch::Clean::HTML::HrefFixMethods) }
|
35
35
|
|
36
|
-
it 'should remove a trailing index.html' do
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
# it 'should remove a trailing index.html' do
|
37
|
+
# fix_node(:remove_index_html, '<a href="/blah/index.html"></a>') do |node|
|
38
|
+
# node.should have_href('/blah/')
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
|
42
|
+
it 'should preserve parent directories within a URL' do
|
43
|
+
anchor = '<a href="/folder/child/file.extension"></a>'
|
44
|
+
doc = Nokogiri::XML(anchor)
|
45
|
+
@html.doc = doc
|
46
|
+
@html.send(:update)
|
47
|
+
@html.doc.to_xhtml.strip.should == '<a href="/folder/child/file.extension"></a>'
|
40
48
|
end
|
41
49
|
|
42
50
|
it 'should replace an absolute CMS URL with a domainless absolute URL' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Conroy-Finn
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-18 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|