Sha256: 45d0af11461f3be16fd56c8cd0652af60a49d20003e850003858a8262b954072

Contents?: true

Size: 843 Bytes

Versions: 124

Compression:

Stored size: 843 Bytes

Contents

require "cc/cli/file_store"

module CC
  module CLI
    class GlobalCache < FileStore
      FILE_NAME = "/cache.yml".freeze

      # Cache entries

      def last_version_check
        data["last-version-check"] || Time.at(0)
      end

      def last_version_check=(value)
        data["last-version-check"] =
          if value.is_a? Time
            value
          else
            Time.at(0)
          end
        save
        value
      end

      def latest_version
        data["latest-version"]
      end

      def latest_version=(value)
        data["latest-version"] = value
        save
        value
      end

      def outdated
        data["outdated"] == true
      end
      alias outdated? outdated

      def outdated=(value)
        data["outdated"] = value == true
        save
        value
      end
    end
  end
end

Version data entries

124 entries across 124 versions & 2 rubygems

Version Path
codeclimate-fede-0.85.38 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.37 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.36 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.35 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.33 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.32 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.31 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.30 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.21 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.24 lib/cc/cli/global_cache.rb
codeclimate-fede-0.85.23 lib/cc/cli/global_cache.rb
codeclimate-0.85.23 lib/cc/cli/global_cache.rb
codeclimate-0.85.22 lib/cc/cli/global_cache.rb
codeclimate-0.85.21 lib/cc/cli/global_cache.rb
codeclimate-0.85.19 lib/cc/cli/global_cache.rb
codeclimate-0.85.18 lib/cc/cli/global_cache.rb
codeclimate-0.85.17 lib/cc/cli/global_cache.rb
codeclimate-0.85.15 lib/cc/cli/global_cache.rb
codeclimate-0.85.14 lib/cc/cli/global_cache.rb
codeclimate-0.85.13 lib/cc/cli/global_cache.rb