Module: Fig::Command::Action::Role::Publish
- Included in:
- Publish, PublishLocal
- Defined in:
- lib/fig/command/action/role/publish.rb
Instance Method Summary collapse
- #allow_both_descriptor_and_file? ⇒ Boolean
- #apply_base_config? ⇒ Boolean
- #apply_config? ⇒ Boolean
- #base_package_can_come_from_descriptor? ⇒ Boolean
- #cares_about_asset_options? ⇒ Boolean
- #configure(options) ⇒ Object
- #derive_publish_statements_from_environment_statements ⇒ Object
- #descriptor_requirement ⇒ Object
- #load_base_package? ⇒ Boolean
- #modifies_repository? ⇒ Boolean
-
#publish? ⇒ Boolean
Is this a publish action?.
- #publish_preflight ⇒ Object
- #register_base_package? ⇒ Boolean
Instance Method Details
#allow_both_descriptor_and_file? ⇒ Boolean
18 19 20 21 22 |
# File 'lib/fig/command/action/role/publish.rb', line 18 def allow_both_descriptor_and_file?() # Actually, publishing requires a descriptor and another source of the base # package. return true end |
#apply_base_config? ⇒ Boolean
48 49 50 |
# File 'lib/fig/command/action/role/publish.rb', line 48 def apply_base_config?() return nil # don't care end |
#apply_config? ⇒ Boolean
44 45 46 |
# File 'lib/fig/command/action/role/publish.rb', line 44 def apply_config?() return true end |
#base_package_can_come_from_descriptor? ⇒ Boolean
36 37 38 |
# File 'lib/fig/command/action/role/publish.rb', line 36 def base_package_can_come_from_descriptor?() return false end |
#cares_about_asset_options? ⇒ Boolean
24 25 26 |
# File 'lib/fig/command/action/role/publish.rb', line 24 def () return true end |
#configure(options) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/fig/command/action/role/publish.rb', line 57 def configure() @descriptor = .descriptor @environment_statements = .environment_statements @asset_statements = .asset_statements @force = .force? return end |
#derive_publish_statements_from_environment_statements ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/fig/command/action/role/publish.rb', line 95 def derive_publish_statements_from_environment_statements if @execution_context.package_load_path_description = 'Cannot publish based upon both a package definition file (' << @execution_context.package_load_path_description << ') and --set/--append options.' if @execution_context.package_source_description == Fig::Command::PackageLoader::DEFAULT_PACKAGE_FILE || @execution_context.package_source_description == Fig::Command::PackageLoader::DEFAULT_APPLICATION_FILE || << "\n\n" << 'You can avoid loading ' << @execution_context.package_source_description << ' by using the --no-file option.' end raise Fig::UserInputError.new() end @publish_statements = @asset_statements + [ Fig::Statement::Configuration.new( nil, nil, Fig::Package::DEFAULT_CONFIG, @environment_statements ) ] return end |
#descriptor_requirement ⇒ Object
14 15 16 |
# File 'lib/fig/command/action/role/publish.rb', line 14 def descriptor_requirement() return :required end |
#load_base_package? ⇒ Boolean
32 33 34 |
# File 'lib/fig/command/action/role/publish.rb', line 32 def load_base_package?() return true end |
#modifies_repository? ⇒ Boolean
28 29 30 |
# File 'lib/fig/command/action/role/publish.rb', line 28 def modifies_repository?() return true end |
#publish? ⇒ Boolean
Is this a publish action?
53 54 55 |
# File 'lib/fig/command/action/role/publish.rb', line 53 def publish?() return true end |
#publish_preflight ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/fig/command/action/role/publish.rb', line 66 def publish_preflight() if @descriptor.name.nil? || @descriptor.version.nil? raise Fig::UserInputError.new( 'Please specify a package name and a version name.' ) end if @descriptor.name == '_meta' raise Fig::UserInputError.new( %q<Due to implementation issues, cannot create a package named "_meta".> ) end if not @environment_statements.empty? derive_publish_statements_from_environment_statements elsif not @asset_statements.empty? raise Fig::UserInputError.new( '--resource/--archive options were specified, but no --set/--append option was given. Will not publish.' ) else if not @execution_context.base_package.statements.empty? @publish_statements = @execution_context.base_package.statements else raise Fig::UserInputError.new('Nothing to publish.') end end return end |
#register_base_package? ⇒ Boolean
40 41 42 |
# File 'lib/fig/command/action/role/publish.rb', line 40 def register_base_package?() return false end |