Module: Gunter

Defined in:
lib/gunter.rb,
lib/gunter/cli.rb,
lib/gunter/views.rb,
lib/gunter/models.rb,
lib/gunter/version.rb,
lib/gunter/model/git.rb,
lib/gunter/view/json.rb,
lib/gunter/view/text.rb,
lib/gunter/model/project.rb,
lib/gunter/model/template.rb

Defined Under Namespace

Modules: Model, Models, View, Views Classes: CLI, Error

Constant Summary collapse

GUNTER_DIR =
File.expand_path('~/.gunter').freeze
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.model(name) ⇒ Object

Get model

Examples:

Gunter.model(:project).create(repo, location)

Parameters:

  • name (String)

Returns:

  • (Object)

    model



31
32
33
# File 'lib/gunter.rb', line 31

def model(name)
  Gunter::Models.model(name)
end

.render(format, template, data) ⇒ String

Render templates

Examples:

Gunter.render(:json, :templates, data)

Parameters:

  • format (Symbol)
  • template (Symbol)
  • data (Object)

Returns:

  • (String)

    rendered template



44
45
46
# File 'lib/gunter.rb', line 44

def render(format, template, data)
  Gunter::Views.render(format, template, data)
end

.root_dirString

Get root directory

Returns:

  • (String)

    root directory



20
21
22
# File 'lib/gunter.rb', line 20

def root_dir
  GUNTER_DIR
end

.versionString

Get gunter gem version

Returns:

  • (String)

    version



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

def version
  VERSION
end