Class: RailsVue3Quasar::BaseHandle

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_vue3_quasar/base_handle.rb

Overview

class base handle phaser

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.process(*args, &block) ⇒ Object



7
8
9
# File 'lib/rails_vue3_quasar/base_handle.rb', line 7

def self.process(*args, &block)
  new(*args, &block).process
end

Instance Method Details

#install_yarn?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rails_vue3_quasar/base_handle.rb', line 22

def install_yarn?
  system('which yarn > /dev/null 2>&1')
end

#project_rootObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/rails_vue3_quasar/base_handle.rb', line 11

def project_root
  current_dir = Dir.pwd
  until File.exist?(File.join(current_dir, 'Gemfile'))
    parent_dir = File.expand_path('..', current_dir)
    return nil if current_dir == parent_dir # Reached the root directory

    current_dir = parent_dir
  end
  current_dir
end