Module: Snippr
- Extended by:
- Snippr
- Included in:
- Snippr
- Defined in:
- lib/snippr/i18n.rb,
lib/snippr/path.rb,
lib/snippr/snip.rb,
lib/snippr/clock.rb,
lib/snippr/links.rb,
lib/snippr/snippr.rb,
lib/snippr/railtie.rb,
lib/snippr/meta_data.rb,
lib/snippr/processor.rb,
lib/snippr/normalizer.rb,
lib/snippr/view_helper.rb,
lib/snippr/segment_parser.rb,
lib/snippr/processor/block.rb,
lib/snippr/processor/links.rb,
lib/snippr/processor/dynamics.rb,
lib/snippr/processor/functions.rb,
lib/snippr/processor/wikilinks.rb,
lib/snippr/segment_filter/base.rb,
lib/snippr/normalizer/camelizer.rb,
lib/snippr/normalizer/de_rester.rb,
lib/snippr/segment_filter/on_host.rb,
lib/snippr/segment_filter/valid_from.rb,
lib/snippr/segment_filter/valid_until.rb,
lib/snippr/segment_filter/on_rails_env.rb
Overview
Snippr::Normalizer::DeRester
“Redirects” REST path elements that are accessed via POST (create, update destroy) with their corresponding GET elements (new, edit, show) so that when eg create is rendered due to an error in the action, it just looks exactly like the new page it was issued from.
Defined Under Namespace
Modules: I18n, Links, Normalizer, Path, Processor, SegmentFilter, ViewHelper Classes: Clock, MetaData, Railtie, SegmentParser, Snip
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the logger.
Instance Method Summary collapse
-
#adjust_urls_except ⇒ Object
Returns the regular expressions used to determine which urls to exclude from adjustment.
-
#adjust_urls_except=(adjust_urls_except) ⇒ Object
Sets the regular expressions used to determine which urls to exclude from adjustment.
-
#i18n=(enabled) ⇒ Object
Sets whether to use I18n snippr files.
-
#i18n? ⇒ Boolean
Returns whether to use I18n snippr files.
-
#list(*args) ⇒ Object
Lists all snips inside a snippr directory specified by path parts.
-
#load(*args) ⇒ Object
Expects the name of a snippr file.
-
#path ⇒ Object
Returns the path to the snippr files (from JVM properties if available).
-
#path=(path) ⇒ Object
Sets the path to the snippr files.
Instance Attribute Details
#logger ⇒ Object
Returns the logger. Uses the Rails logger when available or falls back to a custom logger.
45 46 47 |
# File 'lib/snippr/snippr.rb', line 45 def logger @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT) end |
Instance Method Details
#adjust_urls_except ⇒ Object
Returns the regular expressions used to determine which urls to exclude from adjustment.
32 33 34 |
# File 'lib/snippr/snippr.rb', line 32 def adjust_urls_except Links.adjust_urls_except end |
#adjust_urls_except=(adjust_urls_except) ⇒ Object
Sets the regular expressions used to determine which urls to exclude from adjustment.
37 38 39 |
# File 'lib/snippr/snippr.rb', line 37 def adjust_urls_except=(adjust_urls_except) Links.adjust_urls_except = adjust_urls_except end |
#i18n=(enabled) ⇒ Object
Sets whether to use I18n snippr files.
27 28 29 |
# File 'lib/snippr/snippr.rb', line 27 def i18n=(enabled) I18n.enabled = enabled end |
#i18n? ⇒ Boolean
Returns whether to use I18n snippr files.
22 23 24 |
# File 'lib/snippr/snippr.rb', line 22 def i18n? I18n.enabled? end |
#list(*args) ⇒ Object
Lists all snips inside a snippr directory specified by path parts.
56 57 58 |
# File 'lib/snippr/snippr.rb', line 56 def list(*args) Path.list *args end |
#load(*args) ⇒ Object
Expects the name of a snippr file. Also accepts a Hash of placeholders to be replaced with dynamic values.
51 52 53 |
# File 'lib/snippr/snippr.rb', line 51 def load(*args) Snip.new(*args) end |