Module: Ore::Config

Included in:
CLI
Defined in:
lib/ore/config.rb

Constant Summary collapse

@@home =

The users home directory

File.expand_path(ENV['HOME'] || ENV['HOMEPATH'])
@@path =

Ore config directory

File.join(@@home,'.ore')
@@options_file =

Default ore options file.

File.join(@@path,'default.opts')
@@templates_dir =

Custom Ore Templates directory

File.join(@@path,'templates')
@@data_dir =

The data/ directory for Ore

File.expand_path(File.join('..','..','data'),File.dirname(__FILE__))

Class Method Summary collapse

Class Method Details

.builtin_templates {|path| ... } ⇒ Object

The builtin templates.

Yields:

  • (path)

    The given block will be passed every builtin template.

Yield Parameters:

  • path (String)

    The path of a Ore template directory.



29
30
31
32
33
34
35
36
37
# File 'lib/ore/config.rb', line 29

def Config.builtin_templates
  path = File.join(@@data_dir,'ore','templates')

  if File.directory?(path)
    Dir.glob("#{path}/*") do |template|
      yield template if File.directory?(template)
    end
  end
end

.installed_templates {|path| ... } ⇒ Object

The installed templates.

Yields:

  • (path)

    The given block will be passed every installed template.

Yield Parameters:

  • path (String)

    The path of a Ore template directory.



48
49
50
51
52
53
54
# File 'lib/ore/config.rb', line 48

def Config.installed_templates
  if File.directory?(@@templates_dir)
    Dir.glob("#{@@templates_dir}/*") do |template|
      yield template if File.directory?(template)
    end
  end
end