Module: Easycompile

Includes:
Constants
Defined in:
lib/easycompile/base/gem.rb,
lib/easycompile/base/run.rb,
lib/easycompile/base/base.rb,
lib/easycompile/base/menu.rb,
lib/easycompile/base/misc.rb,
lib/easycompile/base/cmake.rb,
lib/easycompile/base/reset.rb,
lib/easycompile/easycompile.rb,
lib/easycompile/base/colours.rb,
lib/easycompile/base/esystem.rb,
lib/easycompile/base/constants.rb,
lib/easycompile/base/initialize.rb,
lib/easycompile/project/project.rb,
lib/easycompile/version/version.rb,
lib/easycompile/toplevel_methods.rb,
lib/easycompile/compile_as_appdir.rb,
lib/easycompile/constants/constants.rb,
lib/easycompile/toplevel_methods/copy_file.rb,
lib/easycompile/toplevel_methods/rinstall2.rb,
lib/easycompile/toplevel_methods/is_archive.rb,
lib/easycompile/constants/array_possible_archives.rb

Overview

#

require 'easycompile/constants/array_possible_archives.rb'

#

Defined Under Namespace

Modules: Constants Classes: Base, CompileAsAppdir, Easycompile

Constant Summary collapse

PROJECT_BASE_DIRECTORY =
#

PROJECT_BASE_DIRECTORY

#
File.absolute_path("#{__dir__}/..")+'/'
PROJECT_BASE_DIR =
#

PROJECT_BASE_DIR

#
PROJECT_BASE_DIRECTORY
VERSION =
#

Easycompile::VERSION

#
'0.1.2'
LAST_UPDATE =
#

Easycompile::LAST_UPDATE

#
'23.01.2020'

Constants included from Constants

Constants::ARRAY_POSSIBLE_ARCHIVES, Constants::CMAKE_FILE, Constants::DEPOT_TEMP, Constants::ERROR_LINE, Constants::FILE_NAME_OF_THE_BUILD_DIRECTORY, Constants::INDIVIDUAL_COOKBOOKS, Constants::LAST_DOWNLOADED_FILE, Constants::LOCATION_OF_SETUP_RB, Constants::MESON_BUILD_FILE, Constants::MY_PROGRAMS, Constants::NAMESPACE, Constants::PROGRAM_DIR, Constants::RUBY_SRC, Constants::SHALL_WE_CREATE_A_BUILD_DIRECTORY, Constants::SRC_DIR, Constants::TEMP

Class Method Summary collapse

Methods included from Constants

#ruby_src?, #source_dir?, #temp_dir?

Class Method Details

.[](i = nil, *optional_arguments) ⇒ Object

#

Easycompile[]

This method is special. If we do not provide any argument, we will try to randomly fetch an entry.

#

27
28
29
30
31
32
# File 'lib/easycompile/toplevel_methods.rb', line 27

def self.[](i = nil, *optional_arguments)
  if i.nil?
    i = try_to_randomly_fetch_an_archive_from_the_current_directory
  end
  Easycompile.new(i, optional_arguments)
end

.compile(i, optional_compile_as_appdir = false) ⇒ Object

#

Easycompile.compile

#

37
38
39
40
41
42
43
# File 'lib/easycompile/toplevel_methods.rb', line 37

def self.compile(i, optional_compile_as_appdir = false)
  if optional_compile_as_appdir
    CompileAsAppdir[i]
  else
    Easycompile.new(i)
  end
end

.copy_file(from, to = Dir.pwd) ⇒ Object

#

Easycompile.copy_file

#

14
15
16
17
18
# File 'lib/easycompile/toplevel_methods/copy_file.rb', line 14

def self.copy_file(
    from, to = Dir.pwd
  )
  FileUtils.cp(from, to)
end

.is_archive?(i) ⇒ Boolean

#

Easycompile.is_archive?

#

Returns:

  • (Boolean)

14
15
16
17
# File 'lib/easycompile/toplevel_methods/is_archive.rb', line 14

def self.is_archive?(i)
  filetype = File.extname(i).delete('.')
  ARRAY_POSSIBLE_ARCHIVES.include? filetype
end

.project_base_dir?Boolean

#

Easycompile.project_base_dir?

#

Returns:

  • (Boolean)

23
24
25
# File 'lib/easycompile/project/project.rb', line 23

def self.project_base_dir?
  PROJECT_BASE_DIRECTORY
end

.rinstall2Object

#

Easycompile.rinstall2

How to install ruby-stuff without gems, by using good oldschool setup.rb.

#

18
19
20
21
22
23
24
25
26
27
# File 'lib/easycompile/toplevel_methods/rinstall2.rb', line 18

def self.rinstall2
  copy_file ::Easycompile::Constants::LOCATION_OF_SETUP_RB,
            Dir.pwd
  esystem 'ruby setup.rb --quiet config'
  esystem 'ruby setup.rb --quiet setup'
  esystem 'ruby setup.rb --quiet install'
  File.delete('setup.rb')       if File.exist? 'setup.rb'
  File.delete('InstalledFiles') if File.exist? 'InstalledFiles'
  File.delete('.config')        if File.exist? '.config'
end

.try_to_randomly_fetch_an_archive_from_the_current_directoryObject

#

Easycompile.try_to_randomly_fetch_an_archive_from_the_current_directory

#

48
49
50
51
52
# File 'lib/easycompile/toplevel_methods.rb', line 48

def self.try_to_randomly_fetch_an_archive_from_the_current_directory
  _ = Dir['*']
  _.select! {|entry| is_archive? entry }
  _
end

.version?Boolean

#

version?

#

Returns:

  • (Boolean)

20
21
22
# File 'lib/easycompile/version/version.rb', line 20

def self.version?
  Easycompile::VERSION
end