Sha256: 1f1843528d9ce8de52358aeef1a24e6ce3e67d559382f03cabd7e3b442ab31fd

Contents?: true

Size: 891 Bytes

Versions: 40

Compression:

Stored size: 891 Bytes

Contents

require 'excon'

module FastlaneCore
  class Changelog
    class << self
      def show_changes(gem_name, current_version)
        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']

          next unless index == 2
          puts ""
          puts "To see all new releases, open https://github.com/fastlane/#{gem_name}/releases".green
          break
        end
        puts "\nUpdate using 'sudo gem update #{gem_name.downcase}'".green
      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"
        JSON.parse(Excon.get(url).body)
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
fastlane_core-0.36.3 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.36.2 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.36.1 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.36.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.35.1 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.35.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.34.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.33.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.32.1 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.32.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.31.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.30.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.29.1 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.29.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.28.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.27.0 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.26.6 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.26.5 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.26.4 lib/fastlane_core/update_checker/changelog.rb
fastlane_core-0.26.3 lib/fastlane_core/update_checker/changelog.rb