Class: EasyCreds::Project::Rails

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

Overview

Represents a Rails application project.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root:) ⇒ Rails

Returns a new instance of Rails.



35
36
37
# File 'lib/easy_creds/project.rb', line 35

def initialize(root:)
  @root = Pathname.new(root.to_s)
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



33
34
35
# File 'lib/easy_creds/project.rb', line 33

def root
  @root
end

Instance Method Details

#config_file_pathObject



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

def config_file_path = @root.join('config/easy_creds.yml')

#credentials_dirObject



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

def credentials_dir = @root.join('config/credentials')

#environments_dirObject



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

def environments_dir = @root.join('config/environments')

#example_template_pathObject



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

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

#git_repo?Boolean

Returns:

  • (Boolean)


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

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

#gitignore_pathObject



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

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

#log_dirObject



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

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

#rails?Boolean

Returns:

  • (Boolean)


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

def rails? = true

#slugObject



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

def slug = @root.basename.to_s

#standalone?Boolean

Returns:

  • (Boolean)


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

def standalone? = false