Module: Txgh

Defined in:
lib/txgh.rb,
lib/txgh/utils.rb,
lib/txgh/config.rb,
lib/txgh/errors.rb,
lib/txgh/events.rb,
lib/txgh/puller.rb,
lib/txgh/pusher.rb,
lib/txgh/version.rb,
lib/txgh/tx_logger.rb,
lib/txgh/github_api.rb,
lib/txgh/github_repo.rb,
lib/txgh/tx_resource.rb,
lib/txgh/parse_config.rb,
lib/txgh/github_status.rb,
lib/txgh/transifex_api.rb,
lib/txgh/diff_calculator.rb,
lib/txgh/category_support.rb,
lib/txgh/config/providers.rb,
lib/txgh/config/tx_config.rb,
lib/txgh/merge_calculator.rb,
lib/txgh/resource_deleter.rb,
lib/txgh/resource_updater.rb,
lib/txgh/response_helpers.rb,
lib/txgh/config/tx_manager.rb,
lib/txgh/resource_contents.rb,
lib/txgh/transifex_project.rb,
lib/txgh/config/config_pair.rb,
lib/txgh/config/key_manager.rb,
lib/txgh/resource_committer.rb,
lib/txgh/tx_branch_resource.rb,
lib/txgh/resource_downloader.rb,
lib/txgh/config/provider_support.rb,
lib/txgh/empty_resource_contents.rb,
lib/txgh/config/provider_instance.rb,
lib/txgh/config/providers/git_provider.rb,
lib/txgh/config/providers/raw_provider.rb,
lib/txgh/config/providers/file_provider.rb

Defined Under Namespace

Modules: CategorySupport, Config, ResponseHelpers, Utils Classes: ConfigNotFoundError, DiffCalculator, EmptyResourceContents, Events, GitConfigNotFoundError, GithubApi, GithubRepo, GithubStatus, InvalidProviderError, MergeCalculator, ParseConfig, ProjectConfigNotFoundError, Puller, Pusher, RepoConfigNotFoundError, ResourceCommitter, ResourceContents, ResourceDeleter, ResourceDownloader, ResourceUpdater, TransifexApi, TransifexApiError, TransifexNotFoundError, TransifexProject, TransifexUnauthorizedError, TxBranchResource, TxLogger, TxResource, TxghError, TxghInternalError

Constant Summary collapse

DEFAULT_ENV =
'development'
VERSION =
'5.4.0'

Class Method Summary collapse

Class Method Details

.envObject



61
62
63
# File 'lib/txgh.rb', line 61

def env
  ENV.fetch('TXGH_ENV', DEFAULT_ENV)
end

.eventsObject



45
46
47
# File 'lib/txgh.rb', line 45

def events
  @events ||= Events.new
end

.key_managerObject



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

def key_manager
  Txgh::Config::KeyManager
end

.providersObject



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

def providers
  Txgh::Config::Providers
end

.tx_managerObject



33
34
35
# File 'lib/txgh.rb', line 33

def tx_manager
  Txgh::Config::TxManager
end

.update_status_callback(options) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/txgh.rb', line 49

def update_status_callback(options)
  project = options.fetch(:project)
  repo = options.fetch(:repo)
  resource = options.fetch(:resource)

  GithubStatus.new(project, repo, resource).update(options.fetch(:sha))
rescue Octokit::UnprocessableEntity
  # raised because we've tried to create too many statuses for the commit
rescue Txgh::TransifexNotFoundError
  # raised if transifex resource can't be found
end