Class: Siba::Scaffold
- Inherits:
-
Object
- Object
- Siba::Scaffold
- Includes:
- FilePlug, LoggerPlug
- Defined in:
- lib/siba/scaffold.rb
Constant Summary collapse
- CATEGORY_REPLACE_TEXT =
"c6y"
- NAME_REPLACE_TEXT =
"demo"
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#name ⇒ Object
Returns the value of attribute name.
-
#name_camelized ⇒ Object
Returns the value of attribute name_camelized.
Instance Method Summary collapse
-
#initialize(category, name) ⇒ Scaffold
constructor
A new instance of Scaffold.
- #scaffold(dest_dir) ⇒ Object
Methods included from LoggerPlug
close, create, logger, #logger, opened?
Methods included from FilePlug
#siba_file, siba_file, siba_file=
Constructor Details
#initialize(category, name) ⇒ Scaffold
Returns a new instance of Scaffold.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/siba/scaffold.rb', line 11 def initialize(category, name) @category = category unless Siba::Plugins.valid_category? category raise Siba::Error, "Invalid category '#{category}'. Available categories are: #{Siba::Plugins.categories_str}" end @name = Siba::StringHelper.str_to_alphnumeric name raise Siba::Error, "first character of gem name can not be number" if name =~ /^[0-9]/ @name_camelized = StringHelper.camelize name end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
7 8 9 |
# File 'lib/siba/scaffold.rb', line 7 def category @category end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/siba/scaffold.rb', line 7 def name @name end |
#name_camelized ⇒ Object
Returns the value of attribute name_camelized.
7 8 9 |
# File 'lib/siba/scaffold.rb', line 7 def name_camelized @name_camelized end |