Module: Jsus

Defined in:
lib/jsus.rb,
lib/jsus/cli.rb,
lib/jsus/tag.rb,
lib/jsus/pool.rb,
lib/jsus/util.rb,
lib/jsus/package.rb,
lib/jsus/packager.rb,
lib/jsus/container.rb,
lib/jsus/util/tree.rb,
lib/jsus/middleware.rb,
lib/jsus/source_file.rb,
lib/jsus/util/logger.rb,
lib/jsus/util/mixins.rb,
lib/jsus/util/validator.rb,
lib/jsus/util/compressor.rb,
lib/jsus/util/documenter.rb,
lib/jsus/util/file_cache.rb,
lib/jsus/util/inflection.rb,
lib/jsus/util/code_generator.rb,
lib/jsus/util/post_processor.rb,
lib/jsus/util/validator/base.rb,
lib/jsus/util/validator/mooforge.rb,
lib/jsus/util/post_processor/base.rb,
lib/jsus/util/post_processor/mooltie8.rb,
lib/jsus/util/post_processor/semicolon.rb,
lib/jsus/util/mixins/operates_on_sources.rb,
lib/jsus/util/post_processor/moocompat12.rb

Overview

TODO: document Cli class

Defined Under Namespace

Modules: Util Classes: BadSourceFileException, CLI, Container, Middleware, Package, Packager, Pool, SourceFile, Tag

Class Method Summary collapse

Class Method Details

.loggerJsus::Util::Logger

Jsus logger used for all the output. By default uses Logger::ERROR level severity and screen as output device.

Returns:



74
75
76
77
78
79
80
81
# File 'lib/jsus.rb', line 74

def self.logger
  @@logger ||= Jsus::Util::Logger.new($stdout).tap do |logger|
    logger.level = Logger::ERROR
    logger.formatter = lambda {|severity, time, progname, msg|
      "[#{time.strftime("%Y-%m-%d %H:%M:%S")}] [JSUS:#{severity}] #{msg}\n"
    }
  end
end

.logger=(value) ⇒ Object

Note:

In case you use non-jsus logger, you might want to extend it with Jsus::Util::Logger::Buffering module.

Reassign jsus logger whenever needed (E.g. use rails logger)

Parameters:

  • value

    Logger responding to #info, #warn, #debug, #error, #fatal, and #buffer



89
90
91
# File 'lib/jsus.rb', line 89

def self.logger=(value)
  @@logger = value
end

.look_for_cycles=(value) ⇒ Object

Parameters:

  • (Boolean)

See Also:



66
67
68
# File 'lib/jsus.rb', line 66

def self.look_for_cycles=(value)
  @look_for_cycles = value
end

.look_for_cycles?Boolean

Circular dependencies cannot be resolved and lead to "impossible" situations and problems, like missing source files or incorrect ordering.

However, checking for cycles is quite computationally expensive, which is why you may want to disable it in production mode.

Returns:

  • (Boolean)


60
61
62
# File 'lib/jsus.rb', line 60

def self.look_for_cycles?
  @look_for_cycles == nil ? true : @look_for_cycles
end

.verbose=(verbose) ⇒ Object

Parameters:

  • verbose (Boolean)

    verbose verbosity mode

See Also:



40
41
42
43
# File 'lib/jsus.rb', line 40

def self.verbose=(verbose)
  @verbose = verbose
  logger.level = verbose ? Logger::DEBUG : Logger::ERROR
end

.verbose?Boolean

In verbose mode jsus shows a lot of warnings like missing dependencies. Default: false

Returns:

  • (Boolean)

    jsus verbosity mode



33
34
35
# File 'lib/jsus.rb', line 33

def self.verbose?
  !!@verbose
end

.versionString

Returns Jsus version.

Returns:

  • (String)

    Jsus version



47
48
49
# File 'lib/jsus.rb', line 47

def self.version
  @version ||= File.read(File.dirname(__FILE__) + "/../VERSION")
end