Merge pull request #298 from bhollis/i18n-helpers
Fix Padrino helpers that require an i18n locale to be present
This commit is contained in:
commit
8d22fee8d8
|
@ -1,10 +1,12 @@
|
||||||
Feature: Built-in macro view helpers
|
Feature: Built-in macro view helpers
|
||||||
In order to simplify generating HTML
|
In order to simplify generating HTML
|
||||||
|
|
||||||
Scenario: Using the link_to helper
|
Scenario: Using the padrino helpers
|
||||||
Given the Server is running at "padrino-helpers-app"
|
Given the Server is running at "padrino-helpers-app"
|
||||||
When I go to "/former_padrino_test.html"
|
When I go to "/former_padrino_test.html"
|
||||||
And I should see 'href="test2.com"'
|
And I should see 'href="test2.com"'
|
||||||
And I should see 'src="/images/test2.png"'
|
And I should see 'src="/images/test2.png"'
|
||||||
Then I should see 'src="/javascripts/test1.js"'
|
And I should see 'src="/javascripts/test1.js"'
|
||||||
Then I should see 'href="/stylesheets/test1.css"'
|
And I should see 'href="/stylesheets/test1.css"'
|
||||||
|
And I should see '1 KB'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<%= stylesheet_link_tag "test1" %>
|
<%= stylesheet_link_tag "test1" %>
|
||||||
<%= javascript_include_tag "test1" %>
|
<%= javascript_include_tag "test1" %>
|
||||||
<%= image_tag "test2.png", :alt => "alt" %>
|
<%= image_tag "test2.png", :alt => "alt" %>
|
||||||
<%= link_to "Has param", "test2.com", :class => "test" %>
|
<%= link_to "Has param", "test2.com", :class => "test" %>
|
||||||
|
<%= number_to_human_size(1024) %>
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
require "middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/support_lite"
|
require 'middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers'
|
||||||
# require 'i18n'
|
|
||||||
require 'enumerator'
|
|
||||||
# require 'active_support/core_ext/string/conversions' # to_date
|
|
||||||
require 'active_support/core_ext/float/rounding' # round
|
|
||||||
require 'active_support/option_merger' # with_options
|
|
||||||
require 'active_support/core_ext/object/with_options' # with_options
|
|
||||||
# require 'active_support/inflector' # humanize
|
|
||||||
|
|
||||||
FileSet.glob_require('../vendor/padrino-helpers-0.10.5/lib/padrino-helpers/**/*.rb', __FILE__)
|
|
||||||
|
|
||||||
# Built-in helpers
|
# Built-in helpers
|
||||||
module Middleman::CoreExtensions::DefaultHelpers
|
module Middleman::CoreExtensions::DefaultHelpers
|
||||||
|
@ -27,9 +18,10 @@ module Middleman::CoreExtensions::DefaultHelpers
|
||||||
|
|
||||||
app.helpers Helpers
|
app.helpers Helpers
|
||||||
|
|
||||||
# app.ready do
|
app.ready do
|
||||||
# ::I18n.load_path = Dir["#{File.join(root, 'locales', '*.yml')}"]
|
::I18n.load_path += Dir["#{File.join(root, 'locales','*.yml')}"]
|
||||||
# end
|
::I18n.load_path += Dir["#{File.dirname(__FILE__)}/../vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/*.yml"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
alias :included :registered
|
alias :included :registered
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require 'padrino-core/support_lite' unless defined?(SupportLite)
|
require 'middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/support_lite' unless defined?(SupportLite)
|
||||||
require 'cgi'
|
require 'cgi'
|
||||||
# require 'i18n'
|
# require 'i18n'
|
||||||
require 'enumerator'
|
require 'enumerator'
|
||||||
|
|
|
@ -36,5 +36,8 @@ Gem::Specification.new do |s|
|
||||||
|
|
||||||
# Web Server
|
# Web Server
|
||||||
s.add_dependency("thin", ["~> 1.3.1"])
|
s.add_dependency("thin", ["~> 1.3.1"])
|
||||||
|
|
||||||
|
# i18n, needed for Padrino helpers
|
||||||
|
s.add_dependency("i18n", ["~> 0.6.0"])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue