Class: Gambiarra::UI::BaseView

Inherits:
View
  • Object
show all
Defined in:
lib/gambiarra/ui/base_view.rb

Direct Known Subclasses

CreateView, Index, Install

Instance Attribute Summary

Attributes inherited from View

#params, #path

Instance Method Summary collapse

Methods inherited from View

#ensure_param, #go_to, inherited, #initialize, #output, questions, render, respond, set_path

Constructor Details

This class inherits a constructor from Gambiarra::View

Instance Method Details

#project_constantObject



18
19
20
# File 'lib/gambiarra/ui/base_view.rb', line 18

def project_constant
  project_name.gsub('-', '_').camelize
end

#project_nameObject



14
15
16
# File 'lib/gambiarra/ui/base_view.rb', line 14

def project_name
  Dir.pwd.split('/').last
end

#thorObject



4
5
6
7
8
9
10
11
12
# File 'lib/gambiarra/ui/base_view.rb', line 4

def thor
  @thor ||= begin
    thor_class = Class.new(Thor::Group) do
      include Thor::Actions
    end
    .tap { |t| t.source_root("#{Dir.pwd}") }
    .new
  end
end