Class: GetVersion::ExecutableStore
- Inherits:
-
Object
- Object
- GetVersion::ExecutableStore
- Defined in:
- lib/getversion/executable_store.rb
Instance Method Summary collapse
- #add_executable(name, namespace, &block) ⇒ Object
- #get_version(name) ⇒ Object
- #guess_version(name) ⇒ Object
-
#initialize ⇒ ExecutableStore
constructor
A new instance of ExecutableStore.
Constructor Details
#initialize ⇒ ExecutableStore
Returns a new instance of ExecutableStore.
6 7 8 |
# File 'lib/getversion/executable_store.rb', line 6 def initialize @executables = [] end |
Instance Method Details
#add_executable(name, namespace, &block) ⇒ Object
20 21 22 |
# File 'lib/getversion/executable_store.rb', line 20 def add_executable(name, namespace, &block) @executables << Executable.new(name, namespace, &block) end |
#get_version(name) ⇒ Object
10 11 12 13 |
# File 'lib/getversion/executable_store.rb', line 10 def get_version(name) executable = find_executable(name) || null_executable(name) executable.version end |
#guess_version(name) ⇒ Object
15 16 17 18 |
# File 'lib/getversion/executable_store.rb', line 15 def guess_version(name) executable = find_executable(name) || executable_for_guessing(name) executable.version end |