Class: Kata::Setup::Base
- Inherits:
-
Object
- Object
- Kata::Setup::Base
- Defined in:
- lib/kata/setup/base.rb
Instance Attribute Summary collapse
-
#kata_name ⇒ Object
Returns the value of attribute kata_name.
-
#repo_name ⇒ Object
Returns the value of attribute repo_name.
Instance Method Summary collapse
- #build_tree(type = 'ruby') ⇒ Object
- #create_repo(options) ⇒ Object
-
#initialize(kata_name = 'kata') ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(kata_name = 'kata') ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/kata/setup/base.rb', line 12 def initialize(kata_name = 'kata') self.kata_name = kata_name self.repo_name = kata_name end |
Instance Attribute Details
#kata_name ⇒ Object
Returns the value of attribute kata_name.
9 10 11 |
# File 'lib/kata/setup/base.rb', line 9 def kata_name @kata_name end |
#repo_name ⇒ Object
Returns the value of attribute repo_name.
10 11 12 |
# File 'lib/kata/setup/base.rb', line 10 def repo_name @repo_name end |
Instance Method Details
#build_tree(type = 'ruby') ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/kata/setup/base.rb', line 27 def build_tree(type = 'ruby') case type when 'ruby' Kata::Setup::Ruby.new(kata_name).build_tree when 'node' Kata::Setup::Node.new(kata_name).build_tree when 'php' Kata::Setup::Php.new(kata_name).build_tree else raise(ArgumentError, "Invalid language type #{type}") end end |
#create_repo(options) ⇒ Object
17 18 19 20 21 |
# File 'lib/kata/setup/base.rb', line 17 def create_repo create_remote_repo if .repo push_local_repo(.repo) end |