Sha256: 6b8f2b738ecb685cfaddd077d03d2817d7db79e3e81a914aa0d17569c634add9

Contents?: true

Size: 708 Bytes

Versions: 3

Compression:

Stored size: 708 Bytes

Contents

module Stationed
  module Generators
    module Plugins
      module I18nSpec
        def self.prepended(base)
          base.class_option :i18n_spec,
            type: :boolean,
            default: true,
            desc: 'Set up tests for locale files'
        end

        def finish_template
          return super unless options[:i18n_spec]
          gem 'i18n-spec', group: :test, require: false
          copy_file 'i18n_spec.rb', 'spec/locales/i18n_spec.rb'
          uncomment_lines 'config/environments/development.rb', /raise_on_missing_translations/
          uncomment_lines 'config/environments/test.rb', /raise_on_missing_translations/
          super
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/stationed/generators/plugins/i18n_spec.rb
stationed-0.5.0 lib/stationed/generators/plugins/i18n_spec.rb
stationed-0.4.0 lib/stationed/generators/plugins/i18n_spec.rb