Class: D13n::Cli::Scaffold
- Defined in:
- lib/d13n/cli/commands/scaffold.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#application_base ⇒ Object
writeonly
Sets the attribute application_base.
-
#project ⇒ Object
Returns the value of attribute project.
-
#ruby_version ⇒ Object
Returns the value of attribute ruby_version.
Class Method Summary collapse
Instance Method Summary collapse
- #check_options ⇒ Object
- #generate_scaffold ⇒ Object
-
#initialize(args) ⇒ Scaffold
constructor
A new instance of Scaffold.
- #run ⇒ Object
Methods inherited from Command
Constructor Details
#initialize(args) ⇒ Scaffold
Returns a new instance of Scaffold.
10 11 12 13 14 15 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 10 def initialize(args) = false @application = nil @ruby_version = '2.3.3' super(args) end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
8 9 10 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 8 def application @application end |
#application_base=(value) ⇒ Object
Sets the attribute application_base
8 9 10 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 8 def application_base=(value) @application_base = value end |
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 8 def project @project end |
#ruby_version ⇒ Object
Returns the value of attribute ruby_version.
8 9 10 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 8 def ruby_version @ruby_version end |
Class Method Details
.command ⇒ Object
6 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 6 def self.command; "scaffold"; end |
Instance Method Details
#check_options ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 22 def if @application.nil? puts 'application name required' exit 1 elsif @project.nil? puts 'project name required' exit 1 end end |
#generate_scaffold ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 32 def generate_scaffold @template_home = File.join(File.(File.dirname(__FILE__)), '..', '..', '..', '..', 'templates') unless puts "Setting up application [#{application_base}] directories..." Dir.mkdir(@application) unless File.directory?(@application) Dir.chdir(@application) end @current_home = Dir.pwd unless application_scaffold end rake_scaffold migration_scaffold gem_scaffold makefile_scaffold application_yml_scaffold docker_scaffold docker_script_scaffold jekinsfile_scaffold ruby_version_scaffold spec_scaffold end |
#run ⇒ Object
17 18 19 20 |
# File 'lib/d13n/cli/commands/scaffold.rb', line 17 def run generate_scaffold end |