Class: MasterView::Directives::Javascript_include
- Inherits:
-
MasterView::DirectiveBase
- Object
- MasterView::DirectiveBase
- MasterView::Directives::Javascript_include
- Defined in:
- lib/masterview/directives/javascript_include.rb
Overview
creates a link_to
Constant Summary collapse
- JAVASCRIPT_SRC_EXTRACT_REGEX =
/public/javascripts/(.*)/
MasterView::ConfigSettings.template_asset_base_ref_pattern[:javascripts]
Constants included from MasterView::DirectiveHelpers
MasterView::DirectiveHelpers::CRLF, MasterView::DirectiveHelpers::ERB_CONTENT_END, MasterView::DirectiveHelpers::ERB_CONTENT_START, MasterView::DirectiveHelpers::ERB_END, MasterView::DirectiveHelpers::ERB_EVAL, MasterView::DirectiveHelpers::ERB_EVAL_END, MasterView::DirectiveHelpers::ERB_EVAL_START, MasterView::DirectiveHelpers::ERB_START
Instance Method Summary collapse
Methods inherited from MasterView::DirectiveBase
#append_to_attr_value!, #attr_lckv_matches, attr_name, #attr_value, #attr_value=, #attrs, #attrs=, #attrs_lck, #attrs_lckv, #common_html_options, #content, #content=, #content_str, #data, #data=, default_attr_name, #erb, #erb_content, #erb_eval, full_attr_name, #initialize, #merge_hash_attr_value!, #parse_attr_value, #prepend_to_attr_value!, #quote, #quote_if, register_directive, #remove_strings_from_attr_value!, #save_directive_call_stack, #tag_name, #tag_name=
Methods included from MasterView::DirectiveHelpers
#delete_last_in_parent, #find_last_in_parent, #find_string_val_in_string_hash, #lowercase_attribute_keys, #lowercase_attribute_keys_and_values, #merge_into_embedded_hash, #parse, #parse_eval_into_array, #parse_eval_into_hash, #remove_prepended_strings, #render_partial_name_to_file_name, #symbolize_sort_and_serialize_hash_to_str
Methods included from PluginLoadTracking
Constructor Details
This class inherits a constructor from MasterView::DirectiveBase
Instance Method Details
#etag(dcs) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/masterview/directives/javascript_include.rb', line 13 def etag(dcs) src = attrs_lck['src'] if attr_value.empty? && src match = JAVASCRIPT_SRC_EXTRACT_REGEX.match(src) js_loc = quote( (match) ? match[1] : src ) else js_loc = attr_value.starts_with?(':') ? attr_value : quote(attr_value) end erb_content('javascript_include_tag ' + js_loc) end |
#stag(dcs) ⇒ Object
10 11 |
# File 'lib/masterview/directives/javascript_include.rb', line 10 def stag(dcs) end |