Module: Gempage::Configuration

Defined in:
lib/gempage/configuration.rb

Instance Method Summary collapse

Instance Method Details

#asset_gempage_pathObject



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

def asset_gempage_path
  return @asset_gempage_path if defined? @asset_gempage_path and @asset_gempage_path
  @asset_gempage_path = File.join(gempage_path, 'assets', Gempage::VERSION)
  FileUtils.mkdir_p(@asset_gempage_path)
  @asset_gempage_path
end

#assets_path(name) ⇒ Object



28
29
30
# File 'lib/gempage/configuration.rb', line 28

def assets_path(name)
  File.join(@asset_gempage_path, name)
end

#gemfile_pathObject



32
33
34
# File 'lib/gempage/configuration.rb', line 32

def gemfile_path
  File.join(root, 'Gemfile')
end

#gempage_dir(dir = nil) ⇒ Object



10
11
12
13
# File 'lib/gempage/configuration.rb', line 10

def gempage_dir(dir=nil)
  return @gempage_dir if defined? @gempage_dir and dir.nil?
  @gempage_dir = (dir || 'public/gempage')
end

#gempage_pathObject



15
16
17
18
19
# File 'lib/gempage/configuration.rb', line 15

def gempage_path
  gempage_path = File.join(root, gempage_dir)
  FileUtils.mkdir_p gempage_path
  gempage_path
end

#root(root = nil) ⇒ Object



5
6
7
8
# File 'lib/gempage/configuration.rb', line 5

def root(root=nil)
  return @root if defined? @root and root.nil?
  @root = File.expand_path(root || Dir.getwd)
end