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-0.78.0 lib/cc/cli/global_cache.rb
codeclimate-0.77.0 lib/cc/cli/global_cache.rb
codeclimate-0.76.0 lib/cc/cli/global_cache.rb
codeclimate-0.75.0 lib/cc/cli/global_cache.rb
codeclimate-0.74.0 lib/cc/cli/global_cache.rb
codeclimate-0.73.0 lib/cc/cli/global_cache.rb
codeclimate-0.72.0 lib/cc/cli/global_cache.rb
codeclimate-0.71.2 lib/cc/cli/global_cache.rb
codeclimate-0.71.1 lib/cc/cli/global_cache.rb
codeclimate-0.71.0 lib/cc/cli/global_cache.rb
codeclimate-0.70.6 lib/cc/cli/global_cache.rb
codeclimate-0.70.5 lib/cc/cli/global_cache.rb
codeclimate-0.70.4 lib/cc/cli/global_cache.rb
codeclimate-0.70.3 lib/cc/cli/global_cache.rb
codeclimate-0.70.2 lib/cc/cli/global_cache.rb
codeclimate-0.70.1 lib/cc/cli/global_cache.rb
codeclimate-0.70.0 lib/cc/cli/global_cache.rb
codeclimate-0.69.0 lib/cc/cli/global_cache.rb
codeclimate-0.68.0 lib/cc/cli/global_cache.rb
codeclimate-0.67.0 lib/cc/cli/global_cache.rb