Class: Glossarist::CLI
- Inherits:
-
Thor
- Object
- Thor
- Glossarist::CLI
show all
- Defined in:
- lib/glossarist/cli.rb,
lib/glossarist/cli/export_command.rb,
lib/glossarist/cli/import_command.rb,
lib/glossarist/cli/compare_command.rb,
lib/glossarist/cli/package_command.rb,
lib/glossarist/cli/upgrade_command.rb,
lib/glossarist/cli/validate_command.rb
Defined Under Namespace
Classes: CompareCommand, ExportCommand, ImportCommand, PackageCommand, UpgradeCommand, ValidateCommand
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
141
142
143
144
145
|
# File 'lib/glossarist/cli.rb', line 141
def method_missing(*args)
warn "No method found named: #{args[0]}"
warn "Run with `--help` or `-h` to see available options"
exit 1
end
|
Class Method Details
.exit_on_failure? ⇒ Boolean
151
152
153
|
# File 'lib/glossarist/cli.rb', line 151
def self.exit_on_failure?
true
end
|
Instance Method Details
#compare(new_path, old_path) ⇒ Object
132
133
134
|
# File 'lib/glossarist/cli.rb', line 132
def compare(new_path, old_path)
CLI::CompareCommand.new(new_path, old_path, options).run
end
|
#export(path) ⇒ Object
120
121
122
|
# File 'lib/glossarist/cli.rb', line 120
def export(path)
CLI::ExportCommand.new(path, options).run
end
|
#generate_latex ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/glossarist/cli.rb', line 23
def generate_latex
assets = []
if options[:extra_attributes]
Glossarist.configure do |config|
config.register_extension_attributes(options[:extra_attributes])
end
end
concept_set = Glossarist::ConceptSet.new(options[:concepts_path], assets)
latex_str = concept_set.to_latex(options[:latex_concepts])
output_latex(latex_str)
end
|
#import(*files) ⇒ Object
102
103
104
|
# File 'lib/glossarist/cli.rb', line 102
def import(*files)
CLI::ImportCommand.new(files, options).run
end
|
#respond_to_missing? ⇒ Boolean
147
148
149
|
# File 'lib/glossarist/cli.rb', line 147
def respond_to_missing?
true
end
|
#upgrade(source_dir) ⇒ Object
46
47
48
|
# File 'lib/glossarist/cli.rb', line 46
def upgrade(source_dir)
CLI::UpgradeCommand.new(source_dir, options).run
end
|
#version ⇒ Object
137
138
139
|
# File 'lib/glossarist/cli.rb', line 137
def version
puts Glossarist::VERSION
end
|