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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8eb8a225348cba3a44cbfe2e8f56f9804de49e77
4
- data.tar.gz: '08a71b3c11641d1a158330b81436bd37dd7666a4'
2
+ SHA256:
3
+ metadata.gz: 526fb81217b6a251f0855ca41062a46c4e891c7ef0b0f205e66150c71971d88e
4
+ data.tar.gz: 60deb9fca4870f1726a366a8179ce4845e0221a8eb59d59dd44d990f603b1665
5
5
  SHA512:
6
- metadata.gz: d49ca80f28f8a95cb620cf72e066cff5cb0ce5f39206cf9246df9e0a349c43597ee5a28832ba0d1efb7602cb68c72c9fcc7d973bfa66b0971299e4b3387ac2f8
7
- data.tar.gz: bc938546a130f1d65ed8acec3e07e0e812518d4b34fb48a165bf35708b8bfbb08b6c12039d9d85d2c99036e9f6c224a851aba3af2e0505cdaabb130789857ff1
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](#install) section.
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/environment.rb` file config block:
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
1
+ 6.0.2
@@ -56,6 +56,7 @@ module SitemapGenerator
56
56
  attr_accessor :root, :app, :templates
57
57
  attr_writer :yield_sitemap, :verbose
58
58
  end
59
+ @yield_sitemap = nil
59
60
 
60
61
  # Global default for the verbose setting.
61
62
  def self.verbose
@@ -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.exists?(dir)
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!")
@@ -30,6 +30,7 @@ module SitemapGenerator
30
30
  # Store the URL of the first sitemap added because if create_index is
31
31
  # false this is the "index" URL
32
32
  @first_sitemap_url = nil
33
+ @create_index = nil
33
34
  end
34
35
 
35
36
  # Finalize sitemaps as they are added to the index.
@@ -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 < 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 to_formatted_s(format = DEFAULT_STRING_FORMAT)
41
- _original_to_s(format)
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 *FILES.keys
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.1
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: 2018-01-13 00:00:00.000000000 Z
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.11
188
+ rubygems_version: 2.7.6
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Easily generate XML Sitemaps