Sha256: 4f46102b40bd1b9cec8bda7794e1e9be0be7ee8c6aed1bccced47fc4ca441131

Contents?: true

Size: 1009 Bytes

Versions: 3

Compression:

Stored size: 1009 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

3 entries across 3 versions & 1 rubygems

Version Path
bankscrap-2.0.1 generators/adapter_generator.rb
bankscrap-2.0.0 generators/adapter_generator.rb
bankscrap-1.0.4 generators/adapter_generator.rb