Module: Playbook

Defined in:
app/pb_kits/playbook/pb_form/form.rb,
lib/playbook.rb,
lib/playbook/engine.rb,
lib/playbook/version.rb,
app/pb_kits/playbook/props.rb,
app/pb_kits/playbook/pb_nav/nav.rb,
app/pb_kits/playbook/props/base.rb,
app/pb_kits/playbook/props/date.rb,
app/pb_kits/playbook/props/enum.rb,
app/pb_kits/playbook/props/hash.rb,
app/pb_kits/playbook/props/proc.rb,
app/pb_kits/playbook/pb_kit/base.rb,
app/pb_kits/playbook/pb_nav/item.rb,
app/pb_kits/playbook/props/array.rb,
app/pb_kits/playbook/pb_body/body.rb,
app/pb_kits/playbook/pb_card/card.rb,
app/pb_kits/playbook/pb_date/date.rb,
app/pb_kits/playbook/pb_flex/flex.rb,
app/pb_kits/playbook/pb_icon/icon.rb,
app/pb_kits/playbook/pb_list/item.rb,
app/pb_kits/playbook/pb_list/list.rb,
app/pb_kits/playbook/pb_pill/pill.rb,
app/pb_kits/playbook/pb_time/time.rb,
app/pb_kits/playbook/pb_user/user.rb,
app/pb_kits/playbook/props/number.rb,
app/pb_kits/playbook/props/string.rb,
app/helpers/playbook/layout_helper.rb,
app/helpers/playbook/pb_doc_helper.rb,
app/helpers/playbook/pb_kit_helper.rb,
app/pb_kits/playbook/props/boolean.rb,
app/pb_kits/playbook/props/numeric.rb,
app/pb_kits/playbook/pb_badge/badge.rb,
app/pb_kits/playbook/pb_image/image.rb,
app/pb_kits/playbook/pb_layout/body.rb,
app/pb_kits/playbook/pb_radio/radio.rb,
app/pb_kits/playbook/pb_table/table.rb,
app/pb_kits/playbook/pb_title/title.rb,
app/helpers/playbook/pb_sample_helper.rb,
app/helpers/playbook/redcarpet_helper.rb,
app/pb_kits/playbook/pb_avatar/avatar.rb,
app/pb_kits/playbook/pb_button/button.rb,
app/pb_kits/playbook/pb_filter/filter.rb,
app/pb_kits/playbook/pb_layout/layout.rb,
app/pb_kits/playbook/pb_legend/legend.rb,
app/pb_kits/playbook/pb_person/person.rb,
app/pb_kits/playbook/pb_select/select.rb,
app/pb_kits/playbook/pb_source/source.rb,
app/pb_kits/playbook/pb_toggle/toggle.rb,
app/pb_kits/playbook/props/hash_array.rb,
app/pb_kits/playbook/props/percentage.rb,
app/pb_kits/playbook/pb_card/card_body.rb,
app/pb_kits/playbook/pb_flex/flex_item.rb,
app/pb_kits/playbook/pb_layout/sidebar.rb,
app/helpers/playbook/application_helper.rb,
app/pb_kits/playbook/pb_caption/caption.rb,
app/pb_kits/playbook/pb_contact/contact.rb,
app/pb_kits/playbook/pb_hashtag/hashtag.rb,
app/pb_kits/playbook/pb_message/message.rb,
app/pb_kits/playbook/pb_popover/popover.rb,
app/pb_kits/playbook/props/number_array.rb,
app/pb_kits/playbook/pb_kit/pb_date_time.rb,
app/controllers/playbook/pages_controller.rb,
app/pb_kits/playbook/pb_checkbox/checkbox.rb,
app/pb_kits/playbook/pb_currency/currency.rb,
app/pb_kits/playbook/pb_form/form_builder.rb,
app/pb_kits/playbook/pb_textarea/textarea.rb,
app/controllers/playbook/guides_controller.rb,
app/controllers/playbook/samples_controller.rb,
app/pb_kits/playbook/pb_bar_graph/bar_graph.rb,
app/pb_kits/playbook/pb_form_pill/form_pill.rb,
app/pb_kits/playbook/pb_highlight/highlight.rb,
app/pb_kits/playbook/pb_timestamp/timestamp.rb,
app/pb_kits/playbook/pb_typeahead/typeahead.rb,
app/pb_kits/playbook/pb_icon_value/icon_value.rb,
app/pb_kits/playbook/pb_label_pill/label_pill.rb,
app/pb_kits/playbook/pb_line_graph/line_graph.rb,
app/pb_kits/playbook/pb_stat_value/stat_value.rb,
app/pb_kits/playbook/pb_text_input/text_input.rb,
app/pb_kits/playbook/pb_user_badge/user_badge.rb,
app/controllers/playbook/application_controller.rb,
app/pb_kits/playbook/pb_icon_circle/icon_circle.rb,
app/pb_kits/playbook/pb_label_value/label_value.rb,
app/pb_kits/playbook/pb_star_rating/star_rating.rb,
app/pb_kits/playbook/pb_stat_change/stat_change.rb,
app/pb_kits/playbook/pb_title_count/title_count.rb,
app/pb_kits/playbook/pb_form/form/form_with_form.rb,
app/pb_kits/playbook/pb_date_stacked/date_stacked.rb,
app/pb_kits/playbook/pb_title_detail/title_detail.rb,
app/pb_kits/playbook/pb_form/form/simple_form_form.rb,
app/pb_kits/playbook/pb_online_status/online_status.rb,
app/pb_kits/playbook/pb_form/form_builder/action_area.rb,
app/pb_kits/playbook/pb_loading_inline/loading_inline.rb,
app/pb_kits/playbook/pb_multiple_users/multiple_users.rb,
app/pb_kits/playbook/pb_person_contact/person_contact.rb,
app/pb_kits/playbook/pb_progress_pills/progress_pills.rb,
app/pb_kits/playbook/pb_form/form_builder/select_field.rb,
app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb,
app/pb_kits/playbook/pb_progress_simple/progress_simple.rb,
app/pb_kits/playbook/pb_selectable_card/selectable_card.rb,
app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb,
app/pb_kits/playbook/pb_form/form_builder/typeahead_field.rb,
app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb,
app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb,
app/pb_kits/playbook/pb_section_separator/section_separator.rb,
app/pb_kits/playbook/pb_form/form_builder/form_field_builder.rb,
app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb,
app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.rb,
app/pb_kits/playbook/pb_form/form_builder/simple_form_builder.rb,
app/pb_kits/playbook/pb_home_address_street/home_address_street.rb,
app/pb_kits/playbook/pb_form/form_builder/form_with_form_builder.rb,
app/pb_kits/playbook/pb_form/form_builder/collection_select_field.rb,
app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb,
app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb

Overview

require_dependency “app/pb_kits/playbook/pb_form/form_builder”

Defined Under Namespace

Modules: ApplicationHelper, LayoutHelper, PbAvatar, PbBadge, PbBarGraph, PbBody, PbButton, PbCaption, PbCard, PbCheckbox, PbCircleIconButton, PbContact, PbCurrency, PbDashboardValue, PbDate, PbDateRangeInline, PbDateRangeStacked, PbDateStacked, PbDateYearStacked, PbDistributionBar, PbDocHelper, PbFilter, PbFixedConfirmationToast, PbFlex, PbForm, PbFormPill, PbHashtag, PbHighlight, PbHomeAddressStreet, PbIcon, PbIconCircle, PbIconValue, PbImage, PbKit, PbKitHelper, PbLabelPill, PbLabelValue, PbLayout, PbLegend, PbLineGraph, PbList, PbLoadingInline, PbMessage, PbMultipleUsers, PbMultipleUsersStacked, PbNav, PbOnlineStatus, PbPerson, PbPersonContact, PbPill, PbPopover, PbProgressPills, PbProgressSimple, PbRadio, PbSampleHelper, PbSectionSeparator, PbSelect, PbSelectableCard, PbSource, PbStarRating, PbStatChange, PbStatValue, PbTable, PbTextInput, PbTextarea, PbTime, PbTimestamp, PbTitle, PbTitleCount, PbTitleDetail, PbToggle, PbTypeahead, PbUser, PbUserBadge, Props, RedcarpetHelper Classes: ApplicationController, ConflictingPropsError, Engine, GuidesController, HTML, HTMLBlockCode, MissingPropError, PagesController, SamplesController

Constant Summary collapse

ROOT_PATH =
Pathname.new(File.join(__dir__, ".."))
VERSION =
"4.9.0"

Class Method Summary collapse

Class Method Details

.assets_digestString

Returns the digest value for assets managed by the asset pipeline.

Returns:

  • (String)

    the digest value for assets managed by the asset pipeline



19
20
21
22
23
24
25
26
27
# File 'lib/playbook.rb', line 19

def self.assets_digest
  @assets_digest ||= begin
    if ActionView::Base.respond_to?(:asset_manifest) # Rails 4
      Digest::MD5.hexdigest(ActionView::Base.assets_manifest.assets.values.sort.join)
    elsif Rails.configuration.assets.digests.present? # Rails 3
      Digest::MD5.hexdigest(Rails.configuration.assets.digests.try(:values).sort.join)
    end
  end
end

.web_page_within_mobile_app?(request) ⇒ Boolean

Returns indication of whether the request is a web view within Nitro Mobile.

Returns:

  • (Boolean)

    indication of whether the request is a web view within Nitro Mobile



14
15
16
# File 'lib/playbook.rb', line 14

def self.web_page_within_mobile_app?(request)
  request.user_agent.try(:downcase) =~ /^nitro/
end

.webpackerObject



30
31
32
33
34
35
# File 'lib/playbook.rb', line 30

def webpacker
  @webpacker ||= ::Webpacker::Instance.new(
    root_path: ROOT_PATH,
    config_path: ROOT_PATH.join("config/webpacker.yml")
  )
end