Class: Backpack::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/backpack/cli.rb', line 39

def self.exit_on_failure?
  true
end

Instance Method Details

#importObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/backpack/cli.rb', line 13

def import
  say ascii_art, :green

  add_radix_colors_dependency if File.exist?("package.json")

  directory "stylesheets", "app/assets/stylesheets", recursive: true
  directory "components", "app/components", recursive: true

  copy_file "attributes.rb", "lib/backpack/attributes.rb"
  copy_file "classes.rb", "lib/backpack/classes.rb"
  copy_file "identifier.rb", "lib/backpack/identifier.rb"
  copy_file "tokens.rb", "lib/backpack/tokens.rb"

  directory "../../spec/components", "spec/components", recursive: true do |content|
    content.gsub("require 'spec_helper'", "require 'rails_helper'")
  end
  directory "../../spec/fixtures/icons", "spec/fixtures/icons", recursive: true

  copy_file "../../vendor/normalize.css", "vendor/normalize.css"
end

#syncObject



35
36
37
# File 'lib/backpack/cli.rb', line 35

def sync
  Backpack::Commands::Sync.new(shell).sync
end