Class: Rcfiles::AggregateAllRcfiles

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

Overview

Rcfiles::AggregateAllRcfiles

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect
ARRAY_GATHER_FROM_THESE_FILES =
#

ARRAY_GATHER_FROM_THESE_FILES

#
%w(
  aliases_rc
  cd_aliases_rc
  cflags_rc
  compile_rc
  file_information_rc
  gnome_rc
  kde_rc
  kernel_rc
  lang_rc
  ldflags_rc
  ls_colours_rc
  network_rc
  path_variable_rc
  pkgconfig_rc
  programs_aliases_rc
  ps1_rc
  roeberia_settings_rc
  source_all_the_rc_files.sh
  system_rc
  system_settings_rc
  term_rc
  video_rc
)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commandline_arguments = nil, run_already = true) ⇒ AggregateAllRcfiles

#

initialize

#


62
63
64
65
66
67
68
69
70
71
# File 'lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb', line 62

def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

Roebe::AggregateAllRcfiles[]

#


129
130
131
# File 'lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb', line 129

def self.[](i = ARGV)
  new(i)
end

Instance Method Details

#commandline_arguments?Boolean

#

commandline_arguments?

#

Returns:

  • (Boolean)


94
95
96
# File 'lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb', line 94

def commandline_arguments?
  @commandline_arguments
end

#first_argument?Boolean Also known as: first?

#

first_argument?

#

Returns:

  • (Boolean)


101
102
103
# File 'lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb', line 101

def first_argument?
  @commandline_arguments.first
end

#resetObject

#

reset (reset tag)

#


76
77
78
79
80
81
# File 'lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb', line 76

def reset
  # ======================================================================= #
  # === @namespace
  # ======================================================================= #
  @namespace = NAMESPACE
end

#runObject

#

run (run tag)

#


108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb', line 108

def run
  _ = ''.dup
  base_dir = '/AUTOGENERATED/'
  ARRAY_GATHER_FROM_THESE_FILES.each {|entry|
    target = base_dir+entry.to_s
    if File.exist? target
      _ << File.read(target)
      _ << "\n"
    end
  }
  what = _
  into = base_dir+'aggregated_shell_file.sh'
  opn(namespace: @namespace); e ::Colours.rev+
                                'Now storing into the file `'+
                                ::Rcfiles.sfile(into)+'`.'
  ::Rcfiles.write_what_into(what, into)
end

#set_commandline_arguments(i = '') ⇒ Object

#

set_commandline_arguments

#


86
87
88
89
# File 'lib/rcfiles/aggregate_all_rcfiles/aggregate_all_rcfiles.rb', line 86

def set_commandline_arguments(i = '')
  i = [i].flatten.compact
  @commandline_arguments = i
end