module Razor::CLI::Views

Public Instance Methods

find_formatting(spec, format, remaining_navigation) click to toggle source
# File lib/razor/cli/views.rb, line 15
def find_formatting(spec, format, remaining_navigation)
  remaining_navigation ||= ''
  # Scope will narrow by traversing the spec.
  scope = views
  spec = spec ? spec.split('/').drop_while { |i| i != 'collections'} : []
  spec = spec + remaining_navigation.split(' ')
  while spec.any?
    val = spec.shift
    scope = (scope[val] or {})
  end
  scope["+#{format}"] or {}
end
transform(item, transform_name) click to toggle source
# File lib/razor/cli/views.rb, line 11
def transform(item, transform_name)
  Razor::CLI::Transforms.send(transform_name || 'identity', item)
end
views() click to toggle source
# File lib/razor/cli/views.rb, line 7
def views
  @views ||= YAML::load_file(File::join(File::dirname(__FILE__), "views.yaml"))
end
views=(v) click to toggle source
# File lib/razor/cli/views.rb, line 4
def views= v
  @views = v
end