Class: Uttk::Generators::Generator
- Inherits:
-
Rails::Generator::NamedBase
- Object
- Rails::Generator::NamedBase
- Uttk::Generators::Generator
- Defined in:
- lib/uttk/generators/generator.rb
Direct Known Subclasses
DumperGenerator, FilterGenerator, GeneratorGenerator, LoaderGenerator, PathFilterGenerator, StrategyGenerator
Defined Under Namespace
Classes: DirSource
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#fullname ⇒ Object
readonly
Returns the value of attribute fullname.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #dir_name ⇒ Object
-
#initialize(runtime_args, runtime_options = {}) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ Generator
Returns a new instance of Generator.
27 28 29 30 31 32 33 34 35 |
# File 'lib/uttk/generators/generator.rb', line 27 def initialize ( runtime_args, ={} ) @fullname = ENV['FULLNAME'] || raise('The FULLNAME environement variable is not set') @email = ENV['EMAIL'] || raise('The EMAIL environement variable is not set') @root = __FILE__.to_path.dirname.parent.parent.parent..cleanpath @year = Time.now.year super(runtime_args, { :destination => @root.to_s }.merge!()) @root = '.'.to_path end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
42 43 44 |
# File 'lib/uttk/generators/generator.rb', line 42 def email @email end |
#fullname ⇒ Object (readonly)
Returns the value of attribute fullname.
42 43 44 |
# File 'lib/uttk/generators/generator.rb', line 42 def fullname @fullname end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
42 43 44 |
# File 'lib/uttk/generators/generator.rb', line 42 def root @root end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
42 43 44 |
# File 'lib/uttk/generators/generator.rb', line 42 def year @year end |
Instance Method Details
#dir_name ⇒ Object
44 45 46 |
# File 'lib/uttk/generators/generator.rb', line 44 def dir_name module_name.to_s.underscore end |