Class: Licensor::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/licensor/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CLI

Returns a new instance of CLI.



5
6
7
8
9
# File 'lib/licensor/cli.rb', line 5

def initialize(*args)
  super

  @template = Template.new
end

Instance Method Details

#create(license) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/licensor/cli.rb', line 23

def create(license)
  filename = options[:filename] || DefaultSetting.filename

  open(filename, "w") do |f|
    f.puts text(license)
  end
end

#listObject



33
34
35
# File 'lib/licensor/cli.rb', line 33

def list
  puts @template.licenses
end

#show(license) ⇒ Object



16
17
18
# File 'lib/licensor/cli.rb', line 16

def show(license)
  puts text(license)
end

#versionObject



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

def version
  puts VERSION
end