Class: Csa::Ccm::Cli::Resource
- Inherits:
-
Object
- Object
- Csa::Ccm::Cli::Resource
- Defined in:
- lib/csa/ccm/cli/resource.rb
Class Method Summary collapse
- .from_xlsx(xslt_path) ⇒ Object
- .lookup_version(version) ⇒ Object
- .root_gem ⇒ Object
- .to_file(hash, output_file) ⇒ Object
Instance Method Summary collapse
Class Method Details
.from_xlsx(xslt_path) ⇒ Object
18 19 20 |
# File 'lib/csa/ccm/cli/resource.rb', line 18 def self.from_xlsx(xslt_path) raise 'Not implemented yet' end |
.lookup_version(version) ⇒ Object
14 15 16 |
# File 'lib/csa/ccm/cli/resource.rb', line 14 def self.lookup_version(version) Dir["#{root_gem}/resources/**/*v#{version}*.xlsx"] end |
.root_gem ⇒ Object
10 11 12 |
# File 'lib/csa/ccm/cli/resource.rb', line 10 def self.root_gem Pathname.new(__dir__).join('..', '..', '..', '..') end |
.to_file(hash, output_file) ⇒ Object
26 27 28 29 30 |
# File 'lib/csa/ccm/cli/resource.rb', line 26 def self.to_file(hash, output_file) File.open(output_file, 'w') { |f| f.write hash.to_yaml(line_width: 9999) } rescue Errno::ENOENT => e UI.say("Cannot write result to #{output_file} because: #{e.}") end |
Instance Method Details
#from_caiq(xslt_path, output_name, output_path) ⇒ Object
22 23 24 |
# File 'lib/csa/ccm/cli/resource.rb', line 22 def from_caiq(xslt_path, output_name, output_path) raise 'Not implemented yet' end |