Sha256: a75b642592f37b0fe02d7061d3b2309c5cbf67f1e54a1af76cd674ce9d88cbf7
Contents?: true
Size: 1.3 KB
Versions: 10
Compression:
Stored size: 1.3 KB
Contents
#!/usr/bin/env ruby # WANT_JSON # init bundler in dev env if ENV['QB_DEV_ENV'] ENV.each {|k, v| if k.start_with? 'QB_DEV_ENV_' ENV[k.sub('QB_DEV_ENV_', '')] = v end } require 'bundler/setup' end require 'qb' require 'nrser' class YardGetOutputDir < QB::Ansible::Module arg :bundle_root, NRSER::Types.abs_path def facts_for rel_dir { yard_output_dir: rel_dir, yard_output_abs_dir: File.expand_path( rel_dir, @bundle_root ), } end def default_facts facts_for( 'doc' ).merge yard_output_dir_is_default: true end # entry point for the module. invoked by {\#run}. # # @return [nil | {Symbol => #to_json}] # when returning: # # - `nil`: module will successfully exit with no additional changes. # # - `{Symbol => #to_json}`: Hash will be merged over @facts that # are returned by the module to be set in the Ansible runtime and # the module will exit successfully. # def main path = File.join @bundle_root, '.yardopts' if File.exists? path contents = File.read path match = /^\-\-output-dir[\s\=](.*)$/.match contents if match return facts_for( match[1] ) end end default_facts end # #main end # YardGetOutputDir YardGetOutputDir.new.run
Version data entries
10 entries across 10 versions & 1 rubygems