Class: FlossFunding::Library
- Inherits:
-
Object
- Object
- FlossFunding::Library
- Includes:
- FileFinder
- Defined in:
- lib/floss_funding/library.rb
Overview
Represents a single Library (a gem/namespace pair) that has included
FlossFunding::Poke. Holds discovery info, configuration, and env details.
Instance Attribute Summary collapse
-
#base_name ⇒ String
readonly
including module’s actual name.
-
#config ⇒ FlossFunding::Configuration
readonly
-
#env_var_name ⇒ String
readonly
-
#including_path ⇒ String
readonly
-
#library_config_path ⇒ String
readonly
-
#library_name ⇒ String
readonly
-
#library_root_path ⇒ String
readonly
-
#namespace ⇒ String
readonly
Namespace computed from base_name (including module’s actual name), and custom_namespace.
-
#seen_at ⇒ Time
readonly
-
#silence ⇒ Object
readonly
May be boolean or callable as provided.
Instance Method Summary collapse
-
#gem_name ⇒ Object
Convenience: gem_name used by CLI; alias to library_name for now.
-
#initialize(library_name, ns, custom_ns, base_name, including_path, root_path, config_path, env_var_name, config, silent) ⇒ Library
constructor
Initialize a new Library record.
Methods included from FileFinder
#find_file_upwards, #find_last_file_upwards, root_level=, root_level?
Constructor Details
#initialize(library_name, ns, custom_ns, base_name, including_path, root_path, config_path, env_var_name, config, silent) ⇒ Library
Initialize a new Library record.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/floss_funding/library.rb', line 57 def initialize(library_name, ns, custom_ns, base_name, including_path, root_path, config_path, env_var_name, config, silent) @library_name = library_name @namespace = ns.name @base_name = base_name @including_path = including_path @env_var_name = env_var_name @silence = silent @custom_ns = custom_ns @library_root_path = root_path @library_config_path = config_path @config = config # In normal runtime we don't care about the @seen_at value, as this isn't an interactive library. # @seen_at is only useful for debugging; e.g., could be used to order libraries by time of discovery @seen_at = DEBUG ? Time.now : FlossFunding.loaded_at freeze end |
Instance Attribute Details
#base_name ⇒ String (readonly)
including module’s actual name
21 22 23 |
# File 'lib/floss_funding/library.rb', line 21 def base_name @base_name end |
#config ⇒ FlossFunding::Configuration (readonly)
38 39 40 |
# File 'lib/floss_funding/library.rb', line 38 def config @config end |
#env_var_name ⇒ String (readonly)
28 29 30 |
# File 'lib/floss_funding/library.rb', line 28 def env_var_name @env_var_name end |
#including_path ⇒ String (readonly)
26 27 28 |
# File 'lib/floss_funding/library.rb', line 26 def including_path @including_path end |
#library_config_path ⇒ String (readonly)
32 33 34 |
# File 'lib/floss_funding/library.rb', line 32 def library_config_path @library_config_path end |
#library_name ⇒ String (readonly)
24 25 26 |
# File 'lib/floss_funding/library.rb', line 24 def library_name @library_name end |
#library_root_path ⇒ String (readonly)
30 31 32 |
# File 'lib/floss_funding/library.rb', line 30 def library_root_path @library_root_path end |
#namespace ⇒ String (readonly)
Namespace computed from base_name (including module’s actual name), and custom_namespace
17 18 19 |
# File 'lib/floss_funding/library.rb', line 17 def namespace @namespace end |
#seen_at ⇒ Time (readonly)
34 35 36 |
# File 'lib/floss_funding/library.rb', line 34 def seen_at @seen_at end |
#silence ⇒ Object (readonly)
Returns may be boolean or callable as provided.
36 37 38 |
# File 'lib/floss_funding/library.rb', line 36 def silence @silence end |
Instance Method Details
#gem_name ⇒ Object
Convenience: gem_name used by CLI; alias to library_name for now
41 42 43 |
# File 'lib/floss_funding/library.rb', line 41 def gem_name @library_name end |