Module: Appium::Core::Device::FileManagement

Defined in:
lib/appium_lib_core/device/file_management.rb

Class Method Summary collapse

Class Method Details

.add_methodsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/appium_lib_core/device/file_management.rb', line 7

def self.add_methods
  ::Appium::Core::Device.add_endpoint_method(:push_file) do
    def push_file(path, filedata)
      encoded_data = Base64.encode64 filedata
      execute :push_file, {}, path: path, data: encoded_data
    end
  end

  ::Appium::Core::Device.add_endpoint_method(:pull_file) do
    def pull_file(path)
      data = execute :pull_file, {}, path: path
      Base64.decode64 data
    end
  end

  ::Appium::Core::Device.add_endpoint_method(:pull_folder) do
    def pull_folder(path)
      data = execute :pull_folder, {}, path: path
      Base64.decode64 data
    end
  end
end