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

#__print_supported_licensesObject



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

def __print_supported_licenses
  puts @template.licenses
end

#__print_versionObject



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

def __print_version
  puts VERSION
end

#create(license) ⇒ Object



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

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

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

#show(license) ⇒ Object



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

def show(license)
  puts text(license)
end