sitemap_generator 2.1.1 → 2.1.2
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/README.md +10 -1
- data/VERSION +1 -1
- data/lib/sitemap_generator/builder/sitemap_url.rb +15 -16
- metadata +4 -4
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -26,6 +26,7 @@ Does your website use SitemapGenerator to generate Sitemaps?  Where would you be | |
| 26 26 | 
             
            Changelog
         | 
| 27 27 | 
             
            -------
         | 
| 28 28 |  | 
| 29 | 
            +
            - v2.1.2: Support multiple videos per url using the new `videos` option to `add()`.
         | 
| 29 30 | 
             
            - v2.1.1: Support calling `create()` multiple times in a sitemap config.  Support host names with path segments so you can use a `default_host` like `'http://mysite.com/subdirectory/'`.  Turn off `include_index` when the `sitemaps_host` differs from `default_host`.  Add docs about how to upload to remote hosts.
         | 
| 30 31 | 
             
            - v2.1.0: [News sitemap][sitemap_news] support
         | 
| 31 32 | 
             
            - v2.0.1.pre2: Fix uploading to the (bucket) root on a remote server
         | 
| @@ -512,7 +513,13 @@ Supported image options include: | |
| 512 513 | 
             
            Video Sitemaps
         | 
| 513 514 | 
             
            -----------
         | 
| 514 515 |  | 
| 515 | 
            -
            A video can be added to a sitemap URL by passing a `:video` Hash to `add`.  The Hash can contain tags defined by the [Video Sitemap specification][video_tags]. | 
| 516 | 
            +
            A video can be added to a sitemap URL by passing a `:video` Hash to `add`.  The Hash can contain tags defined by the [Video Sitemap specification][video_tags].
         | 
| 517 | 
            +
             | 
| 518 | 
            +
            To add more than one video to a url, pass an array of video hashes using the `:videos` option.
         | 
| 519 | 
            +
             | 
| 520 | 
            +
            To associate more than one `tag` with a video, pass the tags as an array with the key `:tags`.
         | 
| 521 | 
            +
             | 
| 522 | 
            +
            Example:
         | 
| 516 523 |  | 
| 517 524 | 
             
                add('/index.html', :video => {
         | 
| 518 525 | 
             
                  :thumbnail_loc => 'http://www.example.com/video1_thumbnail.png',
         | 
| @@ -542,6 +549,8 @@ Supported video options include: | |
| 542 549 | 
             
            * `gallery_loc`
         | 
| 543 550 | 
             
            * `uploader` (use `uploader_info` to set the info attribute)
         | 
| 544 551 |  | 
| 552 | 
            +
             | 
| 553 | 
            +
             | 
| 545 554 | 
             
            Geo Sitemaps
         | 
| 546 555 | 
             
            -----------
         | 
| 547 556 |  | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            2.1. | 
| 1 | 
            +
            2.1.2
         | 
| @@ -21,7 +21,7 @@ module SitemapGenerator | |
| 21 21 | 
             
                  # * +changefreq+
         | 
| 22 22 | 
             
                  # * +lastmod+
         | 
| 23 23 | 
             
                  # * +images+
         | 
| 24 | 
            -
                  # * +video+
         | 
| 24 | 
            +
                  # * +video+/+videos+
         | 
| 25 25 | 
             
                  # * +geo+
         | 
| 26 26 | 
             
                  # * +news+
         | 
| 27 27 | 
             
                  def initialize(path, options={})
         | 
| @@ -30,8 +30,11 @@ module SitemapGenerator | |
| 30 30 | 
             
                      path = sitemap.location.path_in_public
         | 
| 31 31 | 
             
                    end
         | 
| 32 32 |  | 
| 33 | 
            -
                    SitemapGenerator::Utilities.assert_valid_keys(options, :priority, :changefreq, :lastmod, :host, :images, :video, :geo, :news)
         | 
| 34 | 
            -
                    options.reverse_merge!(:priority => 0.5, :changefreq => 'weekly', :lastmod => Time.now, :images => [], :news => {})
         | 
| 33 | 
            +
                    SitemapGenerator::Utilities.assert_valid_keys(options, :priority, :changefreq, :lastmod, :host, :images, :video, :geo, :news, :videos)
         | 
| 34 | 
            +
                    options.reverse_merge!(:priority => 0.5, :changefreq => 'weekly', :lastmod => Time.now, :images => [], :news => {}, :videos => [])
         | 
| 35 | 
            +
                    if video = options.delete(:video)
         | 
| 36 | 
            +
                      options[:videos] = video.is_a?(Array) ? options[:videos].concat(video) : options[:videos] << video
         | 
| 37 | 
            +
                    end
         | 
| 35 38 | 
             
                    raise "Cannot generate a url without a host" unless options[:host].present?
         | 
| 36 39 | 
             
                    self.merge!(
         | 
| 37 40 | 
             
                      :path       => path,
         | 
| @@ -42,7 +45,7 @@ module SitemapGenerator | |
| 42 45 | 
             
                      :loc        => URI.join(options[:host], path.to_s.sub(/^\//, '')).to_s, # support host with subdirectory
         | 
| 43 46 | 
             
                      :images     => prepare_images(options[:images], options[:host]),
         | 
| 44 47 | 
             
                      :news       => prepare_news(options[:news]),
         | 
| 45 | 
            -
                      : | 
| 48 | 
            +
                      :videos     => options[:videos],
         | 
| 46 49 | 
             
                      :geo        => options[:geo]
         | 
| 47 50 | 
             
                    )
         | 
| 48 51 | 
             
                  end
         | 
| @@ -73,21 +76,17 @@ module SitemapGenerator | |
| 73 76 | 
             
                        end
         | 
| 74 77 | 
             
                      end
         | 
| 75 78 |  | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
             | 
| 79 | 
            -
                          builder.image:image  | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
                            builder.image :title, image[:title]                 if image[:title]
         | 
| 84 | 
            -
                            builder.image :license, image[:license]             if image[:license]
         | 
| 85 | 
            -
                          end
         | 
| 79 | 
            +
                      self[:images].each do |image|
         | 
| 80 | 
            +
                        builder.image:image do
         | 
| 81 | 
            +
                          builder.image :loc, image[:loc]
         | 
| 82 | 
            +
                          builder.image :caption, image[:caption]             if image[:caption]
         | 
| 83 | 
            +
                          builder.image :geo_location, image[:geo_location]   if image[:geo_location]
         | 
| 84 | 
            +
                          builder.image :title, image[:title]                 if image[:title]
         | 
| 85 | 
            +
                          builder.image :license, image[:license]             if image[:license]
         | 
| 86 86 | 
             
                        end
         | 
| 87 87 | 
             
                      end
         | 
| 88 88 |  | 
| 89 | 
            -
                       | 
| 90 | 
            -
                        video = self[:video]
         | 
| 89 | 
            +
                      self[:videos].each do |video|
         | 
| 91 90 | 
             
                        builder.video :video do
         | 
| 92 91 | 
             
                          builder.video :thumbnail_loc, video[:thumbnail_loc]
         | 
| 93 92 | 
             
                          builder.video :title, video[:title]
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: sitemap_generator
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 15
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 2
         | 
| 8 8 | 
             
              - 1
         | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 2.1. | 
| 9 | 
            +
              - 2
         | 
| 10 | 
            +
              version: 2.1.2
         | 
| 11 11 | 
             
            platform: ruby
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Karl Varga
         | 
| @@ -16,7 +16,7 @@ autorequire: | |
| 16 16 | 
             
            bindir: bin
         | 
| 17 17 | 
             
            cert_chain: []
         | 
| 18 18 |  | 
| 19 | 
            -
            date: 2011-09- | 
| 19 | 
            +
            date: 2011-09-20 00:00:00 -07:00
         | 
| 20 20 | 
             
            default_executable: 
         | 
| 21 21 | 
             
            dependencies: 
         | 
| 22 22 | 
             
            - !ruby/object:Gem::Dependency 
         |