Module: DatacraftsIoSkeleton::Helpers

Included in:
RailsCreator, ReactCreator, VueCreator
Defined in:
lib/datacrafts_io_skeleton/helpers.rb

Overview

Shared logic.

Constant Summary collapse

TEMPLATES_DIR =

Defines gem templates folder which you can use to load template to the new app.

"#{File.dirname(__FILE__)}/../../templates".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



9
10
11
12
13
# File 'lib/datacrafts_io_skeleton/helpers.rb', line 9

def self.included(klass)
  klass.class_eval do
    include Thor::Actions
  end
end

Instance Method Details

#app(path = nil) ⇒ Object



19
20
21
# File 'lib/datacrafts_io_skeleton/helpers.rb', line 19

def app(path=nil)
  "#{@app_name}/#{path}"
end

#commit(message, app_path = app) ⇒ Object



15
16
17
# File 'lib/datacrafts_io_skeleton/helpers.rb', line 15

def commit(message, app_path=app)
  run "cd #{app_path} && git add . && git commit -m '#{message}'"
end