Sha256: 1eb6011e66fefcd95a894f478f5e8e4f4f235d2a5880cb64f2ff9fd277deddaf

Contents?: true

Size: 767 Bytes

Versions: 10

Compression:

Stored size: 767 Bytes

Contents

# frozen_string_literal: true

require 'rake_factory'

require_relative '../transformers'

module RakeSecrets
  module Tasks
    class Generate < RakeFactory::Task
      default_name :generate
      default_description(RakeFactory::DynamicValue.new do |t|
        "Generates and stores the '#{t.id}' secret."
      end)

      parameter :id, required: true
      parameter :specification, required: true
      parameter :backend, required: true
      parameter :path, required: true
      parameter :transformer, default: Transformers.identity

      action do
        puts("Generating '#{id}' secret...")
        secret = specification.generate
        transformed = transformer.transform(secret)
        backend.store(path, transformed)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rake_secrets-0.3.0.pre.2 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.3.0.pre.1 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.2.0 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.1.0.pre.8 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.1.0.pre.7 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.1.0.pre.6 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.1.0.pre.5 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.1.0.pre.4 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.1.0.pre.3 lib/rake_secrets/tasks/generate.rb
rake_secrets-0.1.0.pre.2 lib/rake_secrets/tasks/generate.rb