Class: Rugular::New
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Rugular::New
- Includes:
- Thor::Actions
- Defined in:
- lib/rugular/tasks/new.rb
Class Method Summary collapse
Instance Method Summary collapse
- #create_application_directory ⇒ Object
- #create_component_directory ⇒ Object
- #create_custom_files ⇒ Object
- #installation_complete ⇒ Object
Class Method Details
.source_root ⇒ Object
11 12 13 |
# File 'lib/rugular/tasks/new.rb', line 11 def self.source_root __dir__.chomp('/tasks') end |
Instance Method Details
#create_application_directory ⇒ Object
15 16 17 |
# File 'lib/rugular/tasks/new.rb', line 15 def create_application_directory directory "#{lib_directory}/templates/new/", app_open_struct.name end |
#create_component_directory ⇒ Object
31 32 33 |
# File 'lib/rugular/tasks/new.rb', line 31 def create_component_directory empty_directory "#{app_name}/src/components" end |
#create_custom_files ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rugular/tasks/new.rb', line 19 def create_custom_files Dir.glob("#{lib_directory}/templates/new_erb/*.erb").each do |file_name| pathname = Pathname.new(file_name) create_file "#{app_name}/#{pathname.basename('.erb').to_s}" do ERB.new(pathname.read).result( app_open_struct.instance_eval { binding } ) end end end |
#installation_complete ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/rugular/tasks/new.rb', line 35 def installation_complete puts "Thank you for installing Rugular, please finish setting up your "\ "project with: `cd #{app_open_struct.name} && bundle install && "\ "rugular dependencies`\n"\ "Please install bourbon and neat by bundle exec bourbon install "\ "--path src/ and neat with bundle exec neat install --path src/" end |