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.96.0 lib/cc/cli/global_cache.rb
codeclimate-0.95.0 lib/cc/cli/global_cache.rb
codeclimate-0.94.1 lib/cc/cli/global_cache.rb
codeclimate-0.94.0 lib/cc/cli/global_cache.rb
codeclimate-0.93.0 lib/cc/cli/global_cache.rb
codeclimate-0.92.1 lib/cc/cli/global_cache.rb
codeclimate-0.92.0 lib/cc/cli/global_cache.rb
codeclimate-0.91.0 lib/cc/cli/global_cache.rb
codeclimate-0.90.0 lib/cc/cli/global_cache.rb
codeclimate-0.89.0 lib/cc/cli/global_cache.rb
codeclimate-0.88.0 lib/cc/cli/global_cache.rb
codeclimate-0.87.5 lib/cc/cli/global_cache.rb
codeclimate-0.87.4 lib/cc/cli/global_cache.rb
codeclimate-0.87.3 lib/cc/cli/global_cache.rb
codeclimate-0.87.2 lib/cc/cli/global_cache.rb
codeclimate-0.87.1 lib/cc/cli/global_cache.rb
codeclimate-0.87.0 lib/cc/cli/global_cache.rb
codeclimate-0.86.0 lib/cc/cli/global_cache.rb
codeclimate-0.85.29 lib/cc/cli/global_cache.rb
codeclimate-0.85.28 lib/cc/cli/global_cache.rb