Module: Ichiban

Defined in:
lib/ichiban.rb,
lib/ichiban/config.rb,
lib/ichiban/loader.rb,
lib/ichiban/logger.rb,
lib/ichiban/command.rb,
lib/ichiban/deleter.rb,
lib/ichiban/helpers.rb,
lib/ichiban/scripts.rb,
lib/ichiban/version.rb,
lib/ichiban/watcher.rb,
lib/ichiban/markdown.rb,
lib/ichiban/nav_helper.rb,
lib/ichiban/js_compiler.rb,
lib/ichiban/dependencies.rb,
lib/ichiban/ejs_compiler.rb,
lib/ichiban/project_file.rb,
lib/ichiban/html_compiler.rb,
lib/ichiban/asset_compiler.rb,
lib/ichiban/manual_compiler.rb,
lib/ichiban/project_generator.rb

Defined Under Namespace

Modules: Dependencies, Helpers, Markdown, NavHelper Classes: AssetCompiler, CSSFile, Command, Config, DataFile, Deleter, EJSCompiler, EJSFile, HTMLCompiler, HTMLFile, HelperFile, HtaccessFile, ImageFile, JSCompiler, JSFile, LayoutFile, Loader, Logger, ManualCompiler, MiscAssetFile, MisplacedAssetFile, ModelFile, PartialHTMLFile, ProjectFile, ProjectGenerator, SCSSFile, Script, ScriptFile, ScriptRunner, UglifyError, Watcher

Constant Summary collapse

VERSION =
'1.2.10'

Class Method Summary collapse

Class Method Details

.config {|@config| ... } ⇒ Object

Yields:



2
3
4
5
6
# File 'lib/ichiban/config.rb', line 2

def self.config
  @config ||= ::Ichiban::Config.new
  yield @config if block_given?
  @config
end

.loggerObject



2
3
4
# File 'lib/ichiban/logger.rb', line 2

def self.logger
  @logger ||= Logger.new
end

.project_rootObject



54
55
56
# File 'lib/ichiban.rb', line 54

def self.project_root
  @project_root
end

.project_root=(path) ⇒ Object

In addition to setting the variable, this loads the config file



47
48
49
50
51
52
# File 'lib/ichiban.rb', line 47

def self.project_root=(path)
  @project_root = path
  if path # It's valid to set project_root to nil, though this would likely only happen in tests
    Ichiban::Config.load_file
  end
end

.script_runnerObject



2
3
4
# File 'lib/ichiban/scripts.rb', line 2

def self.script_runner
  @script_runner ||= Ichiban::ScriptRunner.new
end

.try_require(*gems) ⇒ Object

Try to load the libraries



59
60
61
62
63
64
65
66
67
68
# File 'lib/ichiban.rb', line 59

def self.try_require(*gems)
  gems.each do |gem|
    begin
      require gem
      return gem
    rescue LoadError
    end
  end
  false
end