Class: RakeSharedContext

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_shared_context.rb,
lib/rake_shared_context/version.rb

Constant Summary collapse

VERSION =
'0.3.0'

Class Method Summary collapse

Class Method Details

.rake_dirObject



24
25
26
27
28
# File 'lib/rake_shared_context.rb', line 24

def rake_dir
  return @rake_dir if @rake_dir

  root_dir.join('lib', 'tasks')
end

.rake_dir=(dir) ⇒ Object



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

def rake_dir=(dir)
  @rake_dir = Pathname.new(dir)
end

.root_dirObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rake_shared_context.rb', line 8

def root_dir
  return @root_dir if @root_dir

  if defined? Rails
    Rails.root
  elsif defined? Padrino
    Pathname.new(Padrino.root)
  else
    Pathname.pwd
  end
end

.root_dir=(dir) ⇒ Object



20
21
22
# File 'lib/rake_shared_context.rb', line 20

def root_dir=(dir)
  @root_dir = Pathname.new(dir)
end