Sha256: 57d350aac99d1cd89bc0d16c73db7db99902e83f223430441157e15c9f5fcd10

Contents?: true

Size: 531 Bytes

Versions: 7

Compression:

Stored size: 531 Bytes

Contents

require "rails/generators"
require_relative "../../test_data/generator_support"

module TestData
  class SecretsYamlGenerator < Rails::Generators::Base
    def call
      unless Configurators::SecretsYaml.new.verify.looks_good?
        inject_into_file "config/secrets.yml", before: BEFORE_TEST_STANZA_REGEX do
          <<~YAML

            # Simplify configuration with the test_data environment
            test_data:
              secret_key_base: #{SecureRandom.hex(64)}
          YAML
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
test_data-0.3.2 lib/generators/test_data/secrets_yaml_generator.rb
test_data-0.3.1 lib/generators/test_data/secrets_yaml_generator.rb
test_data-0.3.0 lib/generators/test_data/secrets_yaml_generator.rb
test_data-0.2.2 lib/generators/test_data/secrets_yaml_generator.rb
test_data-0.2.1 lib/generators/test_data/secrets_yaml_generator.rb
test_data-0.2.0 lib/generators/test_data/secrets_yaml_generator.rb
test_data-0.1.0 lib/generators/test_data/secrets_yaml_generator.rb