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 +1 -1
- data/lib/SitemapMaker/core_ext/uri/directory.rb +9 -0
- data/lib/SitemapMaker/site_tree.rb +2 -2
- data/lib/SitemapMaker/version.rb +1 -1
- data/lib/sitemap_maker.rb +18 -10
- metadata +3 -2
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/SitemapMaker/version.rb
CHANGED
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
|
-
|
18
|
-
|
19
|
-
require '
|
20
|
-
|
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, '
|
24
|
-
autoload :SiteTree, '
|
25
|
-
autoload :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.
|
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:
|
239
|
+
hash: 1511151561411024885
|
239
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
241
|
none: false
|
241
242
|
requirements:
|