Class: EasyCreds::Project::Standalone

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_creds/project.rb

Overview

Represents a non-Rails directory (standalone usage).

Instance Attribute Summary collapse

Instance Method Summary collapse

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_dirObject (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

#rootObject (readonly)

Returns the value of attribute root.



54
55
56
# File 'lib/easy_creds/project.rb', line 54

def root
  @root
end

#slugObject (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_pathObject



71
# File 'lib/easy_creds/project.rb', line 71

def config_file_path = nil

#credentials_dirObject



66
# File 'lib/easy_creds/project.rb', line 66

def credentials_dir  = @global_dir.join('projects', slug)

#environments_dirObject



67
# File 'lib/easy_creds/project.rb', line 67

def environments_dir = nil

#example_template_pathObject



70
# File 'lib/easy_creds/project.rb', line 70

def example_template_path = credentials_dir.join('example.yml')

#git_repo?Boolean

Returns:

  • (Boolean)


69
# File 'lib/easy_creds/project.rb', line 69

def git_repo?        = @root.join('.git').exist?

#gitignore_pathObject



68
# File 'lib/easy_creds/project.rb', line 68

def gitignore_path   = @root.join('.gitignore')

#log_dirObject



65
# File 'lib/easy_creds/project.rb', line 65

def log_dir          = @global_dir.join('log')

#rails?Boolean

Returns:

  • (Boolean)


62
# File 'lib/easy_creds/project.rb', line 62

def rails? = false

#standalone?Boolean

Returns:

  • (Boolean)


63
# File 'lib/easy_creds/project.rb', line 63

def standalone? = true