update padrino internal padrino references
This commit is contained in:
parent
d23900f46b
commit
12ce74b1d3
|
@ -1,8 +1,8 @@
|
||||||
require 'middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers'
|
require 'middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers'
|
||||||
|
|
||||||
# Built-in helpers
|
# Built-in helpers
|
||||||
module Middleman::CoreExtensions::DefaultHelpers
|
module Middleman::CoreExtensions::DefaultHelpers
|
||||||
|
|
||||||
# Extension registered
|
# Extension registered
|
||||||
class << self
|
class << self
|
||||||
# @private
|
# @private
|
||||||
|
@ -15,16 +15,16 @@ module Middleman::CoreExtensions::DefaultHelpers
|
||||||
app.helpers ::Padrino::Helpers::RenderHelpers
|
app.helpers ::Padrino::Helpers::RenderHelpers
|
||||||
app.helpers ::Padrino::Helpers::NumberHelpers
|
app.helpers ::Padrino::Helpers::NumberHelpers
|
||||||
# app.helpers ::Padrino::Helpers::TranslationHelpers
|
# app.helpers ::Padrino::Helpers::TranslationHelpers
|
||||||
|
|
||||||
app.helpers Helpers
|
app.helpers Helpers
|
||||||
|
|
||||||
app.ready do
|
app.ready do
|
||||||
::I18n.load_path += Dir["#{File.dirname(__FILE__)}/../vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/*.yml"]
|
::I18n.load_path += Dir["#{File.dirname(__FILE__)}/../vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/*.yml"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alias :included :registered
|
alias :included :registered
|
||||||
end
|
end
|
||||||
|
|
||||||
# The helpers
|
# The helpers
|
||||||
module Helpers
|
module Helpers
|
||||||
# Output a stylesheet link tag based on the current path
|
# Output a stylesheet link tag based on the current path
|
||||||
|
@ -36,7 +36,7 @@ module Middleman::CoreExtensions::DefaultHelpers
|
||||||
stylesheet_link_tag path
|
stylesheet_link_tag path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Output a javascript tag based on the current path
|
# Output a javascript tag based on the current path
|
||||||
#
|
#
|
||||||
# @param [String] separator How to break up path in parts
|
# @param [String] separator How to break up path in parts
|
||||||
|
@ -60,14 +60,14 @@ module Middleman::CoreExtensions::DefaultHelpers
|
||||||
when :css then css_dir
|
when :css then css_dir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# If the basename of the request as no extension, assume we are serving a
|
# If the basename of the request as no extension, assume we are serving a
|
||||||
# directory and join index_file to the path.
|
# directory and join index_file to the path.
|
||||||
path = full_path(current_path.dup)
|
path = full_path(current_path.dup)
|
||||||
path = path.sub(%r{^/}, '')
|
path = path.sub(%r{^/}, '')
|
||||||
path = path.gsub(File.extname(path), ".#{asset_ext}")
|
path = path.gsub(File.extname(path), ".#{asset_ext}")
|
||||||
path = path.gsub("/", separator)
|
path = path.gsub("/", separator)
|
||||||
|
|
||||||
yield path if sitemap.find_resource_by_path(File.join(asset_dir, path))
|
yield path if sitemap.find_resource_by_path(File.join(asset_dir, path))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -78,16 +78,16 @@ module Middleman::CoreExtensions::DefaultHelpers
|
||||||
path = current_path.dup
|
path = current_path.dup
|
||||||
path << index_file if path.match(%r{/$})
|
path << index_file if path.match(%r{/$})
|
||||||
path = path.gsub(%r{^/}, '')
|
path = path.gsub(%r{^/}, '')
|
||||||
|
|
||||||
classes = []
|
classes = []
|
||||||
parts = path.split('.')[0].split('/')
|
parts = path.split('.')[0].split('/')
|
||||||
parts.each_with_index { |path, i| classes << parts.first(i+1).join('_') }
|
parts.each_with_index { |path, i| classes << parts.first(i+1).join('_') }
|
||||||
|
|
||||||
classes.join(' ')
|
classes.join(' ')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get the path of a file of a given type
|
# Get the path of a file of a given type
|
||||||
#
|
#
|
||||||
# @param [Symbol] kind The type of file
|
# @param [Symbol] kind The type of file
|
||||||
# @param [String] source The path to the file
|
# @param [String] source The path to the file
|
||||||
# @return [String]
|
# @return [String]
|
||||||
|
|
Loading…
Reference in a new issue