Class: Rake::Pipeline::I18n::Filters::EmberStringsFilter
- Inherits:
-
Filter
- Object
- Filter
- Rake::Pipeline::I18n::Filters::EmberStringsFilter
- Includes:
- FilterWithDependencies
- Defined in:
- lib/rake-pipeline-i18n-filters/ember_strings_filter.rb
Overview
A filter that compiles locale yml files into javascript appropriate for use by Ember#String#loc
Instance Method Summary collapse
-
#generate_output(inputs, output) ⇒ Object
Implement the #generate_output method required by the Filter API.
-
#initialize(&block) ⇒ EmberStringsFilter
constructor
where ‘locale’ is the locale you have parsed and want to render.
Constructor Details
#initialize(&block) ⇒ EmberStringsFilter
Note:
If you are using Ember.String.loc be sure to set Ember.STRINGS = EmberI18n;
where ‘locale’ is the locale you have parsed and want to render.
35 36 37 38 |
# File 'lib/rake-pipeline-i18n-filters/ember_strings_filter.rb', line 35 def initialize(&block) block ||= proc { |input| input.sub(/\.(yml)$/, '.js') } super(&block) end |
Instance Method Details
#generate_output(inputs, output) ⇒ Object
Implement the #generate_output method required by the Filter API. Generates javascript from i18n yaml files appropriate for Ember#String#loc or i18n-js
48 49 50 |
# File 'lib/rake-pipeline-i18n-filters/ember_strings_filter.rb', line 48 def generate_output(inputs, output) output.write ember_i18n_output(inputs) end |