Class: AbideDevUtils::PuppetStrings
- Inherits:
-
Object
- Object
- AbideDevUtils::PuppetStrings
- Defined in:
- lib/abide_dev_utils/puppet_strings.rb
Overview
Puppet Strings reference object
Instance Attribute Summary collapse
-
#search_patterns ⇒ Object
readonly
Returns the value of attribute search_patterns.
Instance Method Summary collapse
- #data_type_aliases ⇒ Object
- #data_types ⇒ Object
- #debug? ⇒ Boolean
- #defined_types ⇒ Object
- #find_resource(resource_name) ⇒ Object
-
#initialize(search_patterns: nil, opts: {}) ⇒ PuppetStrings
constructor
A new instance of PuppetStrings.
- #providers ⇒ Object
- #puppet_classes ⇒ Object
- #puppet_functions ⇒ Object
- #puppet_plans ⇒ Object
- #puppet_tasks ⇒ Object
- #quiet? ⇒ Boolean
- #resource_types ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(search_patterns: nil, opts: {}) ⇒ PuppetStrings
Returns a new instance of PuppetStrings.
11 12 13 14 15 16 17 18 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 11 def initialize(search_patterns: nil, opts: {}) check_yardoc_dir @search_patterns = search_patterns || ::PuppetStrings::DEFAULT_SEARCH_PATTERNS @debug = opts[:debug] @quiet = opts[:quiet] PuppetStrings::Yard.setup! YARD::CLI::Yardoc.run(*yard_args(@search_patterns, debug: @debug, quiet: @quiet)) end |
Instance Attribute Details
#search_patterns ⇒ Object (readonly)
Returns the value of attribute search_patterns.
9 10 11 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 9 def search_patterns @search_patterns end |
Instance Method Details
#data_type_aliases ⇒ Object
43 44 45 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 43 def data_type_aliases @data_type_aliases ||= all_to_h YARD::Registry.all(:puppet_data_type_alias) end |
#data_types ⇒ Object
39 40 41 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 39 def data_types @data_types ||= all_to_h YARD::Registry.all(:puppet_data_types) end |
#debug? ⇒ Boolean
20 21 22 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 20 def debug? !!@debug end |
#defined_types ⇒ Object
47 48 49 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 47 def defined_types @defined_types ||= all_to_h YARD::Registry.all(:puppet_defined_type) end |
#find_resource(resource_name) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 28 def find_resource(resource_name) to_h.each do |_, resources| res = resources.find { |r| r[:name] == resource_name.to_sym } return res if res end end |
#providers ⇒ Object
55 56 57 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 55 def providers @providers ||= all_to_h YARD::Registry.all(:puppet_provider) end |
#puppet_classes ⇒ Object
35 36 37 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 35 def puppet_classes @puppet_classes ||= all_to_h YARD::Registry.all(:puppet_class) end |
#puppet_functions ⇒ Object
59 60 61 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 59 def puppet_functions @puppet_functions ||= all_to_h YARD::Registry.all(:puppet_function) end |
#puppet_plans ⇒ Object
67 68 69 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 67 def puppet_plans @puppet_plans ||= all_to_h YARD::Registry.all(:puppet_plan) end |
#puppet_tasks ⇒ Object
63 64 65 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 63 def puppet_tasks @puppet_tasks ||= all_to_h YARD::Registry.all(:puppet_task) end |
#quiet? ⇒ Boolean
24 25 26 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 24 def quiet? !!@quiet end |
#resource_types ⇒ Object
51 52 53 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 51 def resource_types @resource_types ||= all_to_h YARD::Registry.all(:puppet_type) end |
#to_h ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/abide_dev_utils/puppet_strings.rb', line 71 def to_h { puppet_classes: puppet_classes, data_types: data_types, data_type_aliases: data_type_aliases, defined_types: defined_types, resource_types: resource_types, providers: providers, puppet_functions: puppet_functions, puppet_tasks: puppet_tasks, puppet_plans: puppet_plans, } end |