sitemap_generator 6.0.1 → 6.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES.md +5 -0
- data/README.md +4 -2
- data/VERSION +1 -1
- data/lib/sitemap_generator.rb +1 -0
- data/lib/sitemap_generator/adapters/file_adapter.rb +1 -1
- data/lib/sitemap_generator/builder/sitemap_index_file.rb +1 -0
- data/lib/sitemap_generator/core_ext/big_decimal.rb +15 -5
- data/lib/sitemap_generator/link_set.rb +2 -0
- data/lib/sitemap_generator/templates.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 526fb81217b6a251f0855ca41062a46c4e891c7ef0b0f205e66150c71971d88e
|
4
|
+
data.tar.gz: 60deb9fca4870f1726a366a8179ce4845e0221a8eb59d59dd44d990f603b1665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66d23227adef4509f58d8187f8b41008a1357b558db9c669bb83bba3a28372f23be1958cc22a14bab2be891b4984bfda9360afdb807665ebd137fe45a2e19833
|
7
|
+
data.tar.gz: cedd0f41927cd430a8f3089e71230dcd11f92804b62bb1dad8626925068823e27bce55cb144fc49d2c78010239f4ff350ed877f948291b28b8ff7fd894311d14
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
### 6.0.2
|
2
|
+
|
3
|
+
* Resolve `BigDecimal.new is deprecated` warnings in Ruby 2.5 [#305](https://github.com/kjvarga/sitemap_generator/pull/305).
|
4
|
+
* Resolve `instance variable not initialized`, `File.exists? is deprecated` and `'*' interpreted as argument prefix` warnings [#304](https://github.com/kjvarga/sitemap_generator/pull/304).
|
5
|
+
|
1
6
|
### 6.0.1
|
2
7
|
|
3
8
|
* Use `yaml_tag` instead of `yaml_as`, which was deprecated in Ruby 2.4, and removed in 2.5 [#298](https://github.com/kjvarga/sitemap_generator/pull/298).
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Sitemaps adhere to the [Sitemap 0.9 protocol][sitemap_protocol] specification.
|
|
20
20
|
|
21
21
|
### Show Me
|
22
22
|
|
23
|
-
This is a simple standalone example. For Rails installation see the [Rails instructions](#rails) in the [Install](#
|
23
|
+
This is a simple standalone example. For Rails installation see the [Rails instructions](#rails) in the [Install](#installation) section.
|
24
24
|
|
25
25
|
Install:
|
26
26
|
|
@@ -158,12 +158,14 @@ Add the gem to your `Gemfile`:
|
|
158
158
|
gem 'sitemap_generator'
|
159
159
|
```
|
160
160
|
|
161
|
-
Alternatively, if you are not using a `Gemfile` add the gem to your `config/
|
161
|
+
Alternatively, if you are not using a `Gemfile` add the gem to your `config/application.rb` file config block:
|
162
162
|
|
163
163
|
```ruby
|
164
164
|
config.gem 'sitemap_generator'
|
165
165
|
```
|
166
166
|
|
167
|
+
Note: SitemapGenerator automatically loads its Rake tasks when used with Rails. You **do not need** to require the `sitemap_generator/tasks` file.
|
168
|
+
|
167
169
|
## Getting Started
|
168
170
|
|
169
171
|
### Preventing Output
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.0.
|
1
|
+
6.0.2
|
data/lib/sitemap_generator.rb
CHANGED
@@ -11,7 +11,7 @@ module SitemapGenerator
|
|
11
11
|
def write(location, raw_data)
|
12
12
|
# Ensure that the directory exists
|
13
13
|
dir = location.directory
|
14
|
-
if !File.
|
14
|
+
if !File.exist?(dir)
|
15
15
|
FileUtils.mkdir_p(dir)
|
16
16
|
elsif !File.directory?(dir)
|
17
17
|
raise SitemapError.new("#{dir} should be a directory!")
|
@@ -8,12 +8,24 @@ end
|
|
8
8
|
require 'yaml'
|
9
9
|
|
10
10
|
# Define our own class rather than modify the global class
|
11
|
-
class SitemapGenerator::BigDecimal
|
11
|
+
class SitemapGenerator::BigDecimal
|
12
12
|
YAML_TAG = 'tag:yaml.org,2002:float'
|
13
13
|
YAML_MAPPING = { 'Infinity' => '.Inf', '-Infinity' => '-.Inf', 'NaN' => '.NaN' }
|
14
14
|
|
15
15
|
yaml_tag YAML_TAG
|
16
16
|
|
17
|
+
def initialize(num)
|
18
|
+
@value = BigDecimal(num)
|
19
|
+
end
|
20
|
+
|
21
|
+
def *(other)
|
22
|
+
other * @value
|
23
|
+
end
|
24
|
+
|
25
|
+
def /(other)
|
26
|
+
SitemapGenerator::BigDecimal === other ? @value / other.instance_variable_get(:@value) : @value / other
|
27
|
+
end
|
28
|
+
|
17
29
|
# This emits the number without any scientific notation.
|
18
30
|
# This is better than self.to_f.to_s since it doesn't lose precision.
|
19
31
|
#
|
@@ -37,9 +49,7 @@ class SitemapGenerator::BigDecimal < BigDecimal
|
|
37
49
|
end
|
38
50
|
|
39
51
|
DEFAULT_STRING_FORMAT = 'F'
|
40
|
-
def
|
41
|
-
|
52
|
+
def to_s(format = DEFAULT_STRING_FORMAT)
|
53
|
+
@value.to_s(format)
|
42
54
|
end
|
43
|
-
alias_method :_original_to_s, :to_s
|
44
|
-
alias_method :to_s, :to_formatted_s
|
45
55
|
end
|
@@ -118,6 +118,8 @@ module SitemapGenerator
|
|
118
118
|
# Note: When adding a new option be sure to include it in `options_for_group()` if
|
119
119
|
# the option should be inherited by groups.
|
120
120
|
def initialize(options={})
|
121
|
+
@default_host, @sitemaps_host, @yield_sitemap, @sitemaps_path, @adapter, @verbose, @protect_index, @sitemap_index, @added_default_links, @created_group, @sitemap = nil
|
122
|
+
|
121
123
|
options = SitemapGenerator::Utilities.reverse_merge(options,
|
122
124
|
:include_root => true,
|
123
125
|
:include_index => false,
|
@@ -11,7 +11,7 @@ module SitemapGenerator
|
|
11
11
|
}
|
12
12
|
|
13
13
|
# Dynamically define accessors for each key defined in <tt>FILES</tt>
|
14
|
-
attr_accessor
|
14
|
+
attr_accessor(*FILES.keys)
|
15
15
|
FILES.keys.each do |name|
|
16
16
|
eval <<-END
|
17
17
|
define_method(:#{name}) do
|
@@ -38,4 +38,4 @@ module SitemapGenerator
|
|
38
38
|
File.read(template_path(template))
|
39
39
|
end
|
40
40
|
end
|
41
|
-
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitemap_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Varga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.6
|
188
|
+
rubygems_version: 2.7.6
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Easily generate XML Sitemaps
|