Class: Conduit::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/conduit/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_pathObject

Returns the value of attribute base_path.



9
10
11
# File 'lib/conduit/cli.rb', line 9

def base_path
  @base_path
end

#classified_nameObject

Returns the value of attribute classified_name.



9
10
11
# File 'lib/conduit/cli.rb', line 9

def classified_name
  @classified_name
end

#driver_nameObject

Returns the value of attribute driver_name.



9
10
11
# File 'lib/conduit/cli.rb', line 9

def driver_name
  @driver_name
end

#underscored_nameObject

Returns the value of attribute underscored_name.



9
10
11
# File 'lib/conduit/cli.rb', line 9

def underscored_name
  @underscored_name
end

Instance Method Details

#generate_driver(driver_name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/conduit/cli.rb', line 19

def generate_driver driver_name
  @driver_name = driver_name
  @dasherized_name = ActiveSupport::Inflector.dasherize driver_name
  @classified_name = ActiveSupport::Inflector.classify driver_name
  @underscored_name = ActiveSupport::Inflector.underscore driver_name
  @pwd = Dir.pwd
  @base_path = "#{@pwd}/conduit-#{@dasherized_name}"

  run("bundle gem conduit-#{@underscored_name} --no-coc --mit --test=rspec")
  fix_names
  copy_files
  modify_files
  run("chmod +x #{@base_path}/bin/generate_action")
  bundle_install
end