Class: EasyCreds::Project::Standalone
- Inherits:
-
Object
- Object
- EasyCreds::Project::Standalone
- Defined in:
- lib/easy_creds/project.rb
Overview
Represents a non-Rails directory (standalone usage).
Instance Attribute Summary collapse
-
#global_dir ⇒ Object
readonly
Returns the value of attribute global_dir.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Instance Method Summary collapse
- #config_file_path ⇒ Object
- #credentials_dir ⇒ Object
- #environments_dir ⇒ Object
- #example_template_path ⇒ Object
- #git_repo? ⇒ Boolean
- #gitignore_path ⇒ Object
-
#initialize(root:, slug:, global_dir:) ⇒ Standalone
constructor
A new instance of Standalone.
- #log_dir ⇒ Object
- #rails? ⇒ Boolean
- #standalone? ⇒ Boolean
Constructor Details
#initialize(root:, slug:, global_dir:) ⇒ Standalone
Returns a new instance of Standalone.
56 57 58 59 60 |
# File 'lib/easy_creds/project.rb', line 56 def initialize(root:, slug:, global_dir:) @root = Pathname.new(root.to_s) @slug = slug @global_dir = Pathname.new(global_dir.to_s) end |
Instance Attribute Details
#global_dir ⇒ Object (readonly)
Returns the value of attribute global_dir.
54 55 56 |
# File 'lib/easy_creds/project.rb', line 54 def global_dir @global_dir end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
54 55 56 |
# File 'lib/easy_creds/project.rb', line 54 def root @root end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
54 55 56 |
# File 'lib/easy_creds/project.rb', line 54 def slug @slug end |
Instance Method Details
#config_file_path ⇒ Object
71 |
# File 'lib/easy_creds/project.rb', line 71 def config_file_path = nil |
#credentials_dir ⇒ Object
66 |
# File 'lib/easy_creds/project.rb', line 66 def credentials_dir = @global_dir.join('projects', slug) |
#environments_dir ⇒ Object
67 |
# File 'lib/easy_creds/project.rb', line 67 def environments_dir = nil |
#example_template_path ⇒ Object
70 |
# File 'lib/easy_creds/project.rb', line 70 def example_template_path = credentials_dir.join('example.yml') |
#git_repo? ⇒ Boolean
69 |
# File 'lib/easy_creds/project.rb', line 69 def git_repo? = @root.join('.git').exist? |
#gitignore_path ⇒ Object
68 |
# File 'lib/easy_creds/project.rb', line 68 def gitignore_path = @root.join('.gitignore') |
#log_dir ⇒ Object
65 |
# File 'lib/easy_creds/project.rb', line 65 def log_dir = @global_dir.join('log') |
#rails? ⇒ Boolean
62 |
# File 'lib/easy_creds/project.rb', line 62 def rails? = false |
#standalone? ⇒ Boolean
63 |
# File 'lib/easy_creds/project.rb', line 63 def standalone? = true |