w3clove 0.6 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,7 +53,8 @@ module W3Clove
53
53
  pages = xml_locations.map {|loc| W3Clove::Page.new(loc.text)}
54
54
  if pages.empty?
55
55
  m = MetaInspector.new(url)
56
- links = ([m.url] + m.absolute_links.select {|l| l.start_with?(m.url)}.map {|l| l.split('#')[0]}).uniq
56
+ links = m.absolute_links.select {|l| l.start_with?(m.url)}.map {|l| l.split('#')[0]}.uniq
57
+ links << m.url unless (links.include?(m.url) || links.include?("#{m.url}/"))
57
58
  pages = links.map {|link| W3Clove::Page.new(link)}
58
59
  end
59
60
  pages
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module W3Clove
4
- VERSION = "0.6"
4
+ VERSION = "0.6.1"
5
5
  end
@@ -0,0 +1,74 @@
1
+
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <title>Emili Parreño - Freelance Ruby on Rails Developer & Consultant</title>
7
+ <meta name="author" content="Emili Parreño" />
8
+ <meta name="title" content="Emili Parreño - Freelance Ruby on Rails Developer" />
9
+ <meta name="keywords" content="emili, parreño, consultant, developer, rubyonrails, trainer, freelance, rails, ruby, ruby on rails, web, development, consulting" />
10
+ <meta name="description" content="I'm a freelance Ruby on Rails developer and consultant with more than 8 years of professional experience building high quality web applications." />
11
+ <meta name="google-site-verification" content="WO_27CLR6MC2bUjl36qDJzf9faiTYs6fBhlEf2V7v78" />
12
+ <link href="http://feeds.feedburner.com/eparreno" rel="alternate" title="Emili Parreño" type="application/atom+xml" />
13
+ <link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen, projection" />
14
+ </head>
15
+ <body>
16
+ <div class="home_container">
17
+ <h1><a href="/">Emili Parreño</a><br/><small>Freelance Ruby on Rails Developer & Consultant</small></h1>
18
+ <h2>About</h2>
19
+ <div class="content-home">
20
+ <img src='/images/header.png' alt='header' class="headerimg" width="600" />
21
+ <p>Hi! My name is Emili Parreño and I'm a freelance based in Girona, a small and beautiful city near Barcelona (Spain). I work as a Ruby/Rails developer, consultant and trainer at <a href="http://www.prorubyteam.com" target="blank" title="Ruby on Rails">ProRuby</a>.</p>
22
+
23
+ <p>I'm a <a href="http://contributors.rubyonrails.org/contributors/emili-parreno/commits" target="blank">Ruby on Rails Core Contributor</a> and a regular contributor to <a href="http://guides.rubyonrails.org" target="blank">Rails Guides</a>. I also contributed to other Open Source projects, and created <a href="https://github.com/eparreno">some others</a>.</p>
24
+
25
+ <p>I'm co-founder of <a href="http://www.prorubyteam.com" target="blank" title="Ruby on Rails">ProRuby</a> (the most stylish Ruby team all around the world), <a href="http://www.spainrb.org/" target="blank">Spain.rb</a>, <a href="http://groups.google.com/group/gironaonrails?pli=1" target="blank">Girona on Rails</a> local group and <a href="http://srug.org/" target="blank">Spanish Ruby Users Group</a>, which organized the European Ruby Conference 2009 (EuRuKo 2009) at Barcelona.
26
+ I also have experience as college professor, mentoring programming teams and as speaker at Ruby and Rails conferences and local groups.</p>
27
+ <p>If you are looking for a senior Ruby on Rails developer, consultant, trainer or QA &amp; Test guy, feel free to contact me at emili@eparreno.com, I'm very friendly :)</p>
28
+
29
+
30
+ </div>
31
+
32
+ <h2>Blog</h2>
33
+ <ul>
34
+
35
+ <li>&raquo; <a href="/2011/09/10/getting-started-with-ruby">Getting Started With Ruby</a> <small>10 Sep 2011</small></li>
36
+
37
+ <li>&raquo; <a href="/2010/04/17/how-to-use-in-memory-sqlite-database-for-rails-testing">How to use in-memory SQLite database for Rails testing</a> <small>17 Apr 2010</small></li>
38
+
39
+ <li>&raquo; <a href="/2010/03/10/visibilidad-metodos-ruby">Visibilidad de los métodos en Ruby</a> <small>10 Mar 2010</small></li>
40
+
41
+ <li>&raquo; <a href="/2010/02/03/una-nueva-manera-de-ver-los-logs-con-clarity">Una nueva manera de ver los logs con Clarity</a> <small>03 Feb 2010</small></li>
42
+
43
+ <li>&raquo; <a href="/2010/01/15/cambiando-a-jekyll">Bye, bye Wordpress</a> <small>15 Jan 2010</small></li>
44
+
45
+ <li>&raquo; <a href="/2009/09/30/character-string-processing-for-computer-programmers">Character string processing for computer programmers</a> <small>30 Sep 2009</small></li>
46
+
47
+ <li>&raquo; <a href="/2009/09/25/euruko-2009-videos-are-now-available">EuRuKo 2009 videos are now available!</a> <small>25 Sep 2009</small></li>
48
+
49
+ <li>&raquo; <a href="/2009/08/13/using-facebooker-with-jquery">Using Facebooker with jQuery</a> <small>13 Aug 2009</small></li>
50
+
51
+ <li>&raquo; <a href="/2009/07/22/how-to-use-in_place_editor-in-rails-2x">How to use in_place_editor in Rails 2.x</a> <small>22 Jul 2009</small></li>
52
+
53
+ <li>&raquo; <a href="/2009/06/30/fixing-fieldwitherrors-behavior">Fixing fieldWithErrors behavior</a> <small>30 Jun 2009</small></li>
54
+
55
+ <!--<li><a href="/blog">View all posts</a></li>-->
56
+ </ul>
57
+
58
+ <div class="footer"><p>
59
+ All content on this site is licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="blank">Creative Commons</a> license. This site is powered by <a href="http://www.jekyllrb.com/">Jekyll</a>.
60
+ </p>
61
+ </div>
62
+ </div>
63
+ <!-- google analytics -->
64
+ <script type="text/javascript">
65
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
66
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
67
+ </script>
68
+ <script type="text/javascript">
69
+ try {
70
+ var pageTracker = _gat._getTracker("UA-689414-5");
71
+ pageTracker._trackPageview();
72
+ } catch(err) {}</script>
73
+ <!-- end google analytics -->
74
+ </body>
data/spec/sitemap_spec.rb CHANGED
@@ -13,6 +13,9 @@ describe W3Clove::Sitemap do
13
13
  @sitemap_no_links = W3Clove::Sitemap.new('http://zigotica.com')
14
14
  @sitemap_no_links.stub!(:doc).and_return(open("#{$samples_dir}/zigotica.com.html"))
15
15
 
16
+ @sitemap_with_trailing_slash = W3Clove::Sitemap.new('http://eparreno.com')
17
+ @sitemap_with_trailing_slash.stub!(:doc).and_return(open("#{$samples_dir}/eparreno.com.html"))
18
+
16
19
  MarkupValidator.any_instance.stubs(:validate_uri).returns(stubbed_validator_results)
17
20
  end
18
21
 
@@ -29,14 +32,54 @@ describe W3Clove::Sitemap do
29
32
  end
30
33
 
31
34
  it "should get pages from the sample guides.rubyonrails.org site" do
32
- @sitemap_html.pages.length.should == 35
33
- @sitemap_html.pages.map {|p| p.url}.should == ["http://guides.rubyonrails.org", "http://guides.rubyonrails.org/index.html", "http://guides.rubyonrails.org/", "http://guides.rubyonrails.org/getting_started.html", "http://guides.rubyonrails.org/migrations.html", "http://guides.rubyonrails.org/active_record_validations_callbacks.html", "http://guides.rubyonrails.org/association_basics.html", "http://guides.rubyonrails.org/active_record_querying.html", "http://guides.rubyonrails.org/layouts_and_rendering.html", "http://guides.rubyonrails.org/form_helpers.html", "http://guides.rubyonrails.org/action_controller_overview.html", "http://guides.rubyonrails.org/routing.html", "http://guides.rubyonrails.org/active_support_core_extensions.html", "http://guides.rubyonrails.org/i18n.html", "http://guides.rubyonrails.org/action_mailer_basics.html", "http://guides.rubyonrails.org/testing.html", "http://guides.rubyonrails.org/security.html", "http://guides.rubyonrails.org/debugging_rails_applications.html", "http://guides.rubyonrails.org/performance_testing.html", "http://guides.rubyonrails.org/configuring.html", "http://guides.rubyonrails.org/command_line.html", "http://guides.rubyonrails.org/caching_with_rails.html", "http://guides.rubyonrails.org/asset_pipeline.html", "http://guides.rubyonrails.org/plugins.html", "http://guides.rubyonrails.org/rails_on_rack.html", "http://guides.rubyonrails.org/generators.html", "http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html", "http://guides.rubyonrails.org/api_documentation_guidelines.html", "http://guides.rubyonrails.org/ruby_on_rails_guides_guidelines.html", "http://guides.rubyonrails.org/3_1_release_notes.html", "http://guides.rubyonrails.org/3_0_release_notes.html", "http://guides.rubyonrails.org/2_3_release_notes.html", "http://guides.rubyonrails.org/2_2_release_notes.html", "http://guides.rubyonrails.org/credits.html", "http://guides.rubyonrails.org/v2.3.11/"]
35
+ @sitemap_html.pages.length.should == 34
36
+ @sitemap_html.pages.map {|p| p.url}.should == [
37
+ "http://guides.rubyonrails.org/index.html",
38
+ "http://guides.rubyonrails.org/",
39
+ "http://guides.rubyonrails.org/getting_started.html",
40
+ "http://guides.rubyonrails.org/migrations.html",
41
+ "http://guides.rubyonrails.org/active_record_validations_callbacks.html",
42
+ "http://guides.rubyonrails.org/association_basics.html",
43
+ "http://guides.rubyonrails.org/active_record_querying.html",
44
+ "http://guides.rubyonrails.org/layouts_and_rendering.html",
45
+ "http://guides.rubyonrails.org/form_helpers.html",
46
+ "http://guides.rubyonrails.org/action_controller_overview.html",
47
+ "http://guides.rubyonrails.org/routing.html",
48
+ "http://guides.rubyonrails.org/active_support_core_extensions.html",
49
+ "http://guides.rubyonrails.org/i18n.html",
50
+ "http://guides.rubyonrails.org/action_mailer_basics.html",
51
+ "http://guides.rubyonrails.org/testing.html",
52
+ "http://guides.rubyonrails.org/security.html",
53
+ "http://guides.rubyonrails.org/debugging_rails_applications.html",
54
+ "http://guides.rubyonrails.org/performance_testing.html",
55
+ "http://guides.rubyonrails.org/configuring.html",
56
+ "http://guides.rubyonrails.org/command_line.html",
57
+ "http://guides.rubyonrails.org/caching_with_rails.html",
58
+ "http://guides.rubyonrails.org/asset_pipeline.html",
59
+ "http://guides.rubyonrails.org/plugins.html",
60
+ "http://guides.rubyonrails.org/rails_on_rack.html",
61
+ "http://guides.rubyonrails.org/generators.html",
62
+ "http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html",
63
+ "http://guides.rubyonrails.org/api_documentation_guidelines.html",
64
+ "http://guides.rubyonrails.org/ruby_on_rails_guides_guidelines.html",
65
+ "http://guides.rubyonrails.org/3_1_release_notes.html",
66
+ "http://guides.rubyonrails.org/3_0_release_notes.html",
67
+ "http://guides.rubyonrails.org/2_3_release_notes.html",
68
+ "http://guides.rubyonrails.org/2_2_release_notes.html",
69
+ "http://guides.rubyonrails.org/credits.html",
70
+ "http://guides.rubyonrails.org/v2.3.11/" ]
34
71
  end
35
72
 
36
73
  it "should include sitemap url at least, even if no links were found" do
37
74
  @sitemap_no_links.pages.length.should == 1
38
75
  @sitemap_no_links.pages[0].url.should == 'http://zigotica.com'
39
76
  end
77
+
78
+ it "should not repeat URLs with and without trailing slash" do
79
+ urls = @sitemap_with_trailing_slash.pages.collect(&:url)
80
+ urls.should include 'http://eparreno.com/'
81
+ urls.should_not include 'http://eparreno.com'
82
+ end
40
83
  end
41
84
 
42
85
  describe "validations" do
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: w3clove
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- version: "0.6"
9
+ - 1
10
+ version: 0.6.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jaime Iniesta
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-12-15 00:00:00 Z
18
+ date: 2011-12-16 00:00:00 Z
18
19
  dependencies:
19
20
  - !ruby/object:Gem::Dependency
20
21
  name: w3c_validators
@@ -144,6 +145,7 @@ files:
144
145
  - spec/mocks/mocked_validator.rb
145
146
  - spec/page_spec.rb
146
147
  - spec/samples/absolute_links.html
148
+ - spec/samples/eparreno.com.html
147
149
  - spec/samples/guides.rubyonrails.org.html
148
150
  - spec/samples/sitemap.xml
149
151
  - spec/samples/zigotica.com.html