Sha256: 782c015ed6f19d14e588e0b1ac2a43242efa8258b91623c50b3dc0b5d33c407a

Contents?: true

Size: 1.25 KB

Versions: 463

Compression:

Stored size: 1.25 KB

Contents

require 'excon'

module FastlaneCore
  class Changelog
    class << self
      def show_changes(gem_name, current_version)
        did_show_changelog = false

        self.releases(gem_name).each_with_index do |release, index|
          next unless Gem::Version.new(release['tag_name']) > Gem::Version.new(current_version)
          puts ""
          puts release['name'].green
          puts release['body']
          did_show_changelog = true

          next unless index == 2
          puts ""
          puts "To see all new releases, open https://github.com/fastlane/#{gem_name}/releases".green
          break
        end

        puts ""
        puts "Please update using `#{UpdateChecker.update_command(gem_name: gem_name)}`".green if did_show_changelog
      rescue
        # Something went wrong, we don't care so much about this
      end

      def releases(gem_name)
        url = "https://api.github.com/repos/fastlane/#{gem_name}/releases"
        # We have to follow redirects, since some repos were moved away into a separate org
        server_response = Excon.get(url,
                                    middlewares: Excon.defaults[:middlewares] + [Excon::Middleware::RedirectFollower])
        JSON.parse(server_response.body)
      end
    end
  end
end

Version data entries

463 entries across 463 versions & 2 rubygems

Version Path
fastlane-2.70.3 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.71.0.beta.20171221010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.2 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.71.0.beta.20171220010004 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.71.0.beta.20171219010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.1 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.0 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.0.beta.20171217010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.0.beta.20171216010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.0.beta.20171215010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.3 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.0.beta.20171214010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.2 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.1 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.70.0.beta.20171213010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.0 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.0.beta.20171212010004 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.0.beta.20171211010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.0.beta.20171210010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb
fastlane-2.69.0.beta.20171209010003 fastlane_core/lib/fastlane_core/update_checker/changelog.rb