Class: Tapioca::Cli

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

Instance Method Summary collapse

Instance Method Details

#__print_versionObject



98
99
100
# File 'lib/tapioca/cli.rb', line 98

def __print_version
  puts "Tapioca v#{Tapioca::VERSION}"
end

#dsl(*constants) ⇒ Object



77
78
79
80
81
# File 'lib/tapioca/cli.rb', line 77

def dsl(*constants)
  Tapioca.silence_warnings do
    generator.build_dsl(constants)
  end
end

#generate(*gems) ⇒ Object



84
85
86
87
88
# File 'lib/tapioca/cli.rb', line 84

def generate(*gems)
  Tapioca.silence_warnings do
    generator.build_gem_rbis(gems)
  end
end

#initObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/tapioca/cli.rb', line 40

def init
  create_file(Config::SORBET_CONFIG, skip: true) do
    <<~CONTENT
      --dir
      .
    CONTENT
  end
  create_file(Config::DEFAULT_POSTREQUIRE, skip: true) do
    <<~CONTENT
      # typed: false
      # frozen_string_literal: true

      # Add your extra requires here
    CONTENT
  end
end

#requireObject



58
59
60
61
62
# File 'lib/tapioca/cli.rb', line 58

def require
  Tapioca.silence_warnings do
    generator.build_requires
  end
end

#syncObject



91
92
93
94
95
# File 'lib/tapioca/cli.rb', line 91

def sync
  Tapioca.silence_warnings do
    generator.sync_rbis_with_gemfile
  end
end

#todoObject



65
66
67
68
69
# File 'lib/tapioca/cli.rb', line 65

def todo
  Tapioca.silence_warnings do
    generator.build_todos
  end
end