Class: AbideDevUtils::Sce::Generate::Reference::Strings
- Inherits:
-
Object
- Object
- AbideDevUtils::Sce::Generate::Reference::Strings
- Defined in:
- lib/abide_dev_utils/sce/generate/reference.rb
Overview
Puppet Strings reference object
Constant Summary collapse
- REGISTRY_TYPES =
%i[ root module class puppet_class puppet_data_type puppet_data_type_alias puppet_defined_type puppet_type puppet_provider puppet_function puppet_task puppet_plan ].freeze
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: {}) ⇒ Strings
constructor
A new instance of Strings.
- #providers ⇒ Object
- #puppet_classes ⇒ Object
- #puppet_functions ⇒ Object
- #puppet_plans ⇒ Object
- #puppet_tasks ⇒ Object
- #quiet? ⇒ Boolean
- #registry ⇒ Object
- #resource_types ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(search_patterns: nil, opts: {}) ⇒ Strings
Returns a new instance of Strings.
130 131 132 133 134 135 136 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 130 def initialize(search_patterns: nil, opts: {}) @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.
128 129 130 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 128 def search_patterns @search_patterns end |
Instance Method Details
#data_type_aliases ⇒ Object
165 166 167 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 165 def data_type_aliases @data_type_aliases ||= hashes_for_reg_type(:puppet_data_type_alias) end |
#data_types ⇒ Object
161 162 163 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 161 def data_types @data_types ||= hashes_for_reg_type(:puppet_data_types) end |
#debug? ⇒ Boolean
138 139 140 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 138 def debug? !!@debug end |
#defined_types ⇒ Object
169 170 171 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 169 def defined_types @defined_types ||= hashes_for_reg_type(:puppet_defined_type) end |
#find_resource(resource_name) ⇒ Object
150 151 152 153 154 155 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 150 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
177 178 179 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 177 def providers @providers ||= hashes_for_reg_type(:puppet_provider) end |
#puppet_classes ⇒ Object
157 158 159 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 157 def puppet_classes @puppet_classes ||= hashes_for_reg_type(:puppet_class) end |
#puppet_functions ⇒ Object
181 182 183 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 181 def puppet_functions @puppet_functions ||= hashes_for_reg_type(:puppet_function) end |
#puppet_plans ⇒ Object
189 190 191 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 189 def puppet_plans @puppet_plans ||= hashes_for_reg_type(:puppet_plan) end |
#puppet_tasks ⇒ Object
185 186 187 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 185 def puppet_tasks @puppet_tasks ||= hashes_for_reg_type(:puppet_task) end |
#quiet? ⇒ Boolean
142 143 144 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 142 def quiet? !!@quiet end |
#registry ⇒ Object
146 147 148 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 146 def registry @registry ||= YARD::Registry.all(*REGISTRY_TYPES) end |
#resource_types ⇒ Object
173 174 175 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 173 def resource_types @resource_types ||= hashes_for_reg_type(:puppet_type) end |
#to_h ⇒ Object
193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/abide_dev_utils/sce/generate/reference.rb', line 193 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 |