Class: Script::Layers::Infrastructure::PushPackageRepository

Inherits:
Object
  • Object
show all
Includes:
SmartProperties
Defined in:
lib/project_types/script/layers/infrastructure/push_package_repository.rb

Instance Method Summary collapse

Instance Method Details

#create_push_package(script, script_content, compiled_type) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/project_types/script/layers/infrastructure/push_package_repository.rb', line 10

def create_push_package(script, script_content, compiled_type)
  build_file_path = file_path(script.name, compiled_type)
  write_to_path(build_file_path, script_content)

  Domain::PushPackage.new(
    build_file_path,
    script,
    script_content,
    compiled_type,
  )
end

#get_push_package(script, compiled_type) ⇒ Object

Raises:

  • (Domain::PushPackageNotFoundError)


22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/project_types/script/layers/infrastructure/push_package_repository.rb', line 22

def get_push_package(script, compiled_type)
  build_file_path = file_path(script.name, compiled_type)

  raise Domain::PushPackageNotFoundError unless ctx.file_exist?(build_file_path)

  script_content = File.read(build_file_path)

  Domain::PushPackage.new(
    build_file_path,
    script,
    script_content,
    compiled_type,
  )
end