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.85.12 lib/cc/cli/global_cache.rb
codeclimate-0.85.11 lib/cc/cli/global_cache.rb
codeclimate-0.85.10 lib/cc/cli/global_cache.rb
codeclimate-0.85.9 lib/cc/cli/global_cache.rb
codeclimate-0.85.8 lib/cc/cli/global_cache.rb
codeclimate-0.85.7 lib/cc/cli/global_cache.rb
codeclimate-0.85.6 lib/cc/cli/global_cache.rb
codeclimate-0.85.5 lib/cc/cli/global_cache.rb
codeclimate-0.85.4 lib/cc/cli/global_cache.rb
codeclimate-0.85.3 lib/cc/cli/global_cache.rb
codeclimate-0.85.2 lib/cc/cli/global_cache.rb
codeclimate-0.85.1 lib/cc/cli/global_cache.rb
codeclimate-0.85.0 lib/cc/cli/global_cache.rb
codeclimate-0.84.0 lib/cc/cli/global_cache.rb
codeclimate-0.83.0 lib/cc/cli/global_cache.rb
codeclimate-0.82.0 lib/cc/cli/global_cache.rb
codeclimate-0.81.0 lib/cc/cli/global_cache.rb
codeclimate-0.80.0 lib/cc/cli/global_cache.rb
codeclimate-0.79.0 lib/cc/cli/global_cache.rb
codeclimate-0.78.1 lib/cc/cli/global_cache.rb