Module: Dapp::Dapp::Deps::Common

Included in:
Dapp::Dapp
Defined in:
lib/dapp/dapp/deps/common.rb

Instance Method Summary collapse

Instance Method Details

#dappdeps_container(dappdeps) ⇒ Object



5
6
7
# File 'lib/dapp/dapp/deps/common.rb', line 5

def dappdeps_container(dappdeps)
  dappdeps_containers[dappdeps] ||= ruby2go_dappdeps_command(dappdeps: dappdeps, command: :container)
end

#dappdeps_containersObject



9
10
11
# File 'lib/dapp/dapp/deps/common.rb', line 9

def dappdeps_containers
  @dappdeps_containers ||= {}
end

#ruby2go_dappdeps_command(dappdeps:, command:, **options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/dapp/dapp/deps/common.rb', line 13

def ruby2go_dappdeps_command(dappdeps:, command:, **options)
  (options[:options] ||= {}).merge!(host_docker_config_dir: self.class.host_docker_config_dir)
  ruby2go_dappdeps(dappdeps: dappdeps, command: command, **options).tap do |res|
    unless res["error"].nil?
      raise Error::Dapp, code: :ruby2go_dappdeps_command_failed_unexpected_error,
                         data: { dappdeps: dappdeps, command: command, message: res["error"] }
    end
    break res['data']
  end
end