Class: Chom::App

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

Overview

The App class stores Chom’s functionality. It is executed with Chom::App.new.run.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApp

Creates Chom instance and assigns logged in user’s username to @user.



17
18
19
# File 'lib/chom.rb', line 17

def initialize
  @user = Etc.getlogin
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



14
15
16
# File 'lib/chom.rb', line 14

def user
  @user
end

Instance Method Details

#runObject

Chom command line utility executes run to recursively chown and chmod the current directory.



22
23
24
25
# File 'lib/chom.rb', line 22

def run
  chown_dir_and_files_recursively
  chmod_dir_and_files_recursively
end