Module: SnapCiManualTrigger
- Defined in:
- lib/snap_ci_manual_trigger.rb,
lib/snap_ci_manual_trigger/service.rb,
lib/snap_ci_manual_trigger/version.rb,
lib/generators/snap_ci_manual_trigger/rake_tasks_generator.rb
Defined Under Namespace
Modules: Generators Classes: InvalidCredentialsError, InvalidResourceError, MissingRakeArgumentsError, MissingRakeAuthError, Service
Constant Summary collapse
- DEFAULT_BRANCH_NAME =
'master'.freeze
- VERSION =
'1.0.1'
Class Method Summary collapse
Class Method Details
.for(user:, api_key:, owner:, repository:, branch_name: DEFAULT_BRANCH_NAME, connection: nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/snap_ci_manual_trigger.rb', line 25 def self.for(user:, api_key:, owner:, repository:, branch_name: DEFAULT_BRANCH_NAME, connection: nil) raise InvalidCredentialsError, 'it needs both user and api_key' unless user.present? && api_key.present? raise InvalidResourceError, 'it needs an owner' unless owner.present? raise InvalidResourceError, 'it needs an repository' unless repository.present? Service.new user: user, api_key: api_key, owner: owner, repository: repository, branch_name: branch_name, connection: connection end |