Module: Flux

Defined in:
lib/flux.rb,
lib/flux/git.rb,
lib/flux/cli/git.rb,
lib/flux/cli/review.rb,
lib/flux/util/table.rb,
lib/flux/cli/feature.rb,
lib/flux/util/output.rb,
lib/flux/pivotal_tracker.rb,
lib/flux/cli/pivotal_tracker.rb,
lib/flux/ext/pivotal-tracker.rb

Defined Under Namespace

Modules: CLI, Git, PT, PivotalTracker, Util Classes: FluxError, Runner, TrackerError

Constant Summary collapse

NAME =
'.flux'
RC =
"#{NAME}.rb"
RC_LOCAL =
"#{NAME}.local.rb"

Class Method Summary collapse

Class Method Details

.environmentObject



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

def environment
  @project ||= {}
end

.find_upwards(object, start_dir) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/flux.rb', line 38

def find_upwards(object, start_dir)
  p  = Pathname(start_dir)
  f  = (p + object).expand_path.to_s

  if File.exist?(f)
    f
  elsif p == p.parent
    nil
  else
    find_upwards(object, p.parent)
  end
end

.rcObject



28
29
30
31
32
# File 'lib/flux.rb', line 28

def rc
  find_upwards(RC, Dir.pwd) or
    raise FluxError, "Could not find a '#{RC}' " <<
                     "file in the current filesystem hierarchy."
end

.rc_localObject



34
35
36
# File 'lib/flux.rb', line 34

def rc_local
  find_upwards(RC_LOCAL, Dir.pwd)
end

.setupObject



21
22
23
24
25
26
# File 'lib/flux.rb', line 21

def setup
  load rc
  load rc_local if File.exist?(rc_local)

  require 'flux/cli'
end