Class: Fizzy::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/fizzy/cli.rb,
lib/fizzy/cli/auth.rb,
lib/fizzy/cli/base.rb,
lib/fizzy/cli/pins.rb,
lib/fizzy/cli/tags.rb,
lib/fizzy/cli/cards.rb,
lib/fizzy/cli/skill.rb,
lib/fizzy/cli/steps.rb,
lib/fizzy/cli/users.rb,
lib/fizzy/cli/boards.rb,
lib/fizzy/cli/columns.rb,
lib/fizzy/cli/comments.rb,
lib/fizzy/cli/reactions.rb,
lib/fizzy/cli/notifications.rb

Defined Under Namespace

Modules: Base Classes: AuthCommands, Boards, Cards, Columns, Comments, Notifications, Pins, Reactions, Skill, Steps, Tags, Users

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


80
# File 'lib/fizzy/cli.rb', line 80

def self.exit_on_failure? = true

Instance Method Details

#initObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fizzy/cli.rb', line 29

def init
  config_path = File.join(Dir.pwd, ProjectConfig::FILENAME)
  return if File.exist?(config_path) && !yes?("#{config_path} already exists. Overwrite?")

  selected = 
  config = { "account" => selected["account_slug"] }

  boards = fetch_boards(selected)
  config["boards"] = boards.to_h { |b| [b["id"], b["name"]] } if boards.any?
  config["board"] = pick_board(boards) if boards.any? && yes?("Set a default board?")

  File.write(config_path, YAML.dump(config))
  say "Wrote #{config_path}"
end

#versionObject



24
25
26
# File 'lib/fizzy/cli.rb', line 24

def version
  puts "fizzy-cli #{VERSION}"
end