Module: Samus

Defined in:
lib/samus.rb,
lib/samus/action.rb,
lib/samus/builder.rb,
lib/samus/command.rb,
lib/samus/version.rb,
lib/samus/publisher.rb,
lib/samus/rake/tasks.rb,
lib/samus/credentials.rb,
lib/samus/build_action.rb,
lib/samus/publish_action.rb

Defined Under Namespace

Modules: Rake Classes: Action, BuildAction, Builder, Command, Credentials, PublishAction, Publisher

Constant Summary collapse

CONFIG_PATH =
File.expand_path(ENV['SAMUS_CONFIG_PATH'] || '~/.samus')
VERSION =
'3.0.6'.freeze
@@config_paths =
[]

Class Method Summary collapse

Class Method Details

.config_pathsObject



15
# File 'lib/samus.rb', line 15

def config_paths; @@config_paths end

.error(msg) ⇒ Object



36
37
38
39
# File 'lib/samus.rb', line 36

def error(msg)
  puts "[E] #{msg}"
  exit(1)
end

.load_commandsObject



29
30
31
32
33
34
# File 'lib/samus.rb', line 29

def load_commands
  config_paths.each do |path|
    path = File.join(path, 'commands')
    Samus::Command.command_paths.unshift(path) if File.directory?(path)
  end
end

.load_configuration_directoryObject



19
20
21
22
23
24
25
26
27
# File 'lib/samus.rb', line 19

def load_configuration_directory
  if File.exist?(CONFIG_PATH)
    Dir.foreach(CONFIG_PATH) do |dir|
      next if dir == '.' || dir == '..'
      dir = File.join(CONFIG_PATH, dir)
      config_paths.unshift(dir) if File.directory?(dir)
    end
  end
end

.windows?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/samus.rb', line 41

def windows?
  ::RbConfig::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false
end