source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/json_spec.rb | Ruby | apache-2.0 | 90 | main | 10,841 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/json'
require 'tempfile'
describe PuppetStrings::Json do
before do
# Populate the YARD registry with both Puppet and Ruby source
expect(YARD::Parser::SourceParser.parse_string(<<~SOURCE, :puppet).enumerator.length).to eq(2)
# ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/util_spec.rb | Ruby | apache-2.0 | 90 | main | 1,884 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Util do
subject(:spec_subject) { described_class }
describe 'scrub_string' do
it 'removes `%Q` and its brackets from a string' do
str = '%Q{this is a test string}'
expect(spec_subject.s... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/code_objects/task_spec.rb | Ruby | apache-2.0 | 90 | main | 3,092 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard/code_objects/task'
require 'puppet-strings/yard/parsers/json/task_statement'
describe PuppetStrings::Yard::CodeObjects::Task do
subject(:spec_subject) { described_class.new(statement) }
let(:source) { <<~SOURCE }
{
"descri... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/parsers/json/task_statement_spec.rb | Ruby | apache-2.0 | 90 | main | 1,526 | # frozen_string_literal: true
require 'spec_helper'
describe PuppetStrings::Yard::Parsers::JSON::TaskStatement do
subject(:spec_subject) { described_class.new(json, source, 'test.json') }
let(:source) { <<~SOURCE }
{
"description": "Allows you to backup your database to local file.",
"input_metho... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/parsers/json/parser_spec.rb | Ruby | apache-2.0 | 90 | main | 1,922 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Parsers::JSON::Parser do
subject(:spec_subject) { described_class.new(source, file) }
let(:file) { 'test.json' }
describe 'initialization of the parser' do
let(:source) { '{}' }
it 'stores ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb | Ruby | apache-2.0 | 90 | main | 12,336 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Parsers::Puppet::Parser do
subject(:spec_subject) { described_class.new(source, file) }
let(:file) { 'test.pp' }
describe 'initialization of the parser' do
let(:source) { 'notice hi' }
it '... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/json/task_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 3,224 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::JSON::TaskHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :json)
YARD::Registry.all(:puppet_task)
end
describe 'parsing task metadata with a syn... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 30,353 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Ruby::FunctionHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :ruby)
YARD::Registry.all(:puppet_function)
end
describe 'parsing source without a... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/ruby/type_extras_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 2,159 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Ruby::TypeExtrasHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :ruby)
YARD::Registry.all(:puppet_type)
end
describe 'parsing source with newpro... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/ruby/data_type_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 22,407 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
class NullLogger
def write(_message); end
end
describe PuppetStrings::Yard::Handlers::Ruby::DataTypeHandler, if: TEST_PUPPET_DATATYPES do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :ruby)
YARD... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/ruby/rsapi_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 9,091 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Ruby::RsapiHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :ruby)
YARD::Registry.all(:puppet_type)
end
describe 'parsing source without a type d... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 12,173 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Ruby::TypeHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :ruby)
YARD::Registry.all(:puppet_type)
end
describe 'parsing source without a type de... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 5,478 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Ruby::ProviderHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :ruby)
YARD::Registry.all(:puppet_provider)
end
describe 'parsing source without a... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 8,037 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Puppet::DefinedTypeHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :puppet)
YARD::Registry.all(:puppet_defined_type)
end
describe 'parsing sourc... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/puppet/data_type_alias_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 2,302 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Puppet::DataTypeAliasHandler, if: TEST_PUPPET_DATATYPES do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :puppet)
YARD::Registry.all(:puppet_data_type_alias)
... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 12,242 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
# Limit this spec to Puppet 4.1+ (when functions in Puppet were implemented)
describe PuppetStrings::Yard::Handlers::Puppet::FunctionHandler, if: TEST_PUPPET_FUNCTIONS do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb | Ruby | apache-2.0 | 90 | main | 7,318 | # frozen_string_literal: true
require 'spec_helper'
require 'puppet-strings/yard'
describe PuppetStrings::Yard::Handlers::Puppet::ClassHandler do
subject(:spec_subject) do
YARD::Parser::SourceParser.parse_string(source, :puppet)
YARD::Registry.all(:puppet_class)
end
describe 'parsing source without a c... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | spec/unit/puppet-strings/markdown/base_spec.rb | Ruby | apache-2.0 | 90 | main | 3,905 | # frozen_string_literal: true
require 'spec_helper'
describe PuppetStrings::Markdown::Base do
context 'basic class' do
before do
YARD::Parser::SourceParser.parse_string(<<~SOURCE, :puppet)
# An overview
# @api private
# @summary A simple class.
# @deprecated No longer suppo... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings.rb | Ruby | apache-2.0 | 90 | main | 3,083 | # frozen_string_literal: true
# The root module for Puppet Strings.
module PuppetStrings
# The glob patterns used to search for files to document.
DEFAULT_SEARCH_PATTERNS = ['manifests/**/*.pp', 'functions/**/*.pp', 'types/**/*.pp', 'lib/**/*.rb', 'tasks/*.json', 'plans/**/*.pp'].freeze
# Generates documentatio... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet/face/strings.rb | Ruby | apache-2.0 | 90 | main | 5,697 | # frozen_string_literal: true
require 'puppet/face'
# Implements the 'puppet strings' interface.
Puppet::Face.define(:strings, '0.0.1') do # rubocop:disable Metrics/BlockLength
summary 'Generate Puppet module documentation with YARD.'
action(:generate) do
default
option '--format OUTPUT_FORMAT' do
... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/tasks.rb | Ruby | apache-2.0 | 90 | main | 332 | # frozen_string_literal: true
require 'rake'
require 'rake/tasklib'
# Ensure PuppetStrings is loaded.
module PuppetStrings end
# The module for Puppet Strings rake tasks.
module PuppetStrings::Tasks
require 'puppet-strings/tasks/generate'
require 'puppet-strings/tasks/gh_pages'
require 'puppet-strings/tasks/va... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/json.rb | Ruby | apache-2.0 | 90 | main | 1,448 | # frozen_string_literal: true
require 'json'
# The module for JSON related functionality.
module PuppetStrings::Json
# Renders the current YARD registry as JSON to the given file (or STDOUT if nil).
# @param [String] file The path to the output file to render the registry to. If nil, output will be to STDOUT.
#... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/describe.rb | Ruby | apache-2.0 | 90 | main | 3,364 | # frozen_string_literal: true
require 'json'
require 'puppet-strings/json'
# The module for command line documentation related functionality.
module PuppetStrings::Describe
# Renders requested types or a summarized list in the current YARD registry to STDOUT.
# @param [Array] describe_types The list of names of t... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown.rb | Ruby | apache-2.0 | 90 | main | 2,339 | # frozen_string_literal: true
require 'puppet-strings/json'
# module for parsing Yard Registries and generating markdown
module PuppetStrings::Markdown
require_relative 'markdown/puppet_class'
require_relative 'markdown/function'
require_relative 'markdown/defined_type'
require_relative 'markdown/data_type'
... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard.rb | Ruby | apache-2.0 | 90 | main | 4,222 | # frozen_string_literal: true
require 'yard'
# Module for YARD related functionality.
module PuppetStrings::Yard
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/handlers'
require 'puppet-strings/yard/tags'
require 'puppet-strings/yard/parsers'
require 'puppet-strings/monkey_patches/d... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/monkey_patches/display_object_command.rb | Ruby | apache-2.0 | 90 | main | 492 | # frozen_string_literal: true
# Monkey patch URL decoding in object displays. Usually :: is interpreted as a
# namespace, but this is disabled in our base object, and so instead gets
# URL-encoded.
require 'yard/server/commands/display_object_command'
# Monkey patch YARD::Server::Commands::DisplayObjectCommand object... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/tasks/gh_pages.rb | Ruby | apache-2.0 | 90 | main | 2,379 | # frozen_string_literal: true
require 'English'
require 'puppet-strings/tasks'
namespace :strings do
namespace :gh_pages do
task :checkout do
if Dir.exist?('doc')
raise "The 'doc' directory (#{File.expand_path('doc')}) is not a Git repository! Remove it and run the Rake task again." unless Dir.exi... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/tasks/generate.rb | Ruby | apache-2.0 | 90 | main | 2,154 | # frozen_string_literal: true
require 'puppet-strings'
# Implements the strings:generate task.
namespace :strings do
desc 'Generate Puppet documentation with YARD.'
task :generate, [:patterns, :debug, :backtrace, :markup, :json, :markdown, :yard_args] do |_t, args|
patterns = args[:patterns]
patterns = pa... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/tasks/validate.rb | Ruby | apache-2.0 | 90 | main | 1,035 | # frozen_string_literal: true
require 'puppet-strings'
require 'tempfile'
namespace :strings do
namespace :validate do
desc 'Validate the reference is up to date'
task :reference, [:patterns, :debug, :backtrace] do |_t, args|
filename = 'REFERENCE.md'
unless File.exist?(filename)
warn "... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/tags.rb | Ruby | apache-2.0 | 90 | main | 406 | # frozen_string_literal: true
# The module for custom YARD tags.
module PuppetStrings::Yard::Tags
require 'puppet-strings/yard/tags/factory'
require 'puppet-strings/yard/tags/parameter_directive'
require 'puppet-strings/yard/tags/property_directive'
require 'puppet-strings/yard/tags/overload_tag'
require 'pu... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/util.rb | Ruby | apache-2.0 | 90 | main | 3,262 | # frozen_string_literal: true
require 'puppet/util'
# The module for various puppet-strings utility helpers.
module PuppetStrings::Yard::Util
# Trims indentation from trailing whitespace and removes ruby literal quotation
# syntax `%Q{}` and `%{q}` from parsed strings.
# @param [String] str The string to scrub.... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers.rb | Ruby | apache-2.0 | 90 | main | 1,102 | # frozen_string_literal: true
# The module for custom YARD handlers.
module PuppetStrings::Yard::Handlers
# The module for custom Ruby YARD handlers.
module Ruby
require 'puppet-strings/yard/handlers/ruby/data_type_handler'
require 'puppet-strings/yard/handlers/ruby/type_handler'
require 'puppet-string... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects.rb | Ruby | apache-2.0 | 90 | main | 601 | # frozen_string_literal: true
# The module for custom YARD code objects.
module PuppetStrings::Yard::CodeObjects
require 'puppet-strings/yard/code_objects/class'
require 'puppet-strings/yard/code_objects/data_type'
require 'puppet-strings/yard/code_objects/data_type_alias'
require 'puppet-strings/yard/code_obj... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/parsers.rb | Ruby | apache-2.0 | 90 | main | 375 | # frozen_string_literal: true
# The module for custom YARD parsers.
module PuppetStrings::Yard::Parsers
# The module for custom YARD parsers for JSON.
module JSON
require 'puppet-strings/yard/parsers/json/parser'
end
# The module for custom YARD parsers for the Puppet language.
module Puppet
require... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/layout/html/setup.rb | Ruby | apache-2.0 | 90 | main | 6,378 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
case object
when '_index.html'
@page_title = options.title
sections :layout, [:index, [:listing, %i[classes data_types defined_types types providers functions tasks plans files objects]]]
else
super
end
end
# Rende... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/puppet_plan/html/setup.rb | Ruby | apache-2.0 | 90 | main | 303 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :source
end
# Renders the box_info section.
# @return [String] Returns the rendered section.
def box_info
erb(:box_info)
end |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/puppet_data_type/html/setup.rb | Ruby | apache-2.0 | 90 | main | 377 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :method_details_list, [T('method_details')], :source
end
def method_listing
sort_listing(object.functions)
end
def sort_listing(list)
list.... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/tags/setup.rb | Ruby | apache-2.0 | 90 | main | 591 | # frozen_string_literal: true
# Called to return parameter tags.
# @return [Array<YARD::Tag>] Returns the parameter tags if the object should have parameters.
def param
tag(:param) if
%i[method puppet_class puppet_data_type puppet_defined_type puppet_function puppet_task puppet_plan].include?(object.type)
end
#... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/puppet_class/html/setup.rb | Ruby | apache-2.0 | 90 | main | 418 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :source
end
# Renders the box_info section.
# @return [String] Returns the rendered section.
def box_info
@subclasses = Registry.all(:puppet_c... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/puppet_task/html/setup.rb | Ruby | apache-2.0 | 90 | main | 459 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
sections :header, :box_info, T('tags'), :overview, :input, :parameters
end
def json
object.statement.json
end
def description
json['description']
end
# Renders the parameters section.
# @return [String] Returns the rendered se... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/puppet_provider/html/setup.rb | Ruby | apache-2.0 | 90 | main | 723 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
sections :header, :box_info, :summary, :overview, T('tags'), :features, :confines, :defaults, :commands
end
# Renders the confines section.
# @return [String] Returns the rendered section.
def confines
@title = 'Confines'
@colle... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/fulldoc/html/setup.rb | Ruby | apache-2.0 | 90 | main | 2,760 | # frozen_string_literal: true
# Generates the searchable Puppet class list.
# @return [void]
def generate_puppet_class_list
@items = Registry.all(:puppet_class).sort_by { |c| c.name.to_s }
@list_title = 'Puppet Class List'
@list_type = 'puppet_class'
generate_list_contents
end
# Generates the searchable Puppe... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/setup.rb | Ruby | apache-2.0 | 90 | main | 612 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
sections :header, :box_info, :summary, :overview, :alias_of, :note, :todo, :deprecated, T('tags'), :source
end
# Renders the alias_of section.
# @return [String] Returns the rendered section.
def alias_of
# Properties are the same... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb | Ruby | apache-2.0 | 90 | main | 1,126 | # frozen_string_literal: true
# Initializes the template.
# @return [void]
def init
sections :header, :box_info, :summary, :overview, :note, :todo, :deprecated, T('tags'), :properties, :parameters, :features
end
# Renders the box_info section.
# @return [String] Returns the rendered section.
def box_info
@provide... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/tags/factory.rb | Ruby | apache-2.0 | 90 | main | 735 | # frozen_string_literal: true
require 'yard/tags/default_factory'
require 'puppet-strings/yard/tags/enum_tag'
# Factory for creating tags.
class PuppetStrings::Yard::Tags::Factory < YARD::Tags::DefaultFactory
# Parses tag text and creates a new enum tag type. Modeled after
# the parse_tag_with_options method in Y... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/tags/property_directive.rb | Ruby | apache-2.0 | 90 | main | 786 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects'
# Implements a parameter directive (e.g. #@!puppet.type.property) for documenting Puppet resource types.
class PuppetStrings::Yard::Tags::PropertyDirective < YARD::Tags::Directive
# Called to invoke the directive.
# @return [void]
def call... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/tags/enum_tag.rb | Ruby | apache-2.0 | 90 | main | 414 | # frozen_string_literal: true
require 'yard/tags/option_tag'
# Implements an enum tag for describing enumerated value data types
class PuppetStrings::Yard::Tags::EnumTag < YARD::Tags::OptionTag
# Registers the tag with YARD.
# @return [void]
def self.register!
YARD::Tags::Library.define_tag('puppet.enum', :... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/tags/parameter_directive.rb | Ruby | apache-2.0 | 90 | main | 788 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects'
# Implements a parameter directive (e.g. #@!puppet.type.param) for documenting Puppet resource types.
class PuppetStrings::Yard::Tags::ParameterDirective < YARD::Tags::Directive
# Called to invoke the directive.
# @return [void]
def call
... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/tags/overload_tag.rb | Ruby | apache-2.0 | 90 | main | 4,027 | # frozen_string_literal: true
# Implements an overload tag for Puppet functions
#
# This differs from Yard's overload tag in that the signatures are formatted according to Puppet language rules.
class PuppetStrings::Yard::Tags::OverloadTag < YARD::Tags::Tag
attr_reader :parameters, :docstring
# Initializes the ov... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/tags/summary_tag.rb | Ruby | apache-2.0 | 90 | main | 305 | # frozen_string_literal: true
# Implements a summary tag for general purpose short descriptions
class PuppetStrings::Yard::Tags::SummaryTag < YARD::Tags::Tag
# Registers the tag with YARD.
# @return [void]
def self.register!
YARD::Tags::Library.define_tag('puppet.summary', :summary)
end
end |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/helpers.rb | Ruby | apache-2.0 | 90 | main | 428 | # frozen_string_literal: true
# Implements a helper that logs a warning if a summary tag has more than 140 characters
module PuppetStrings::Yard::Handlers::Helpers
def self.validate_summary_tag(object)
return unless object.has_tag?(:summary) && object.tag(:summary).text.length > 140
log.warn "The length of ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/json/base.rb | Ruby | apache-2.0 | 90 | main | 251 | # frozen_string_literal: true
# Implements the base class for all JSON handlers.
class PuppetStrings::Yard::Handlers::JSON::Base < YARD::Handlers::Base
def self.handles?(statement)
handlers.any? { |handler| statement.is_a?(handler) }
end
end |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/json/task_handler.rb | Ruby | apache-2.0 | 90 | main | 962 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/json/base'
require 'puppet-strings/yard/parsers'
require 'puppet-strings/yard/parsers/json/parser'
# Implements the handler for JSON task metadata.
class PuppetStrings::Yard::Handlers::JSON::TaskHandler < PuppetStrings::Yard::Handlers::JSON::Base
h... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/puppet/data_type_alias_handler.rb | Ruby | apache-2.0 | 90 | main | 1,122 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/puppet/base'
require 'puppet-strings/yard/parsers'
require 'puppet-strings/yard/code_objects'
# Implements the handler for Puppet Data Type Alias.
class PuppetStrings::Yard::Handlers::Puppet::DataTypeAli... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/puppet/base.rb | Ruby | apache-2.0 | 90 | main | 2,124 | # frozen_string_literal: true
# Implements the base handler for Puppet language handlers.
class PuppetStrings::Yard::Handlers::Puppet::Base < YARD::Handlers::Base
# Determine sif the handler handles the given statement.
# @param statement The statement that was parsed.
# @return [Boolean] Returns true if the sta... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/puppet/class_handler.rb | Ruby | apache-2.0 | 90 | main | 1,148 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/puppet/base'
require 'puppet-strings/yard/parsers'
require 'puppet-strings/yard/code_objects'
# Implements the handler for Puppet classes.
class PuppetStrings::Yard::Handlers::Puppet::ClassHandler < Pupp... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb | Ruby | apache-2.0 | 90 | main | 1,186 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/puppet/base'
require 'puppet-strings/yard/parsers'
require 'puppet-strings/yard/code_objects'
# Implements the handler for Puppet defined types.
class PuppetStrings::Yard::Handlers::Puppet::DefinedTypeHa... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/puppet/function_handler.rb | Ruby | apache-2.0 | 90 | main | 2,036 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/puppet/base'
require 'puppet-strings/yard/parsers'
require 'puppet-strings/yard/code_objects'
# Implements the handler for Puppet classes.
class PuppetStrings::Yard::Handlers::Puppet::FunctionHandler < P... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/puppet/plan_handler.rb | Ruby | apache-2.0 | 90 | main | 1,144 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/puppet/base'
require 'puppet-strings/yard/parsers'
require 'puppet-strings/yard/code_objects'
# Implements the handler for Puppet classes.
class PuppetStrings::Yard::Handlers::Puppet::PlanHandler < Puppe... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/provider_handler.rb | Ruby | apache-2.0 | 90 | main | 4,927 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/ruby/base'
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/util'
# Implements the handler for Puppet providers written in Ruby.
class PuppetStrings::Yard::Handlers::Ruby::Provider... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/type_handler.rb | Ruby | apache-2.0 | 90 | main | 3,469 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/ruby/type_base'
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/util'
# Implements the handler for Puppet resource types written in Ruby.
class PuppetStrings::Yard::Handlers::Ruby... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb | Ruby | apache-2.0 | 90 | main | 4,790 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/ruby/base'
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/util'
# Implements the handler for Puppet resource types written in Ruby.
class PuppetStrings::Yard::Handlers::Ruby::Rsa... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb | Ruby | apache-2.0 | 90 | main | 2,512 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/ruby/type_base'
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/util'
# Implements the handler for Puppet resource type newparam/newproperty/ensurable calls written in Ruby.
class... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb | Ruby | apache-2.0 | 90 | main | 15,935 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/ruby/base'
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/util'
# Implements the handler for Puppet Data Types written in Ruby.
class PuppetStrings::Yard::Handlers::Ruby::DataTyp... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/type_base.rb | Ruby | apache-2.0 | 90 | main | 5,234 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/ruby/base'
# Base class for all Puppet resource type handlers.
class PuppetStrings::Yard::Handlers::Ruby::TypeBase < PuppetStrings::Yard::Handlers::Ruby::Base
protected
def get_type_yard_object(name)
# Have to guess the path - if we create t... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/base.rb | Ruby | apache-2.0 | 90 | main | 2,143 | # frozen_string_literal: true
require 'ripper'
# Implements the base handler for Ruby language handlers.
class PuppetStrings::Yard::Handlers::Ruby::Base < YARD::Handlers::Ruby::Base
# A regular expression for detecting the start of a Ruby heredoc.
# Note: the first character of the heredoc start may have been cut... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/handlers/ruby/function_handler.rb | Ruby | apache-2.0 | 90 | main | 12,358 | # frozen_string_literal: true
require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/ruby/base'
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/util'
# Implements the handler for Puppet functions written in Ruby.
class PuppetStrings::Yard::Handlers::Ruby::Function... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/parsers/json/task_statement.rb | Ruby | apache-2.0 | 90 | main | 692 | # frozen_string_literal: true
module PuppetStrings::Yard::Parsers::JSON
# Represents the Puppet Task statement.
class TaskStatement
attr_reader :line, :comments_range, :json, :file, :source, :docstring
def initialize(json, source, file)
@file = file
@source = source
@json = json
@l... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/parsers/json/parser.rb | Ruby | apache-2.0 | 90 | main | 1,086 | # frozen_string_literal: true
require 'puppet-strings/yard/parsers/json/task_statement'
# Implementas a JSON parser.
class PuppetStrings::Yard::Parsers::JSON::Parser < YARD::Parser::Base
attr_reader :file, :source
# Initializes the parser.
# @param [String] source The source being parsed.
# @param [String] f... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/parsers/puppet/statement.rb | Ruby | apache-2.0 | 90 | main | 6,102 | # frozen_string_literal: true
require 'puppet'
require 'puppet/pops'
module PuppetStrings::Yard::Parsers::Puppet
# Represents the base Puppet language statement.
class Statement
# The pattern for parsing docstring comments.
COMMENT_REGEX = /^\s*#+\s?/
attr_reader :source, :file, :line, :docstring, :c... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/parsers/puppet/parser.rb | Ruby | apache-2.0 | 90 | main | 2,667 | # frozen_string_literal: true
require 'puppet'
require 'puppet/pops'
require 'puppet-strings/yard/parsers/puppet/statement'
# Implements the Puppet language parser.
class PuppetStrings::Yard::Parsers::Puppet::Parser < YARD::Parser::Base
attr_reader :file, :source
# Initializes the parser.
# @param [String] sou... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/base.rb | Ruby | apache-2.0 | 90 | main | 672 | # frozen_string_literal: true
# Implements the base code object.
class PuppetStrings::Yard::CodeObjects::Base < YARD::CodeObjects::NamespaceObject
# Allocates a new code object.
# @param [Array] args The arguments to initialize the code object with.
# @return Returns the code object.
def self.new(*args)
# ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/data_type.rb | Ruby | apache-2.0 | 90 | main | 3,101 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
require 'puppet-strings/yard/util'
# Implements the group for Puppet DataTypes.
class PuppetStrings::Yard::CodeObjects::DataTypes < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @return Returns t... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/class.rb | Ruby | apache-2.0 | 90 | main | 2,007 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
# Implements the group for Puppet classes.
class PuppetStrings::Yard::CodeObjects::Classes < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @return Returns the singleton instance of the group.
d... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/group.rb | Ruby | apache-2.0 | 90 | main | 938 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/base'
# Implements the base class for "groups".
#
# A group behaves like a YARD namespace object, but displays differently in the HTML output.
class PuppetStrings::Yard::CodeObjects::Group < PuppetStrings::Yard::CodeObjects::Base
# Gets the sin... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/defined_type.rb | Ruby | apache-2.0 | 90 | main | 1,997 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
# Implements the group for Puppet defined types.
class PuppetStrings::Yard::CodeObjects::DefinedTypes < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @return Returns the singleton instance of the... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/plan.rb | Ruby | apache-2.0 | 90 | main | 1,920 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
# Implements the group for Puppet plans.
class PuppetStrings::Yard::CodeObjects::Plans < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @return Returns the singleton instance of the group.
def s... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/data_type_alias.rb | Ruby | apache-2.0 | 90 | main | 1,907 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
require 'puppet-strings/yard/util'
# Implements the group for Puppet DataTypeAliases.
class PuppetStrings::Yard::CodeObjects::DataTypeAliases < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @retu... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/type.rb | Ruby | apache-2.0 | 90 | main | 6,282 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
require 'puppet-strings/yard/util'
# Implements the group for Puppet resource types.
class PuppetStrings::Yard::CodeObjects::Types < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @return Returns ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/provider.rb | Ruby | apache-2.0 | 90 | main | 2,982 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
# Implements the group for Puppet providers.
class PuppetStrings::Yard::CodeObjects::Providers < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @param [String] type The resource type name for the ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/function.rb | Ruby | apache-2.0 | 90 | main | 3,520 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
# Implements the group for Puppet functions.
class PuppetStrings::Yard::CodeObjects::Functions < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @param [Symbol] type The function type to get the gr... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/yard/code_objects/task.rb | Ruby | apache-2.0 | 90 | main | 1,954 | # frozen_string_literal: true
require 'puppet-strings/yard/code_objects/group'
# Implements the group for Puppet tasks.
class PuppetStrings::Yard::CodeObjects::Tasks < PuppetStrings::Yard::CodeObjects::Group
# Gets the singleton instance of the group.
# @return Returns the singleton instance of the group.
def s... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/resource_type.rb | Ruby | apache-2.0 | 90 | main | 1,350 | # frozen_string_literal: true
require 'puppet-strings/markdown/base'
module PuppetStrings::Markdown
# Generates Markdown for a Puppet Resource Type.
class ResourceType < Base
group_name 'Resource types'
yard_types [:puppet_type]
def initialize(registry)
@template = 'resource_type.erb'
sup... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/puppet_plan.rb | Ruby | apache-2.0 | 90 | main | 392 | # frozen_string_literal: true
require 'puppet-strings/markdown/base'
module PuppetStrings::Markdown
# Generates Markdown for a Puppet Plan.
class PuppetPlan < Base
group_name 'Plans'
yard_types [:puppet_plan]
def initialize(registry)
@template = 'classes_and_defines.erb'
super(registry, '... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/helpers.rb | Ruby | apache-2.0 | 90 | main | 771 | # frozen_string_literal: true
# Helpers for rendering Markdown
module PuppetStrings::Markdown::Helpers
# Formats code as either inline or a block.
#
# Note that this does not do any escaping even if the code contains ` or ```.
#
# @param [String] code The code to format.
# @param [Symbol] type The type of ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/base.rb | Ruby | apache-2.0 | 90 | main | 7,439 | # frozen_string_literal: true
require 'puppet-strings'
require 'puppet-strings/json'
require 'puppet-strings/yard'
require 'puppet-strings/markdown/helpers'
# Implements classes that make elements in a YARD::Registry hash easily accessible for template.
module PuppetStrings::Markdown
# This class makes elements in ... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/data_type.rb | Ruby | apache-2.0 | 90 | main | 925 | # frozen_string_literal: true
require 'puppet-strings/markdown/base'
module PuppetStrings::Markdown
# This class encapsualtes ruby data types and puppet type aliases
class DataType < Base
attr_reader :alias_of, :functions
group_name 'Data types'
yard_types %i[puppet_data_type puppet_data_type_alias]
... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/puppet_task.rb | Ruby | apache-2.0 | 90 | main | 535 | # frozen_string_literal: true
require 'puppet-strings/markdown/base'
module PuppetStrings::Markdown
# Generates Markdown for a Puppet Task.
class PuppetTask < Base
group_name 'Tasks'
yard_types [:puppet_task]
def initialize(registry)
@template = 'puppet_task.erb'
@registry = registry
... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/puppet_class.rb | Ruby | apache-2.0 | 90 | main | 398 | # frozen_string_literal: true
require 'puppet-strings/markdown/base'
module PuppetStrings::Markdown
# Generates Markdown for a Puppet Class.
class PuppetClass < Base
group_name 'Classes'
yard_types [:puppet_class]
def initialize(registry)
@template = 'classes_and_defines.erb'
super(regist... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/function.rb | Ruby | apache-2.0 | 90 | main | 1,210 | # frozen_string_literal: true
require 'puppet-strings/markdown/base'
module PuppetStrings::Markdown
# Generates Markdown for a Puppet Function.
class Function < Base
attr_reader :signatures
group_name 'Functions'
yard_types [:puppet_function]
def initialize(registry)
@template = 'function.... |
github | puppetlabs/puppet-strings | https://github.com/puppetlabs/puppet-strings | lib/puppet-strings/markdown/defined_type.rb | Ruby | apache-2.0 | 90 | main | 425 | # frozen_string_literal: true
require 'puppet-strings/markdown/base'
module PuppetStrings::Markdown
# Generates Markdown for a Puppet Defined Type.
class DefinedType < Base
group_name 'Defined types'
yard_types [:puppet_defined_type]
def initialize(registry)
@template = 'classes_and_defines.erb... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | Rakefile | Ruby | apache-2.0 | 90 | master | 906 | # Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
begin
require 'voxpupuli/test/rake'
rescue LoadError
# only available if gem group test is installed
end
begin
require 'voxpupuli/acceptance/rake'
rescue LoadError
# only available if gem group acceptanc... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | lib/facter/letsencrypt_directory.rb | Ruby | apache-2.0 | 90 | master | 820 | # frozen_string_literal: true
require 'openssl'
require 'pathname'
Facter.add(:letsencrypt_directory) do
confine kernel: %w[FreeBSD Linux OpenBSD]
setcode do
certs = {}
# locate the certificate repository
livedir = ['/etc/letsencrypt/live', '/etc/certbot/live']
.map { |path| Pathname.n... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | lib/facter/certbot_version.rb | Ruby | apache-2.0 | 90 | master | 264 | # frozen_string_literal: true
Facter.add(:certbot_version) do
confine { Facter::Core::Execution.which('certbot') }
setcode do
output = Facter::Core::Execution.execute('certbot --version 2>/dev/null')
output[%r{^certbot (.*)$}, 1] if output
end
end |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | lib/puppet/functions/letsencrypt/letsencrypt_lookup.rb | Ruby | apache-2.0 | 90 | master | 352 | # frozen_string_literal: true
Puppet::Functions.create_function(:'letsencrypt::letsencrypt_lookup') do
def letsencrypt_lookup(common_name)
domain = common_name.split('.', 2)[1]
wildcard = "*.#{domain}"
certs = closure_scope['facts'].fetch('letsencrypt_directory', nil)
certs&.fetch(common_name, certs.... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | spec/spec_helper.rb | Ruby | apache-2.0 | 90 | master | 768 | # frozen_string_literal: true
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
# puppetlabs_spec_helper will set up coverage if the env variable is set.
# We want to do this if lib exists and it hasn't been explicitly set.
ENV['COVERAGE'] ||= 'yes' if Dir.exis... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | spec/spec_helper_acceptance.rb | Ruby | apache-2.0 | 90 | master | 385 | # frozen_string_literal: true
require 'voxpupuli/acceptance/spec_helper_acceptance'
configure_beaker do |host|
# docker image does not provide cron in all cases
case fact_on(host, 'os.family')
when 'Debian'
host.install_package('cron')
when 'RedHat'
host.install_package('crontabs')
host.install_pa... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | spec/type_aliases/cron_monthday_spec.rb | Ruby | apache-2.0 | 90 | master | 331 | # frozen_string_literal: true
require 'spec_helper'
describe 'Letsencrypt::Cron::Monthday' do
describe 'valid handling' do
it { is_expected.to allow_values(1, 31, '1', '31', [], [1, '31']) }
end
describe 'invalid handling' do
it { is_expected.not_to allow_values(0, 32, '', '0', '32', [''], [0, '32']) }... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | spec/type_aliases/cron_minute_spec.rb | Ruby | apache-2.0 | 90 | master | 332 | # frozen_string_literal: true
require 'spec_helper'
describe 'Letsencrypt::Cron::Minute' do
describe 'valid handling' do
it { is_expected.to allow_values(0, 59, '0', '59', [], [0, '59']) }
end
describe 'invalid handling' do
it { is_expected.not_to allow_values(-1, 60, '', '-1', '60', [''], [-1, '60']) ... |
github | voxpupuli/puppet-letsencrypt | https://github.com/voxpupuli/puppet-letsencrypt | spec/type_aliases/cron_hour_spec.rb | Ruby | apache-2.0 | 90 | master | 330 | # frozen_string_literal: true
require 'spec_helper'
describe 'Letsencrypt::Cron::Hour' do
describe 'valid handling' do
it { is_expected.to allow_values(0, 23, '0', '23', [], [0, '23']) }
end
describe 'invalid handling' do
it { is_expected.not_to allow_values(-1, 24, '', '-1', '24', [''], [-1, '24']) }
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.