Class: Repository::Config
- Inherits:
-
Object
- Object
- Repository::Config
- Defined in:
- lib/devlogs/repository/config.rb
Defined Under Namespace
Classes: MirrorConfig
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
FIXME: Need to figure out file path.
-
#file_path ⇒ Object
readonly
FIXME: Need to figure out file path.
-
#mirror ⇒ Object
readonly
FIXME: Need to figure out file path.
-
#name ⇒ Object
readonly
FIXME: Need to figure out file path.
-
#short_code ⇒ Object
readonly
FIXME: Need to figure out file path.
-
#template_file_path ⇒ Object
readonly
FIXME: Need to figure out file path.
Instance Method Summary collapse
-
#initialize(path, opts = {}) ⇒ Config
constructor
A new instance of Config.
-
#mirror? ⇒ Boolean
Returns whether or not the devlogs repository is configured to mirror.
-
#path(with_trailing: false) ⇒ Object
Ensures no weird double trailing slash path values.
Constructor Details
#initialize(path, opts = {}) ⇒ Config
Returns a new instance of Config.
12 13 14 15 16 17 18 19 |
# File 'lib/devlogs/repository/config.rb', line 12 def initialize(path, opts = {}) @file_path = path @template_file_path = opts[:template_file_path] @name = opts[:name] @short_code = opts[:short_code] @description = opts[:description] @mirror = MirrorConfig.new(opts[:mirror]) end |
Instance Attribute Details
#description ⇒ Object (readonly)
FIXME: Need to figure out file path
7 8 9 |
# File 'lib/devlogs/repository/config.rb', line 7 def description @description end |
#file_path ⇒ Object (readonly)
FIXME: Need to figure out file path
7 8 9 |
# File 'lib/devlogs/repository/config.rb', line 7 def file_path @file_path end |
#mirror ⇒ Object (readonly)
FIXME: Need to figure out file path
7 8 9 |
# File 'lib/devlogs/repository/config.rb', line 7 def mirror @mirror end |
#name ⇒ Object (readonly)
FIXME: Need to figure out file path
7 8 9 |
# File 'lib/devlogs/repository/config.rb', line 7 def name @name end |
#short_code ⇒ Object (readonly)
FIXME: Need to figure out file path
7 8 9 |
# File 'lib/devlogs/repository/config.rb', line 7 def short_code @short_code end |
#template_file_path ⇒ Object (readonly)
FIXME: Need to figure out file path
7 8 9 |
# File 'lib/devlogs/repository/config.rb', line 7 def template_file_path @template_file_path end |
Instance Method Details
#mirror? ⇒ Boolean
Returns whether or not the devlogs repository is configured to mirror
24 25 26 |
# File 'lib/devlogs/repository/config.rb', line 24 def mirror? @mirror.use_mirror end |
#path(with_trailing: false) ⇒ Object
Ensures no weird double trailing slash path values
29 30 31 32 33 34 35 |
# File 'lib/devlogs/repository/config.rb', line 29 def path(with_trailing: false) if with_trailing @file_path[-1] == "/" ? @path_value : @path_value + "/" else @file_path end end |