Sha256: 6ae39923ea911d4ee1c234b3b5661a707afe3d79f2004f8a799406ad7c91fdf4

Contents?: true

Size: 978 Bytes

Versions: 1

Compression:

Stored size: 978 Bytes

Contents

module Bankscrap
  class AdapterGenerator < Thor::Group
    include Thor::Actions

    argument :bank_name

    def self.source_root
       File.join(File.dirname(__FILE__), 'templates')
    end

    def generate
      self.destination_root = File.expand_path('.', gem_name)
      directory '.'

      say ""
      say "Great! Now you can start implementing your bank's adapter for Bankscrap.", :yellow
      say ""
      say "To get started take a look to:", :yellow
      say "#{destination_root}/#{gem_name}.rb", :yellow
      say ""
      say "If you need help you can join our Slack chat room. Click the Slack badge on Github:", :yellow
      say "https://github.com/bankscrap/bankscrap", :yellow
    end

    protected

    def bank_name_dasherized
      @bank_name_dasherized ||= bank_name.underscore.dasherize
    end
    def gem_name
      @gem_name ||= 'bankscrap-' + bank_name_dasherized
    end

    def module_name
      @module_name ||= bank_name
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bankscrap-1.0.3 generators/adapter_generator.rb