Module: Rwm

Defined in:
lib/rwm.rb,
lib/rwm/cli.rb,
lib/rwm/rake.rb,
lib/rwm/rails.rb,
lib/rwm/errors.rb,
lib/rwm/gemfile.rb,
lib/rwm/package.rb,
lib/rwm/version.rb,
lib/rwm/git_hooks.rb,
lib/rwm/workspace.rb,
lib/rwm/overcommit.rb,
lib/rwm/task_cache.rb,
lib/rwm/task_runner.rb,
lib/rwm/commands/new.rb,
lib/rwm/commands/run.rb,
lib/rwm/commands/info.rb,
lib/rwm/commands/init.rb,
lib/rwm/commands/list.rb,
lib/rwm/commands/cache.rb,
lib/rwm/commands/check.rb,
lib/rwm/commands/graph.rb,
lib/rwm/gemfile_parser.rb,
lib/rwm/dependency_graph.rb,
lib/rwm/vscode_workspace.rb,
lib/rwm/affected_detector.rb,
lib/rwm/commands/affected.rb,
lib/rwm/commands/bootstrap.rb,
lib/rwm/convention_checker.rb

Defined Under Namespace

Modules: Commands, GemfileDsl, RakeCache Classes: AffectedDetector, BootstrapError, CLI, CacheError, ConventionChecker, ConventionError, CycleError, DependencyGraph, Error, GemfileParseError, GemfileParser, GitHooks, InvalidBaseRefError, Overcommit, Package, PackageExistsError, PackageNotFoundError, TaskCache, TaskRunner, VscodeWorkspace, Workspace, WorkspaceNotFoundError

Constant Summary collapse

VERSION =
"0.6.5"

Class Method Summary collapse

Class Method Details

.bundle_env(dir) ⇒ Object

Environment hash that points BUNDLE_GEMFILE at a specific directory’s Gemfile. Pass as the first argument to Open3.capture3 or system() when spawning bundle commands in package directories, so the child process resolves against the package’s Gemfile instead of inheriting the root’s.



25
26
27
# File 'lib/rwm.rb', line 25

def self.bundle_env(dir)
  { "BUNDLE_GEMFILE" => File.join(dir, "Gemfile") }
end

.debug(msg) ⇒ Object



17
18
19
# File 'lib/rwm.rb', line 17

def self.debug(msg)
  $stderr.puts "[rwm debug] #{msg}" if @verbose
end

.lib_path(name) ⇒ Object



34
35
36
37
38
# File 'lib/rwm/gemfile.rb', line 34

def self.lib_path(name)
  raise "rwm: workspace root not set (was rwm_lib used in the Gemfile?)" unless @workspace_root

  File.join(@workspace_root, "libs", name.to_s, "lib")
end

.libs_required?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rwm/rails.rb', line 18

def self.libs_required?
  @libs_required
end

.require_libsObject



22
23
24
25
26
27
28
# File 'lib/rwm/rails.rb', line 22

def self.require_libs
  return if @libs_required

  resolved_libs.each { |name| require name }
  @libs_required = true
  debug("required #{resolved_libs.size} workspace lib(s): #{resolved_libs.to_a.sort.join(', ')}")
end

.resolved_libsObject



22
23
24
# File 'lib/rwm/gemfile.rb', line 22

def self.resolved_libs
  @resolved_libs
end

.verbose=(value) ⇒ Object



13
14
15
# File 'lib/rwm.rb', line 13

def self.verbose=(value)
  @verbose = value
end

.verbose?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/rwm.rb', line 9

def self.verbose?
  @verbose
end

.workspace_rootObject



26
27
28
# File 'lib/rwm/gemfile.rb', line 26

def self.workspace_root
  @workspace_root
end

.workspace_root=(path) ⇒ Object



30
31
32
# File 'lib/rwm/gemfile.rb', line 30

def self.workspace_root=(path)
  @workspace_root = path
end