class Gitomator::Context

Constants

DEFAULT_CONFIG

Public Class Methods

from_file(config_file) click to toggle source

Convenience function to create Context instances from configuration files. @param config_file [String/File] - YAML configuration file.

# File lib/gitomator/context.rb, line 57
def self.from_file(config_file)
  return new(Gitomator::Util.load_config(config_file))
end
new(config={}) click to toggle source
Calls superclass method Gitomator::BaseContext::new
# File lib/gitomator/context.rb, line 69
def initialize(config={})
  super(DEFAULT_CONFIG.merge(config))
end

Public Instance Methods

create_github_hosting_service(config) click to toggle source

Services from here onwards should have really been plug-ins. Unfortuantely, I don't know of a clean way to do that in Ruby.

# File lib/gitomator/context.rb, line 99
def create_github_hosting_service(config)
  require 'gitomator/service/hosting'
  require 'gitomator/github/hosting_provider'

  return Gitomator::Service::Hosting.new (
    Gitomator::GitHub::HostingProvider.from_config(config))
end
create_github_tagging_service(config) click to toggle source
# File lib/gitomator/context.rb, line 121
def create_github_tagging_service(config)
  require 'gitomator/service/tagging'
  require 'gitomator/github/tagging_provider'

  return Gitomator::Service::Tagging.new (
    Gitomator::GitHub::TaggingProvider.from_config(config))
end
create_local_hosting_service(config) click to toggle source
# File lib/gitomator/context.rb, line 74
def create_local_hosting_service(config)
  require 'gitomator/service/hosting'
  require 'gitomator/service_provider/hosting_local'
  require 'tmpdir'

  dir = config['dir'] || Dir.mktmpdir('Gitomator_')
  return Gitomator::Service::Hosting.new (
    Gitomator::ServiceProvider::HostingLocal.new(git, dir)
  )
end
create_shell_git_service(_) click to toggle source
# File lib/gitomator/context.rb, line 86
def create_shell_git_service(_)
  require 'gitomator/service/git'
  require 'gitomator/service_provider/git_shell'
  Gitomator::Service::Git.new(Gitomator::ServiceProvider::GitShell.new())
end
create_travis_ci_service(config) click to toggle source
# File lib/gitomator/context.rb, line 108
def create_travis_ci_service(config)
  require 'gitomator/service/ci'
  require 'gitomator/travis/ci_provider'

  return Gitomator::Service::CI.new(
    Gitomator::Travis::CIProvider.from_config(config))
end
create_travis_pro_ci_service(config) click to toggle source
# File lib/gitomator/context.rb, line 116
def create_travis_pro_ci_service(config)
  create_travis_ci_service(config)
end