Module: Kompo

Defined in:
lib/kompo.rb,
lib/kompo/cache.rb,
lib/kompo/version.rb,
lib/kompo/kompo_ignore.rb,
lib/kompo/tasks/packing.rb,
lib/kompo/tasks/homebrew.rb,
lib/kompo/tasks/work_dir.rb,
lib/kompo/tasks/make_fs_c.rb,
lib/kompo/tasks/cargo_path.rb,
lib/kompo/tasks/make_main_c.rb,
lib/kompo/tasks/copy_gemfile.rb,
lib/kompo/tasks/install_deps.rb,
lib/kompo/tasks/install_ruby.rb,
lib/kompo/tasks/check_stdlibs.rb,
lib/kompo/tasks/bundle_install.rb,
lib/kompo/tasks/kompo_vfs_path.rb,
lib/kompo/tasks/ruby_build_path.rb,
lib/kompo/tasks/build_native_gem.rb,
lib/kompo/tasks/copy_project_files.rb,
lib/kompo/tasks/collect_dependencies.rb,
lib/kompo/tasks/find_native_extensions.rb,
lib/kompo/tasks/kompo_vfs_version_check.rb

Defined Under Namespace

Modules: BundleCacheHelpers, KompoVfsVersionCheck Classes: BuildNativeGem, BundleInstall, CargoPath, CheckStdlibs, CollectDependencies, CopyGemfile, CopyProjectFiles, FindNativeExtensions, HomebrewPath, InstallDeps, InstallRuby, KompoFile, KompoIgnore, KompoVfsPath, MakeFsC, MakeMainC, Packing, RubyBuildPath, WorkDir

Constant Summary collapse

KOMPO_PREFIX =

Fixed path prefix for Ruby installation Using a fixed path ensures that cached Ruby binaries work correctly, since Ruby has hardcoded paths for standard library locations.

"/kompo"
VERSION =
"0.4.0"
KOMPO_VFS_MIN_VERSION =
"0.5.1"

Class Method Summary collapse

Class Method Details

.clean_cache(version) ⇒ Object

Clean the cache for specified Ruby version

Parameters:

  • version (String)

    Ruby version to clean, or “all” to clean all caches



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/kompo/cache.rb', line 8

def self.clean_cache(version)
  kompo_cache = File.expand_path("~/.kompo/cache")

  unless Dir.exist?(kompo_cache)
    puts "Cache directory does not exist: #{kompo_cache}"
    return
  end

  if version == "all"
    clean_all_caches(kompo_cache)
  else
    clean_version_cache(kompo_cache, version)
  end
end