repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/html_attributes.rb | lib/formtastic/html_attributes.rb | # frozen_string_literal: true
module Formtastic
# @private
module HtmlAttributes
# Returns a namespace passed by option or inherited from parent builders / class configuration
def dom_id_namespace
namespace = options[:custom_namespace]
parent = options[:parent_builder]
case
when n... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/actions.rb | lib/formtastic/actions.rb | # frozen_string_literal: true
module Formtastic
module Actions
extend ActiveSupport::Autoload
autoload :Base
autoload :Buttonish
eager_autoload do
autoload :InputAction
autoload :LinkAction
autoload :ButtonAction
end
end
end
| ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/deprecation.rb | lib/formtastic/deprecation.rb | # frozen_string_literal: true
require 'active_support/deprecation'
module Formtastic
Deprecation = ActiveSupport::Deprecation.new("5.0.0", "Formtastic")
end
| ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/version.rb | lib/formtastic/version.rb | # frozen_string_literal: true
module Formtastic
VERSION = "5.0.0"
end
| ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/localizer.rb | lib/formtastic/localizer.rb | # frozen_string_literal: true
module Formtastic
# Implementation for looking up localized values within Formtastic using I18n, if no
# explicit value (like the `:label` option) is set and I18n-lookups are enabled in the
# configuration.
#
# You can subclass this to implement your own Localizer, and configure ... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers.rb | lib/formtastic/helpers.rb | # frozen_string_literal: true
module Formtastic
module Helpers
autoload :ActionHelper, 'formtastic/helpers/action_helper'
autoload :ActionsHelper, 'formtastic/helpers/actions_helper'
autoload :ErrorsHelper, 'formtastic/helpers/errors_helper'
autoload :FieldsetWrapper, 'formtastic/helpers/fieldset_wrap... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/input_class_finder.rb | lib/formtastic/input_class_finder.rb | # frozen_string_literal: true
module Formtastic
# Uses the {Formtastic::NamespacedClassFinder} to look up input class names.
#
# See {Formtastic::FormBuilder#namespaced_input_class} for details.
#
class InputClassFinder < NamespacedClassFinder
# @param builder [FormBuilder]
def initialize(builder)
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/i18n.rb | lib/formtastic/i18n.rb | # encoding: utf-8
# frozen_string_literal: true
module Formtastic
# @private
module I18n
DEFAULT_SCOPE = [:formtastic].freeze
DEFAULT_VALUES = YAML.load_file(File.expand_path("../../locale/en.yml", __FILE__))["en"]["formtastic"].freeze
SCOPES = [
'%{model}.%{nested_model}.%{action}.%{attribute... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/form_builder.rb | lib/formtastic/form_builder.rb | # frozen_string_literal: true
module Formtastic
class FormBuilder < ActionView::Helpers::FormBuilder
# Defines a new configurable option
# @param [Symbol] name the configuration name
# @param [Object] default the configuration default value
# @private
#
# @!macro [new] configure
# @!sco... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/namespaced_class_finder.rb | lib/formtastic/namespaced_class_finder.rb | # frozen_string_literal: true
module Formtastic
# This class implements class resolution in a namespace chain. It
# is used both by Formtastic::Helpers::InputHelper and
# Formtastic::Helpers::ActionHelper to look up action and input classes.
#
# @example Implementing own class finder
# # You can implement... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/action_class_finder.rb | lib/formtastic/action_class_finder.rb | # frozen_string_literal: true
module Formtastic
# Uses the {NamespacedClassFinder} to look up action class names.
#
# See {Formtastic::Helpers::ActionHelper#namespaced_action_class} for details.
#
class ActionClassFinder < NamespacedClassFinder
# @param builder [FormBuilder]
def initialize(builder)
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/localized_string.rb | lib/formtastic/localized_string.rb | # frozen_string_literal: true
module Formtastic
module LocalizedString
def model_name
@object.present? ? @object.class.name : @object_name.to_s.classify
end
protected
def localized_string(key, value, type, options = {}) # @private
current_builder = respond_to?(:builder) ? builder : self... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs.rb | lib/formtastic/inputs.rb | # frozen_string_literal: true
module Formtastic
module Inputs
extend ActiveSupport::Autoload
autoload :Base
autoload :Basic
autoload :Timeish
eager_autoload do
autoload :BooleanInput
autoload :CheckBoxesInput
autoload :ColorInput
autoload :CountryInput
autoload :Dat... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/form_helper.rb | lib/formtastic/helpers/form_helper.rb | # frozen_string_literal: true
module Formtastic
module Helpers
# FormHelper provides a handful of wrappers around Rails' built-in form helpers methods to set
# the `:builder` option to `Formtastic::FormBuilder` and apply some class names to the `<form>`
# tag.
#
# The following methods are wrappe... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/errors_helper.rb | lib/formtastic/helpers/errors_helper.rb | # frozen_string_literal: true
module Formtastic
module Helpers
module ErrorsHelper
include Formtastic::Helpers::FileColumnDetection
include Formtastic::Helpers::Reflection
include Formtastic::LocalizedString
INLINE_ERROR_TYPES = [:sentence, :list, :first]
# Generates an unordered l... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/fieldset_wrapper.rb | lib/formtastic/helpers/fieldset_wrapper.rb | # frozen_string_literal: true
module Formtastic
module Helpers
# @private
module FieldsetWrapper
protected
# Generates a fieldset and wraps the content in an ordered list. When working
# with nested attributes, it allows %i as interpolation option in :name. So you can do:
#
# ... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/file_column_detection.rb | lib/formtastic/helpers/file_column_detection.rb | # frozen_string_literal: true
module Formtastic
module Helpers
# @private
module FileColumnDetection
def is_file?(method, options = {})
@files ||= {}
@files[method] ||= (options[:as].present? && options[:as] == :file) || begin
file = @object.send(method) if @object && @object.... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/inputs_helper.rb | lib/formtastic/helpers/inputs_helper.rb | # frozen_string_literal: true
module Formtastic
module Helpers
# {#inputs} is used to wrap a series of form items in a `<fieldset>` and `<ol>`, with each item
# in the list containing the markup representing a single {#input}.
#
# {#inputs} is usually called with a block containing a series of {#inpu... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/action_helper.rb | lib/formtastic/helpers/action_helper.rb | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Formtastic
module Helpers
module ActionHelper
# Renders an action for the form (such as a subit/reset button, or a cancel link).
#
# Each action is wrapped in an `<li class="action">` tag with other classes added based on the
# t... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/input_helper.rb | lib/formtastic/helpers/input_helper.rb | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Formtastic
module Helpers
# {#input} is used to render all content (labels, form widgets, error messages, hints, etc) for
# a single form input (or field), usually representing a single method or attribute on the
# form's object or model.
#... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/reflection.rb | lib/formtastic/helpers/reflection.rb | # frozen_string_literal: true
module Formtastic
module Helpers
# @private
module Reflection
# If an association method is passed in (f.input :author) try to find the
# reflection object.
def reflection_for(method) # @private
if @object.class.respond_to?(:reflect_on_association)
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/enum.rb | lib/formtastic/helpers/enum.rb | # frozen_string_literal: true
module Formtastic
module Helpers
# @private
module Enum
# Returns the enum (if defined) for the given method
def enum_for(method) # @private
if @object.respond_to?(:defined_enums)
@object.defined_enums[method.to_s]
end
end
end
end... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/helpers/actions_helper.rb | lib/formtastic/helpers/actions_helper.rb | # frozen_string_literal: true
module Formtastic
module Helpers
# ActionsHelper encapsulates the responsibilties of the {#actions} DSL for acting on
# (submitting, cancelling, resetting) forms.
#
# {#actions} is a block helper used to wrap the form's actions (buttons, links) in a
# `<fieldset>` a... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/actions/input_action.rb | lib/formtastic/actions/input_action.rb | # frozen_string_literal: true
module Formtastic
module Actions
# Outputs an `<input type="submit">` or `<input type="reset">` wrapped in the standard `<li>`
# wrapper. This the default for `:submit` and `:reset` actions, but `:as => :button` is also
# available as an alternative.
#
# @example The `:as` can... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/actions/buttonish.rb | lib/formtastic/actions/buttonish.rb | # frozen_string_literal: true
module Formtastic
module Actions
module Buttonish
def supported_methods
[:submit, :reset]
end
def extra_button_html_options
{
:type => method
}
end
end
end
end | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/actions/button_action.rb | lib/formtastic/actions/button_action.rb | # frozen_string_literal: true
module Formtastic
module Actions
# Outputs a `<button type="submit">` or `<button type="reset">` wrapped in the standard `<li>`
# wrapper. This is an alternative choice for `:submit` and `:reset` actions, which render with
# `<input type="submit">` and `<input type="reset">` by de... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/actions/link_action.rb | lib/formtastic/actions/link_action.rb | # frozen_string_literal: true
module Formtastic
module Actions
# Outputs a link wrapped in the standard `<li>` wrapper. This the default for `:cancel` actions.
# The link's URL defaults to Rails' built-in `:back` macro (the HTTP referrer, or Javascript for the
# browser's history), but can be altered with the `... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/actions/base.rb | lib/formtastic/actions/base.rb | # frozen_string_literal: true
module Formtastic
module Actions
module Base
include Formtastic::LocalizedString
attr_accessor :builder, :template, :object, :object_name, :method, :options
def initialize(builder, template, object, object_name, method, options)
@builder = builder
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/date_select_input.rb | lib/formtastic/inputs/date_select_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a series of select boxes for the fragments that make up a date (year, month, day).
#
# @see Formtastic::Inputs::Base::Timeish Timeish module for documentation of date, time and datetime input options.
class DateSelectInput
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/check_boxes_input.rb | lib/formtastic/inputs/check_boxes_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# A CheckBoxes input is used to render a series of checkboxes. This is an alternative input choice
# for `has_many` or `has_and_belongs_to_many` associations like a `Post` belonging to many
# `categories` (by default, a {SelectInput `:select`}... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/number_input.rb | lib/formtastic/inputs/number_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="number">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for all database columns of the type `:float`
# and `:decimal`, as well as `:integer` columns that are... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/url_input.rb | lib/formtastic/inputs/url_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="url">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for all attributes matching
# `/^url$|^website$|_url$/`, but can be applied to any text-like input with `... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/radio_input.rb | lib/formtastic/inputs/radio_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# A radio input is used to render a series of radio inputs. This is an alternative input choice
# for `belongs_to` associations like a `Post` belonging to a `Section` or an `Author`, or any
# case where the user needs to make a single selectio... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/country_input.rb | lib/formtastic/inputs/country_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a country select input, wrapping around a regular country_select helper.
# Rails doesn't come with a `country_select` helper by default any more, so you'll need to do
# one of the following:
#
# * install the [country_select](... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/datetime_picker_input.rb | lib/formtastic/inputs/datetime_picker_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="datetime-local">` (or
# `<input type="datetime">`) wrapped in the standard `<li>` wrapper. This is an alternative to
# `:date_select` for `:date`, `:time`, `:datetime` database colu... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/string_input.rb | lib/formtastic/inputs/string_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a `<input type="text">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for database columns of the `:string` type,
# and is the default choice for all inputs when no other logical i... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/datetime_select_input.rb | lib/formtastic/inputs/datetime_select_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a series of select boxes for the fragments that make up a date and time (year, month, day, hour, minute, second).
#
# @see Formtastic::Inputs::Base::Timeish Timeish module for documentation of date, time and datetime input options.
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/time_zone_input.rb | lib/formtastic/inputs/time_zone_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a `<label>` with a `<select>` containing a series of time zones (using Rails' own
# `time_zone_select` helper), wrapped in the standard `<li>` wrapper.
# This is the default input choice for attributes matching /time_zone/, but can ... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/range_input.rb | lib/formtastic/inputs/range_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="range">` wrapped in the standard
# `<li>` wrapper. This is an alternative input choice to a number input.
#
# Sensible default for the `min`, `max` and `step` attributes are found... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/color_input.rb | lib/formtastic/inputs/color_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="color">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for attributes with a name matching
# `/color/`, but can be applied to any text-like input with `:as =>... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/datalist_input.rb | lib/formtastic/inputs/datalist_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a label and a text field, along with a datalist tag
# datalist tag provides a list of options which drives a simple autocomplete
# on the text field. This is a HTML5 feature, more info can be found at
# {https://developer.mozilla.... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base.rb | lib/formtastic/inputs/base.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
attr_accessor :builder, :template, :object, :object_name, :method, :options
def initialize(builder, template, object, object_name, method, options)
@builder = builder
@template = template
@object = obje... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/search_input.rb | lib/formtastic/inputs/search_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="search">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for attributes with a name matching
# `/^search$/`, but can be applied to any text-like input with `:a... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/boolean_input.rb | lib/formtastic/inputs/boolean_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Boolean inputs are used to render an input for a single checkbox, typically for attributes
# with a simple yes/no or true/false value. Boolean inputs are used by default for boolean
# database columns.
#
# @example Full form context a... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/file_input.rb | lib/formtastic/inputs/file_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a `<input type="file">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for objects with attributes that appear
# to be for file uploads, by detecting some common method names used b... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/time_picker_input.rb | lib/formtastic/inputs/time_picker_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="time">` wrapped in the standard
# `<li>` wrapper. This is an alternative to `:time_select` for `:date`, `:time`, `:datetime`
# database columns. You can use this input with `:as => :... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/date_picker_input.rb | lib/formtastic/inputs/date_picker_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="date">` wrapped in the standard
# `<li>` wrapper. This is an alternative to `:date_select` for `:date`, `:time`, `:datetime`
# database columns. You can use this input with `:as => :... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/email_input.rb | lib/formtastic/inputs/email_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="email">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for attributes with a name matching
# `/email/`, but can be applied to any text-like input with `:as =>... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/password_input.rb | lib/formtastic/inputs/password_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a `<input type="password">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for all attributes matching `/password/`, but
# can be applied to any text-like input with `:as => :passwo... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/hidden_input.rb | lib/formtastic/inputs/hidden_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<input type="hidden">` wrapped in the standard `<li>` wrapper. This is
# provided for situations where a hidden field needs to be rendered in the flow of a form with
# many inputs that form an `<ol>`. Wrapping the hidden in... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/time_select_input.rb | lib/formtastic/inputs/time_select_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a series of select boxes for the fragments that make up a time (hour, minute, second).
# Unless `:ignore_date` is true, it will render hidden inputs for the year, month and day as
# well, defaulting to `Time.current` if the form obje... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/text_input.rb | lib/formtastic/inputs/text_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a `<textarea>` wrapped in the standard
# `<li>` wrapper. This is the default input choice for database columns of the `:text` type,
# but can forced on any text-like input with `:as => :text`.
#
# @exa... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/select_input.rb | lib/formtastic/inputs/select_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# A select input is used to render a `<select>` tag with a series of options to choose from.
# It works for both single selections (like a `belongs_to` relationship, or "yes/no" boolean),
# as well as multiple selections (like a `has_and_belong... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/phone_input.rb | lib/formtastic/inputs/phone_input.rb | # frozen_string_literal: true
module Formtastic
module Inputs
# Outputs a simple `<label>` with a HTML5 `<input type="phone">` wrapped in the standard
# `<li>` wrapper. This is the default input choice for attributes with a name matching
# `/(phone|fax)/`, but can be applied to any text-like input with `... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/fileish.rb | lib/formtastic/inputs/base/fileish.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Fileish
def file?
@file ||= begin
# TODO return true if self.is_a?(Formtastic::Inputs::FileInput::Woo)
object && object.respond_to?(method) && builder.file_methods.any? { |m| obj... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/labelling.rb | lib/formtastic/inputs/base/labelling.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Labelling
include Formtastic::LocalizedString
def label_html
render_label? ? builder.label(input_name, label_text, label_html_options) : +"".html_safe
end
def... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/aria.rb | lib/formtastic/inputs/base/aria.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Aria
def error_aria_attributes
return {} unless builder.semantic_errors_link_to_inputs
return {} unless errors?
{
'aria-describedby': describedby,
'aria-invalid': ... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/errors.rb | lib/formtastic/inputs/base/errors.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Errors
def error_html
errors? ? send(:"error_#{builder.inline_errors}_html") : +""
end
def error_sentence_html
error_class = builder.default_inline_error_class
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/wrapping.rb | lib/formtastic/inputs/base/wrapping.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
# @todo relies on `dom_id`, `required?`, `optional`, `errors?`, `association_primary_key` & `sanitized_method_name` methods from another module
module Wrapping
# Override this method if you want to change the display or... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/options.rb | lib/formtastic/inputs/base/options.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Options
def input_options
options.except(*formtastic_options)
end
def formtastic_options
[:priority_countries, :priority_zones, :member_label, :member_value, :collection, :required,... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/stringish.rb | lib/formtastic/inputs/base/stringish.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Stringish
# @abstract Override this method in your input class to describe how the input should render itself.
def to_html
input_wrapping do
label_html <<
builder.text_fi... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/datetime_pickerish.rb | lib/formtastic/inputs/base/datetime_pickerish.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module DatetimePickerish
include Base::Placeholder
def html_input_type
raise NotImplementedError
end
def default_size
raise NotImplementedError
end
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/choices.rb | lib/formtastic/inputs/base/choices.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Choices
def choices_wrapping(&block)
template.content_tag(:fieldset,
template.capture(&block),
choices_wrapping_html_options
)
end
def choices_wrapping_html_... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/validations.rb | lib/formtastic/inputs/base/validations.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Validations
class IndeterminableMinimumAttributeError < ArgumentError
def message
[
"A minimum value can not be determined when the validation uses :greater_than on a :decimal or :fl... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/placeholder.rb | lib/formtastic/inputs/base/placeholder.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Placeholder
def input_html_options
{:placeholder => placeholder_text}.merge(super)
end
def placeholder_text
localized_string(method, options[:placeholder], :placehol... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/hints.rb | lib/formtastic/inputs/base/hints.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Hints
def hint_html
if hint?
template.content_tag(
:p,
hint_text.html_safe,
:class => builder.default_hint_class
)
end
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/associations.rb | lib/formtastic/inputs/base/associations.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Associations
include Formtastic::Helpers::Reflection
# :belongs_to, etc
def association
@association ||= association_macro_for_method(method)
end
def reflection
@ref... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/collections.rb | lib/formtastic/inputs/base/collections.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Collections
def label_method
@label_method ||= (label_method_from_options || label_and_value_method.first)
end
def label_method_from_options
options[:member_label]
end
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/timeish.rb | lib/formtastic/inputs/base/timeish.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
# Timeish inputs (`:date_select`, `:datetime_select`, `:time_select`) are similar to the Rails date and time
# helpers (`date_select`, `datetime_select`, `time_select`), rendering a series of `<select>`
# tags for each fr... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/naming.rb | lib/formtastic/inputs/base/naming.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Naming
def as
self.class.name.split("::")[-1].underscore.gsub(/_input$/, '')
end
def sanitized_object_name
object_name.to_s.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
e... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/numeric.rb | lib/formtastic/inputs/base/numeric.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Numeric
def input_html_options
defaults = super
# override rails default size - does not apply to numeric inputs
#@todo document/spec
defaults[:size] = nil
i... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/database.rb | lib/formtastic/inputs/base/database.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Database
def column
if object.respond_to?(:column_for_attribute)
object.column_for_attribute(method)
end
end
def column?
!column.nil?
end
end
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
formtastic/formtastic | https://github.com/formtastic/formtastic/blob/3ed00c52ab2472a02fe1f63a4327fde401c7472e/lib/formtastic/inputs/base/html.rb | lib/formtastic/inputs/base/html.rb | # frozen_string_literal: true
module Formtastic
module Inputs
module Base
module Html
# Defines how the instance of an input should be rendered to a HTML string.
#
# @abstract Implement this method in your input class to describe how the input should render itself.
#
... | ruby | MIT | 3ed00c52ab2472a02fe1f63a4327fde401c7472e | 2026-01-04T15:43:36.501686Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/install.rb | install.rb | #! /usr/bin/env ruby
#--
# Copyright 2004 Austin Ziegler <ruby-install@halostatue.ca>
# Install utility. Based on the original installation script for rdoc by the
# Pragmatic Programmers.
#
# This program is free software. It may be redistributed and/or modified under
# the terms of the GPL version 2 (or later) or ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/rakelib/references/get_typedocs.rb | rakelib/references/get_typedocs.rb | # This script will print the Puppet type docs to stdout in JSON format.
# There are some subtleties that make this a pain to run. Basically: Even if you
# 'require' a specific copy of the Puppet code, the autoloader will grab bits
# and pieces of Puppet code from other copies of Puppet scattered about the Ruby
# load ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/util/binary_search_specs.rb | util/binary_search_specs.rb | #!/usr/bin/env ruby
# Author: Nick Lewis
specs_in_order = File.read('spec_order.txt').split
failing_spec = ARGV.first
specs = specs_in_order[0...specs_in_order.index(failing_spec)]
suspects = specs
while suspects.length > 1 do
count = suspects.length
specs_to_run = suspects[0...(count/2)]
puts "Trying #{spec... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/system_startup/benchmarker.rb | benchmarks/system_startup/benchmarker.rb | class Benchmarker
def initialize(target, size)
end
def setup
end
def generate
end
def run(args=nil)
# Just running help is probably a good proxy of a full startup.
# Simply asking for the version might also be good, but it would miss all
# of the app searching and loading parts
`puppet ... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/function_loading/benchmarker.rb | benchmarks/function_loading/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
@@benchmark_count ||= 0
end
def setup
require 'puppet'
config = File.join(@target, 'puppet.conf')
Puppet.initialize_setting... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/many_environments/benchmarker.rb | benchmarks/many_environments/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size > 1000 ? size : 1000
end
def setup
require 'puppet'
@config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', @config])
end
def run(args=nil)
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/type_inference/benchmarker.rb | benchmarks/type_inference/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
end
def setup
end
def run(args=nil)
unless @initialized
require 'puppet'
config = File.join(@target, 'puppet.conf')
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/defined_types/benchmarker.rb | benchmarks/defined_types/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
end
def setup
require 'puppet'
config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', config])
en... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/empty_catalog/benchmarker.rb | benchmarks/empty_catalog/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
end
def setup
end
def run(args=nil)
unless @initialized
require 'puppet'
config = File.join(@target, 'puppet.conf')
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/many_modules/benchmarker.rb | benchmarks/many_modules/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
end
def setup
require 'puppet'
config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', config])
en... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/hiera_include/benchmarker.rb | benchmarks/hiera_include/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size > 100 ? size : 100
end
def setup
require 'puppet'
@config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', @config])
envs = Puppet.lookup(:envi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/hiera_conf_interpol/benchmarker.rb | benchmarks/hiera_conf_interpol/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size > 100 ? size : 100
end
def setup
require 'puppet'
@config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', @config])
envs = Puppet.lookup(:envi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/virtual_collection/benchmarker.rb | benchmarks/virtual_collection/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = 200
end
def setup
require 'puppet'
config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', config])
end... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/catalog_memory/benchmarker.rb | benchmarks/catalog_memory/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
# For memory debugging - if the core_ext is not loaded, things break inside mass
# require 'mass'
require 'objspace'
# Only runs for Ruby > 2.1.0, and must do this early since ObjectSpace.trace_object_allocations_start must be called
# as early as pos... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/hiera_include_one/benchmarker.rb | benchmarks/hiera_include_one/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size > 1000 ? size : 1000
end
def setup
require 'puppet'
@config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', @config])
envs = Puppet.lookup(:en... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/evaluations/benchmarker_task.rb | benchmarks/evaluations/benchmarker_task.rb | # Helper class that is used by the Rake task generator.
# Currently only supports defining arguments that are passed to run
# (The rake task generator always passes :warm_up_runs as an Integer when profiling).
# Other benchmarks, and for regular runs that wants arguments must specified them
# as an Array of symbols.
#
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/evaluations/benchmarker.rb | benchmarks/evaluations/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
@micro_benchmarks = {}
@parsecount = 100
@evalcount = 100
end
def setup
require 'puppet'
require 'puppet/pops'
conf... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/missing_type_caching/benchmarker.rb | benchmarks/missing_type_caching/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
end
def setup
require 'puppet'
config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', config])
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/hiera_global_lookup/benchmarker.rb | benchmarks/hiera_global_lookup/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size > 100 ? size : 100
end
def setup
require 'puppet'
@config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', @config])
envs = Puppet.lookup(:envi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/legacy_hiera_lookup/benchmarker.rb | benchmarks/legacy_hiera_lookup/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@hiera_yaml = File.join(target, 'hiera.yaml')
@size = size > 100 ? size : 100
end
def setup
require 'puppet'
require 'hiera'
@config = File.join(@target, 'puppet.conf')
Puppet.ini... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/hiera_env_lookup/benchmarker.rb | benchmarks/hiera_env_lookup/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size > 100 ? size : 100
end
def setup
require 'puppet'
@config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', @config])
envs = Puppet.lookup(:envi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/fq_var_lookup/benchmarker.rb | benchmarks/fq_var_lookup/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
end
def setup
require 'puppet'
config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', config])
en... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/full_catalog/benchmarker.rb | benchmarks/full_catalog/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
require 'bundler'
class Benchmarker
include FileUtils
def initialize(target, size='medium')
@target = target
@size = 'large'
end
def check_submodule
submodule = File.join('benchmarks', 'full_catalog', 'puppetlabs-puppetserver_perf... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/hiera_function/benchmarker.rb | benchmarks/hiera_function/benchmarker.rb | require 'fileutils'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size > 100 ? size : 100
end
def setup
require 'puppet'
@config = File.join(@target, 'puppet.conf')
Puppet.initialize_settings(['--config', @config])
envs = Puppet.lookup(:envi... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/dependency_loading/benchmarker.rb | benchmarks/dependency_loading/benchmarker.rb | require 'erb'
require 'ostruct'
require 'fileutils'
require 'json'
class Benchmarker
include FileUtils
def initialize(target, size)
@target = target
@size = size
@@benchmark_count ||= 0
end
def setup
require 'puppet'
config = File.join(@target, 'puppet.conf')
Puppet.initialize_setting... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/benchmarks/serialization/benchmarker.rb | benchmarks/serialization/benchmarker.rb | require 'puppet'
class Benchmarker
def initialize(target, size)
@size = size
@direction = ENV['SER_DIRECTION'] == 'generate' ? :generate : :parse
@format = ENV['SER_FORMAT'] == 'pson' ? :pson : :json
puts "Benchmarker #{@direction} #{@format}"
end
def setup
end
def generate
path = File... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
puppetlabs/puppet | https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/yardoc/templates/default/method_details/html/setup.rb | yardoc/templates/default/method_details/html/setup.rb | def init
super
end
def format_method_detail_extras(object)
result = ""
if object
if object.respond_to?(:visibility)
if object.visibility != :public
result << "<span class=\"note title #{object.visibility}\">#{object.visibility}</span>"
end
end
if object.has_tag?(:abstract)
... | ruby | Apache-2.0 | e227c27540975c25aa22d533a52424a9d2fc886a | 2026-01-04T15:39:26.576514Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.