sitemap_maker 0.0.3 → 0.0.4

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/Gemfile.lock CHANGED
@@ -32,7 +32,7 @@ GEM
32
32
  ntlm-http (0.1.1)
33
33
  plymouth (0.3.3)
34
34
  pry-exception_explorer (~> 0.1.7)
35
- pry-exception_explorer (0.1.9)
35
+ pry-exception_explorer (0.2.3)
36
36
  pry-stack_explorer (>= 0.3.9)
37
37
  pry-stack_explorer (0.4.7)
38
38
  binding_of_caller (~> 0.6.8)
@@ -0,0 +1,9 @@
1
+ module URI
2
+ def directory_path
3
+ if self.to_s.match(/\/$/)
4
+ self
5
+ else
6
+ self.to_s.sub(/(.*\/).*?$/, '\1')
7
+ end
8
+ end
9
+ end
@@ -32,7 +32,7 @@ module SitemapMaker::SiteTree
32
32
 
33
33
  # XXX Regexp修正必要
34
34
  # test more http://www.rubular.com
35
- own_link_regexp = Regexp.new(%r!(#{@uri.host})[a-zA-Z0-9.?\/=%&一-龠亜-煕-]+!)
35
+ own_link_regexp = Regexp.new(%r!(#{@uri.host})[a-zA-Z0-9.?\/=%&一-龠亜-煕-]+$!)
36
36
 
37
37
  # pageが持っているリンク
38
38
  have_links = page.links_with( href: own_link_regexp )
@@ -92,7 +92,7 @@ module SitemapMaker::SiteTree
92
92
 
93
93
  # fix up url with base_uri
94
94
  def complete_url(base_uri, path = nil)
95
- return path if path.to_s.match(@uri.host)
95
+ return path.to_s if path.to_s.match(@uri.host)
96
96
 
97
97
  if path.to_s.match(/^\//)
98
98
  # 絶対path
@@ -1,3 +1,3 @@
1
1
  module SitemapMaker
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/sitemap_maker.rb CHANGED
@@ -10,18 +10,26 @@ require 'to_regexp'
10
10
  # extend gem
11
11
  Dir["./**/*.rb"].each { |f| require f }
12
12
 
13
- require 'SitemapMaker/Nokogiri/XML/node'
14
- require 'SitemapMaker/Nokogiri/html'
15
-
16
13
  # extend module and class
17
- require 'SitemapMaker/core_ext/object/blank'
18
- require 'SitemapMaker/core_ext/object/try'
19
- require 'SitemapMaker/core_ext/uri/directory'
20
- require 'SitemapMaker/html'
14
+ ['core_ext/object/blank', 'core_ext/object/try', 'html', 'nokogiri/xml/node', 'nokogiri/html'
15
+ ].each do |path|
16
+ require File.join(File.dirname(File.expand_path(__FILE__)), 'sitemapmaker', path)
17
+ end
18
+
19
+
20
+ module URI
21
+ def directory_path
22
+ if self.to_s.match(/\/$/)
23
+ self
24
+ else
25
+ self.to_s.sub(/(.*\/).*?$/, '\1')
26
+ end
27
+ end
28
+ end
21
29
 
22
30
  module SitemapMaker
23
- autoload :VERSION, 'SitemapMaker/version'
24
- autoload :SiteTree, 'SitemapMaker/site_tree'
25
- autoload :Utils, 'SitemapMaker/utils'
31
+ autoload :VERSION, 'sitemapmaker/version'
32
+ autoload :SiteTree, 'sitemapmaker/site_tree'
33
+ autoload :Utils, 'sitemapmaker/utils'
26
34
  end
27
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitemap_maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -210,6 +210,7 @@ files:
210
210
  - lib/SitemapMaker/Nokogiri/html.rb
211
211
  - lib/SitemapMaker/core_ext/object/blank.rb
212
212
  - lib/SitemapMaker/core_ext/object/try.rb
213
+ - lib/SitemapMaker/core_ext/uri/directory.rb
213
214
  - lib/SitemapMaker/html.rb
214
215
  - lib/SitemapMaker/site_tree.rb
215
216
  - lib/SitemapMaker/utils.rb
@@ -235,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
236
  version: '0'
236
237
  segments:
237
238
  - 0
238
- hash: 1910550972433006978
239
+ hash: 1511151561411024885
239
240
  required_rubygems_version: !ruby/object:Gem::Requirement
240
241
  none: false
241
242
  requirements: