Class: Fig::Command::Action::SourcePackage
Constant Summary
EXIT_FAILURE, EXIT_SUCCESS
Instance Attribute Summary
#execution_context
Instance Method Summary
collapse
#sub_action?
#allow_both_descriptor_and_file?, #base_package_can_come_from_descriptor?, #cares_about_asset_options?, #execute_immediately_after_command_line_parse?, #list_dependencies?, #list_variables?, #prepare_repository, #primary_option, #publish?, #remote_operation_necessary?, #reset_environment?, #retrieves_should_happen?
Instance Method Details
#apply_base_config? ⇒ Boolean
38
39
40
|
# File 'lib/fig/command/action/source_package.rb', line 38
def apply_base_config?()
return true
end
|
#apply_config? ⇒ Boolean
34
35
36
|
# File 'lib/fig/command/action/source_package.rb', line 34
def apply_config?()
return true
end
|
42
43
44
|
# File 'lib/fig/command/action/source_package.rb', line 42
def configure(options)
@file = options.file_to_find_package_for
end
|
#descriptor_requirement ⇒ Object
18
19
20
|
# File 'lib/fig/command/action/source_package.rb', line 18
def descriptor_requirement()
return nil
end
|
#execute ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/fig/command/action/source_package.rb', line 46
def execute()
if ! File.exist? @file
$stderr.puts %Q<"#{@file}" does not exist.>
return EXIT_FAILURE
end
if File.directory? @file
$stderr.puts(
%Q<"#{@file}" is a directory. Fig does not keep track of directories.>
)
return EXIT_FAILURE
end
maintainer = @execution_context.working_directory_maintainer
if not maintainer
$stderr.puts(
%Q<Cannot answer what source packages are because retrieves are not active. Try again, but additionally specify --update or --update-if-missing.>
)
return EXIT_FAILURE
end
package_version = maintainer.find_package_version_for_file @file
if ! package_version
$stderr.puts(
%Q<Don't know anything about "#{@file}". It is not in the list of files that resulted from a "retrieve".>
)
return EXIT_FAILURE
end
puts package_version
return EXIT_SUCCESS
end
|
#load_base_package? ⇒ Boolean
26
27
28
|
# File 'lib/fig/command/action/source_package.rb', line 26
def load_base_package?()
return true
end
|
#modifies_repository? ⇒ Boolean
22
23
24
|
# File 'lib/fig/command/action/source_package.rb', line 22
def modifies_repository?()
return false
end
|
#options ⇒ Object
14
15
16
|
# File 'lib/fig/command/action/source_package.rb', line 14
def options()
return %w<--get>
end
|
#register_base_package? ⇒ Boolean
30
31
32
|
# File 'lib/fig/command/action/source_package.rb', line 30
def register_base_package?()
return true
end
|