Sha256: dc22310f7e161485247a771c2ebdac3f1ecb32b8f16cedeacb35498bb92d8037

Contents?: true

Size: 840 Bytes

Versions: 25

Compression:

Stored size: 840 Bytes

Contents

installers = {
  'API Gateway (HTTP API)' => :http,
  'API Gateway (REST API)' => :rest,
  'Application Load Balancer' => :alb
}.freeze

namespace :lamby do
  namespace :install do

    installers.each do |name, task_name|
      desc "Install Lamby files for #{name}"
      task task_name do
        exec "#{base_path} LOCATION=#{template(task_name)}"
      end
    end

    def template(task_name)
      File.expand_path "../lamby/templates/#{task_name}.rb", __dir__
    end

    def bin_path
      ENV['BUNDLE_BIN'] || './bin'
    end

    def base_path
      if Rails::VERSION::MAJOR >= 5
        "#{RbConfig.ruby} #{bin_path}/rails app:template"
      else
        "#{RbConfig.ruby} #{bin_path}/rake rails:template"
      end
    end

  end

  desc "Install Lamby files for #{installers.first.first}"
  task install: 'install:http'
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
lamby-3.1.3 lib/lamby/templates.rake
lamby-3.1.2 lib/lamby/templates.rake
lamby-3.1.1 lib/lamby/templates.rake
lamby-3.1.0 lib/lamby/templates.rake
lamby-3.0.3 lib/lamby/templates.rake
lamby-3.0.2 lib/lamby/templates.rake
lamby-3.0.1 lib/lamby/templates.rake
lamby-3.0.0 lib/lamby/templates.rake
lamby-2.8.0 lib/lamby/templates.rake
lamby-2.7.1 lib/lamby/templates.rake
lamby-2.7.0 lib/lamby/templates.rake
lamby-2.6.3 lib/lamby/templates.rake
lamby-2.6.2 lib/lamby/templates.rake
lamby-2.6.1 lib/lamby/templates.rake
lamby-2.6.0 lib/lamby/templates.rake
lamby-2.5.3 lib/lamby/templates.rake
lamby-2.5.2 lib/lamby/templates.rake
lamby-2.5.1 lib/lamby/templates.rake
lamby-2.5.0 lib/lamby/templates.rake
lamby-2.2.2 lib/lamby/templates.rake