Sha256: c49a0c4055428586465f318f5e5ed2d7021782af6757facdc848ac62d814a8fb

Contents?: true

Size: 1010 Bytes

Versions: 6

Compression:

Stored size: 1010 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}/lib/bankscrap/#{bank_name_dasherized}/bank.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

6 entries across 6 versions & 1 rubygems

Version Path
bankscrap-2.1.1 generators/adapter_generator.rb
bankscrap-2.0.6 generators/adapter_generator.rb
bankscrap-2.0.5 generators/adapter_generator.rb
bankscrap-2.0.4 generators/adapter_generator.rb
bankscrap-2.0.3 generators/adapter_generator.rb
bankscrap-2.0.2 generators/adapter_generator.rb