snatch 1.0.12 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.12
1
+ 1.1.0
data/lib/snatch/clean.rb CHANGED
@@ -20,15 +20,7 @@ class Snatch
20
20
  CSS.update(@doc, @working_directory)
21
21
  HTML.update(@doc, @working_directory)
22
22
 
23
- File.open(@file_name, 'w') { |f| f.write @doc.to_xhtml }
23
+ File.open(@file_name, 'w') { |f| f.write @doc.to_html }
24
24
  end
25
-
26
- private
27
-
28
- # Sadly we can't use this as our XSLT won't output valid XHTML
29
- # def clean_xhtml
30
- # xsl_io = File.open(File.expand_path('../../../xsl/pretty_print.xsl', __FILE__))
31
- # Nokogiri::XSLT(xsl_io).apply_to(@doc)
32
- # end
33
25
  end
34
26
  end
@@ -64,15 +64,21 @@ class Snatch
64
64
  end
65
65
 
66
66
  def update
67
- @doc.css('base, meta[name=generator]').each { |node| node.remove }
67
+ @doc.css('base, meta[name=generator]').each do |node|
68
+ puts "Removing #{node.inspect}"
69
+ node.remove
70
+ end
68
71
 
72
+ puts "Removing comments"
69
73
  @doc.search('//comment()').remove
70
74
 
75
+ puts "Rewriting anchor HREFs"
71
76
  klass = Class.new { include HrefFixMethods }.new
72
77
  HrefFixMethods.instance_methods.each do |m|
73
78
  @doc.css('a[href]').each { |a| klass.send m, a }
74
79
  end
75
80
 
81
+ puts "Rewriting SRCs"
76
82
  klass = Class.new { include SrcFixMethods }.new
77
83
  SrcFixMethods.instance_methods.each do |m|
78
84
  @doc.css('[src]').each { |a| klass.send m, a }
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.12"
8
+ s.version = "1.1.0"
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-19}
12
+ s.date = %q{2010-04-26}
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 = [
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.homepage = %q{http://github.com/jcf/snatch}
43
43
  s.rdoc_options = ["--charset=UTF-8"]
44
44
  s.require_paths = ["lib"]
45
- s.rubygems_version = %q{1.3.5}
45
+ s.rubygems_version = %q{1.3.6}
46
46
  s.summary = %q{wget your site and replace any nasty PHP CSS files}
47
47
  s.test_files = [
48
48
  "spec/snatch/clean/css_spec.rb",
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 1
8
+ - 0
9
+ version: 1.1.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - James Conroy-Finn
@@ -9,29 +14,35 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-19 00:00:00 +00:00
17
+ date: 2010-04-26 00:00:00 +01:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 2
30
+ - 9
23
31
  version: 1.2.9
24
- version:
32
+ type: :development
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: nokogiri
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
33
43
  version: "0"
34
- version:
44
+ type: :runtime
45
+ version_requirements: *id002
35
46
  description: Simple site downloaded that wraps wget and converts PHP CSS files in to regular CSS files.
36
47
  email: james@logi.cl
37
48
  executables: []
@@ -76,18 +87,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
87
  requirements:
77
88
  - - ">="
78
89
  - !ruby/object:Gem::Version
90
+ segments:
91
+ - 0
79
92
  version: "0"
80
- version:
81
93
  required_rubygems_version: !ruby/object:Gem::Requirement
82
94
  requirements:
83
95
  - - ">="
84
96
  - !ruby/object:Gem::Version
97
+ segments:
98
+ - 0
85
99
  version: "0"
86
- version:
87
100
  requirements: []
88
101
 
89
102
  rubyforge_project:
90
- rubygems_version: 1.3.5
103
+ rubygems_version: 1.3.6
91
104
  signing_key:
92
105
  specification_version: 3
93
106
  summary: wget your site and replace any nasty PHP CSS files