Top Level Namespace

Defined Under Namespace

Modules: Raykit Classes: Dir, String

Constant Summary collapse

BUFFER_SIZE =

Constants

1024
RAKE_DIRECTORY =
Rake.application.original_dir
DEFAULT_SUBDIRECTORIES =
%w[src test examples]
DEFAULT_FILES =
%w[README.md LICENSE.md .gitignore]
RAYKIT_GLOBALS =
true
RAYKIT_AUTO_SETUP =
false
DEFAULT_GITIGNORE_CONTENT =

Constants

Raykit::DefaultContent::gitignore
PROJECT =
Raykit::Project.new
SECRETS =
Raykit::Secrets.new
REPOSITORIES =
Raykit::Git::Repositories.new("#{Raykit::Environment.get_dev_dir("log")}/Raykit.Git.Repositories.json")
GIT_DIRECTORY =
Raykit::Git::Directory.new(Rake.application.original_dir)
NUGET_DIR =
Raykit::Environment::get_dev_dir("nuget")
PUBLISH_DIR =
Raykit::Environment::get_dev_dir("publish")
LOG =
Raykit::Logging.new
MARKDOWN =
Raykit::Markdown.new

Instance Method Summary collapse

Instance Method Details

#copy_file_to_dir(file, dir) ⇒ Object



115
116
117
# File 'lib/raykit.rb', line 115

def copy_file_to_dir(file, dir)
  Raykit::FileSystem::copy_file_to_dir(file, dir)
end

#copy_files(src_dir, target_dir, glob) ⇒ Object



111
112
113
# File 'lib/raykit.rb', line 111

def copy_files(src_dir, target_dir, glob)
  Raykit::FileSystem::copy_files(src_dir, target_dir, glob)
end

#dir(name) ⇒ Object



58
59
60
# File 'lib/raykit.rb', line 58

def dir(name)
  FileUtils.mkdir("artifacts") if (!Dir.exist?(name))
end

#make(artifact, command) ⇒ Object



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

def make(artifact, command)
  if (File.exist?(artifact))
    puts "  #{artifact} exists"
  else
    cmd = run(command)
    if (cmd.exitstatus != 0)
      File.delete(artifact) if (File.exist?(artifact))
    end
    cmd
  end
end

#make_log(artifact, command) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/raykit.rb', line 74

def make_log(artifact, command)
  if (File.exist?(artifact))
    puts "  #{artifact} exists"
  else
    cmd = run(command).log_to_file(artifact)
    if (cmd.exitstatus != 0)
      File.delete(artifact) if (File.exist?(artifact))
    end
    cmd
  end
end

#run(command, quit_on_failure = true) ⇒ Object



50
51
52
# File 'lib/raykit.rb', line 50

def run(command, quit_on_failure = true)
  Raykit::TopLevel.run(command, quit_on_failure)
end

#show(symbol) ⇒ Object



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

def show(symbol)
  show_binding(symbol, binding)
end

#show_binding(symbol, the_binding) ⇒ Object



98
99
100
# File 'lib/raykit.rb', line 98

def show_binding(symbol, the_binding)
  show_value symbol.to_s, eval(symbol.to_s, the_binding)
end

#show_table(symbols) ⇒ Object



107
108
109
# File 'lib/raykit.rb', line 107

def show_table(symbols)
  Raykit::Log.show_table(symbols)
end

#show_value(name, value) ⇒ Object



102
103
104
105
# File 'lib/raykit.rb', line 102

def show_value(name, value)
  Raykit::Log.show_value(name, value)
  PROJECT.values[name] = value
end

#start_task(task_name) ⇒ Object



90
91
92
# File 'lib/raykit.rb', line 90

def start_task(task_name)
  Raykit::Log.start_task(task_name)
end

#tag(name) ⇒ Object



86
87
88
# File 'lib/raykit.rb', line 86

def tag(name)
  puts Rainbow(": #{name}").blue.bright
end

#try(command) ⇒ Object



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

def try(command)
  Raykit::TopLevel.run(command, false)
end