Module: Charyf

Defined in:
lib/charyf.rb,
lib/charyf/version.rb,
lib/charyf/utils/utils.rb,
lib/charyf/utils/charyf.rb,
lib/charyf/utils/logger.rb,
lib/charyf/engine/charyf.rb,
lib/charyf/utils/command.rb,
lib/charyf/utils/machine.rb,
lib/charyf/engine/context.rb,
lib/charyf/engine/request.rb,
lib/charyf/utils/pipeline.rb,
lib/charyf/engine/response.rb,
lib/charyf/utils/extension.rb,
lib/charyf/utils/app_engine.rb,
lib/charyf/utils/app_loader.rb,
lib/charyf/utils/generators.rb,
lib/charyf/engine/skill/info.rb,
lib/charyf/utils/application.rb,
lib/charyf/engine/skill/skill.rb,
lib/charyf/utils/command/base.rb,
lib/charyf/utils/configuration.rb,
lib/charyf/utils/error_handler.rb,
lib/charyf/utils/initializable.rb,
lib/charyf/engine/intent/intent.rb,
lib/charyf/utils/generator/base.rb,
lib/charyf/engine/routing/result.rb,
lib/charyf/engine/routing/router.rb,
lib/charyf/utils/command/actions.rb,
lib/charyf/engine/dispatcher/base.rb,
lib/charyf/engine/routing/default.rb,
lib/charyf/engine/session/session.rb,
lib/charyf/utils/command/behavior.rb,
lib/charyf/utils/storage/provider.rb,
lib/charyf/support/string_inquirer.rb,
lib/charyf/utils/generator/actions.rb,
lib/charyf/engine/interface/program.rb,
lib/charyf/utils/commands/help/help.rb,
lib/charyf/engine/controller/actions.rb,
lib/charyf/engine/controller/helpers.rb,
lib/charyf/engine/dispatcher/default.rb,
lib/charyf/utils/generators/app_base.rb,
lib/charyf/utils/generators/defaults.rb,
lib/charyf/utils/strategy/base_class.rb,
lib/charyf/engine/interface/interface.rb,
lib/charyf/utils/strategy/owner_class.rb,
lib/charyf/engine/controller/renderers.rb,
lib/charyf/utils/app_engine/extensions.rb,
lib/charyf/utils/application/bootstrap.rb,
lib/charyf/utils/generators/named_base.rb,
lib/charyf/engine/controller/controller.rb,
lib/charyf/utils/extension/configurable.rb,
lib/charyf/utils/extension/configuration.rb,
lib/charyf/engine/controller/conversation.rb,
lib/charyf/engine/intent/processors/dummy.rb,
lib/charyf/utils/commands/cli/cli_command.rb,
lib/charyf/utils/application/configuration.rb,
lib/charyf/engine/intent/processors/helpers.rb,
lib/charyf/engine/session/processors/default.rb,
lib/charyf/engine/intent/processors/processor.rb,
lib/charyf/utils/command/environment_argument.rb,
lib/charyf/utils/generators/app/app_generator.rb,
lib/charyf/engine/session/processors/processor.rb,
lib/charyf/utils/commands/server/server_command.rb,
lib/charyf/utils/commands/console/console_command.rb,
lib/charyf/utils/commands/destroy/destroy_command.rb,
lib/charyf/utils/generators/skill/skill_generator.rb,
lib/charyf/utils/commands/generate/generate_command.rb,
lib/charyf/utils/generators/intents/intents_generator.rb,
lib/charyf/utils/commands/application/application_command.rb

Defined Under Namespace

Modules: AppLoader, Command, Configuration, Controller, Engine, ErrorHandlers, Generators, Initializable, Interface, Pipeline, Skill, Strategy, Utils, VERSION Classes: AppEngine, Application, CLI, Console, Extension, Logger, StringInquirer

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.app_classObject

Returns the value of attribute app_class.



8
9
10
# File 'lib/charyf/utils/charyf.rb', line 8

def app_class
  @app_class
end

Class Method Details

._gem_sourceObject



14
15
16
# File 'lib/charyf.rb', line 14

def self._gem_source
  Pathname.new(__FILE__).dirname
end

.applicationObject



10
11
12
# File 'lib/charyf/utils/charyf.rb', line 10

def application
  @application ||= (@app_class.instance if app_class)
end

.configurationObject



14
15
16
# File 'lib/charyf/utils/charyf.rb', line 14

def configuration
  application.config
end

.envObject



22
23
24
# File 'lib/charyf/utils/charyf.rb', line 22

def env
  @_env ||= Charyf::StringInquirer.new(ENV["CHARYF_ENV"] || "development")
end

.env=(environment) ⇒ Object



26
27
28
# File 'lib/charyf/utils/charyf.rb', line 26

def env=(environment)
  @_env = Charyf::StringInquirer.new(environment)
end

.gem_versionObject

Returns the version of the currently loaded Charyf as a Gem::Version



3
4
5
# File 'lib/charyf/version.rb', line 3

def self.gem_version
  Gem::Version.new Charyf::VERSION::STRING
end

.groups(*groups) ⇒ Object



37
38
39
40
# File 'lib/charyf/utils/charyf.rb', line 37

def groups(*groups)
  # TODO
  [:default, env]
end

.loggerObject



30
31
32
33
34
35
# File 'lib/charyf/utils/charyf.rb', line 30

def logger
  return @logger if @logger

  FileUtils.mkdir_p root.join('log')
  @logger = Charyf::Logger.new(Charyf.root.join('log', "#{env}.log"))
end

.rootObject



18
19
20
# File 'lib/charyf/utils/charyf.rb', line 18

def root
  application && application.config.root
end

.versionObject



7
8
9
# File 'lib/charyf/version.rb', line 7

def self.version
  Charyf::VERSION::STRING
end