Sha256: 685632fed229bbf434bd58ba3a81e1d242a376accbc32f01f5e7c011566d264f

Contents?: true

Size: 425 Bytes

Versions: 25

Compression:

Stored size: 425 Bytes

Contents

module Etherlite::Railties
  module Utils
    def self.load_contracts(_path, prefix: 'Contract')
      Dir.glob(_path.join('**/*.json')).map do |fullpath|
        path = Pathname.new fullpath
        path = path.relative_path_from _path
        path = path.dirname.join(path.basename(path.extname)).to_s

        Object.const_set(path.camelize + prefix, Etherlite::Abi.load_contract_at(fullpath))
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
etherlite-0.6.0 lib/etherlite/railties/utils.rb
etherlite-0.5.3 lib/etherlite/railties/utils.rb
etherlite-0.5.2 lib/etherlite/railties/utils.rb
etherlite-0.5.1 lib/etherlite/railties/utils.rb
etherlite-0.5.0 lib/etherlite/railties/utils.rb
etherlite-0.4.2 lib/etherlite/railties/utils.rb
etherlite-0.4.1 lib/etherlite/railties/utils.rb
etherlite-0.4.0 lib/etherlite/railties/utils.rb
etherlite-0.3.0 lib/etherlite/railties/utils.rb
etherlite-0.2.6 lib/etherlite/railties/utils.rb
etherlite-0.2.5 lib/etherlite/railties/utils.rb
etherlite-0.2.4 lib/etherlite/railties/utils.rb
etherlite-0.2.3 lib/etherlite/railties/utils.rb
etherlite-0.2.2 lib/etherlite/railties/utils.rb
etherlite-0.2.1 lib/etherlite/railties/utils.rb
etherlite-0.2.0 lib/etherlite/railties/utils.rb
etherlite-0.1.8 lib/etherlite/railties/utils.rb
etherlite-0.1.7 lib/etherlite/railties/utils.rb
etherlite-0.1.6 lib/etherlite/railties/utils.rb
etherlite-0.1.5 lib/etherlite/railties/utils.rb