Class: Fig::RepositoryPackagePublisher
- Inherits:
-
Object
- Object
- Fig::RepositoryPackagePublisher
- Defined in:
- lib/fig/repository_package_publisher.rb
Overview
Handles package publishing for the Repository.
Instance Attribute Summary collapse
-
#application_configuration ⇒ Object
writeonly
Sets the attribute application_configuration.
-
#base_temp_dir ⇒ Object
writeonly
Sets the attribute base_temp_dir.
-
#descriptor ⇒ Object
writeonly
Sets the attribute descriptor.
-
#local_directory_for_package ⇒ Object
writeonly
Sets the attribute local_directory_for_package.
-
#local_fig_file_for_package ⇒ Object
writeonly
Sets the attribute local_fig_file_for_package.
-
#local_only ⇒ Object
writeonly
Sets the attribute local_only.
-
#operating_system ⇒ Object
writeonly
Sets the attribute operating_system.
-
#options ⇒ Object
writeonly
Sets the attribute options.
-
#publish_listeners ⇒ Object
writeonly
Sets the attribute publish_listeners.
-
#remote_directory_for_package ⇒ Object
writeonly
Sets the attribute remote_directory_for_package.
-
#remote_fig_file_for_package ⇒ Object
writeonly
Sets the attribute remote_fig_file_for_package.
-
#runtime_for_package ⇒ Object
writeonly
Sets the attribute runtime_for_package.
-
#source_package ⇒ Object
writeonly
Sets the attribute source_package.
-
#was_forced ⇒ Object
writeonly
Sets the attribute was_forced.
Instance Method Summary collapse
-
#initialize ⇒ RepositoryPackagePublisher
constructor
A new instance of RepositoryPackagePublisher.
- #package_statements=(statements) ⇒ Object
- #publish_package ⇒ Object
Constructor Details
#initialize ⇒ RepositoryPackagePublisher
Returns a new instance of RepositoryPackagePublisher.
47 48 49 50 51 52 |
# File 'lib/fig/repository_package_publisher.rb', line 47 def initialize() @text_assembler = Fig::PackageDefinitionTextAssembler.new :emit_as_to_be_published return end |
Instance Attribute Details
#application_configuration=(value) ⇒ Object (writeonly)
Sets the attribute application_configuration
32 33 34 |
# File 'lib/fig/repository_package_publisher.rb', line 32 def application_configuration=(value) @application_configuration = value end |
#base_temp_dir=(value) ⇒ Object (writeonly)
Sets the attribute base_temp_dir
39 40 41 |
# File 'lib/fig/repository_package_publisher.rb', line 39 def base_temp_dir=(value) @base_temp_dir = value end |
#descriptor=(value) ⇒ Object (writeonly)
Sets the attribute descriptor
36 37 38 |
# File 'lib/fig/repository_package_publisher.rb', line 36 def descriptor=(value) @descriptor = value end |
#local_directory_for_package=(value) ⇒ Object (writeonly)
Sets the attribute local_directory_for_package
41 42 43 |
# File 'lib/fig/repository_package_publisher.rb', line 41 def local_directory_for_package=(value) @local_directory_for_package = value end |
#local_fig_file_for_package=(value) ⇒ Object (writeonly)
Sets the attribute local_fig_file_for_package
43 44 45 |
# File 'lib/fig/repository_package_publisher.rb', line 43 def local_fig_file_for_package=(value) @local_fig_file_for_package = value end |
#local_only=(value) ⇒ Object (writeonly)
Sets the attribute local_only
45 46 47 |
# File 'lib/fig/repository_package_publisher.rb', line 45 def local_only=(value) @local_only = value end |
#operating_system=(value) ⇒ Object (writeonly)
Sets the attribute operating_system
34 35 36 |
# File 'lib/fig/repository_package_publisher.rb', line 34 def (value) @operating_system = value end |
#options=(value) ⇒ Object (writeonly)
Sets the attribute options
33 34 35 |
# File 'lib/fig/repository_package_publisher.rb', line 33 def (value) @options = value end |
#publish_listeners=(value) ⇒ Object (writeonly)
Sets the attribute publish_listeners
35 36 37 |
# File 'lib/fig/repository_package_publisher.rb', line 35 def publish_listeners=(value) @publish_listeners = value end |
#remote_directory_for_package=(value) ⇒ Object (writeonly)
Sets the attribute remote_directory_for_package
42 43 44 |
# File 'lib/fig/repository_package_publisher.rb', line 42 def remote_directory_for_package=(value) @remote_directory_for_package = value end |
#remote_fig_file_for_package=(value) ⇒ Object (writeonly)
Sets the attribute remote_fig_file_for_package
44 45 46 |
# File 'lib/fig/repository_package_publisher.rb', line 44 def remote_fig_file_for_package=(value) @remote_fig_file_for_package = value end |
#runtime_for_package=(value) ⇒ Object (writeonly)
Sets the attribute runtime_for_package
40 41 42 |
# File 'lib/fig/repository_package_publisher.rb', line 40 def runtime_for_package=(value) @runtime_for_package = value end |
#source_package=(value) ⇒ Object (writeonly)
Sets the attribute source_package
37 38 39 |
# File 'lib/fig/repository_package_publisher.rb', line 37 def source_package=(value) @source_package = value end |
#was_forced=(value) ⇒ Object (writeonly)
Sets the attribute was_forced
38 39 40 |
# File 'lib/fig/repository_package_publisher.rb', line 38 def was_forced=(value) @was_forced = value end |
Instance Method Details
#package_statements=(statements) ⇒ Object
54 55 56 |
# File 'lib/fig/repository_package_publisher.rb', line 54 def package_statements=(statements) @text_assembler.add_input(statements) end |
#publish_package ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/fig/repository_package_publisher.rb', line 58 def publish_package() () temp_dir = publish_temp_dir() @operating_system.delete_and_recreate_directory(temp_dir) @operating_system.delete_and_recreate_directory( @local_directory_for_package ) @operating_system.delete_and_recreate_directory(@runtime_for_package) fig_file = File.join(temp_dir, Fig::Repository::PACKAGE_FILE_IN_REPO) content, published_package = derive_definition_file_and_create_resource_archive @operating_system.write(fig_file, content) publish_package_contents if not @local_only @operating_system.upload(fig_file, @remote_fig_file_for_package) end @operating_system.copy(fig_file, @local_fig_file_for_package) notify_listeners FileUtils.rm_rf(temp_dir) check_published_environment_variables published_package return true end |