rake_github 0.2.0.pre.7 → 0.2.0.pre.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbd266032759ede378725418625961901693bae80cb1b500edb238529fed26dd
4
- data.tar.gz: 64b1d98742748556180c5b8bcfe6619f6c22f609b7be1b86206813a6facd8021
3
+ metadata.gz: 635f347172ffcbe700f7098ead378d975c5a46cb76fa3702875ddaa22a925083
4
+ data.tar.gz: 68acc3d79ea8cc8d38486d884112b8f23857417dfc6323db4260be74531c122a
5
5
  SHA512:
6
- metadata.gz: bf65aecbd3001768c38156a3cf0ceccfa152fef818fc670695c5cc90a077b2bb2e0cd44907cd71eef627faebc0d780a00911f1064b4deec06f5f49ee94448214
7
- data.tar.gz: 2324fb85ed1ed9446cfa382bb80a49813590a834c9910cc413bdbc09c7d1e74bf3d4077d8f4cb754e48df32f714c55d1c5a84131e11114d7d919741e70216490
6
+ metadata.gz: bd86567f0aa319ec415202cc4e4b940e13c500b2d338853aa12dd55d1eaf7a84486c79cc636874980e81396f927e03f05682e74c39ff2d65d2fad2d119e09cb3
7
+ data.tar.gz: 67a64f1c327f8268403a873ee098b339787be319cdb110d7c5c490e871fc08b27a6a5700d22ca43beb6dcbd02af73618c779906babea986a2cbb7a65d7a70a3d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_github (0.2.0.pre.7)
4
+ rake_github (0.2.0.pre.8)
5
5
  colored2 (~> 3.1)
6
6
  octokit (~> 4.16)
7
7
  rake_factory (~> 0.23)
@@ -0,0 +1,58 @@
1
+ require 'rake_factory'
2
+
3
+ require_relative '../tasks'
4
+
5
+ module RakeGithub
6
+ module TaskSets
7
+ class Repository < RakeFactory::TaskSet
8
+ prepend RakeFactory::Namespaceable
9
+
10
+ parameter :repository, required: true
11
+ parameter :access_token, required: true
12
+ parameter :deploy_keys, default: []
13
+
14
+ parameter :deploy_keys_namespace, default: :deploy_keys
15
+ parameter :deploy_keys_destroy_task_name, default: :destroy
16
+ parameter :deploy_keys_provision_task_name, default: :provision
17
+ parameter :deploy_keys_ensure_task_name, default: :ensure
18
+
19
+ task Tasks::DeployKeys::Provision,
20
+ name: RakeFactory::DynamicValue.new { |ts|
21
+ ts.deploy_keys_provision_task_name
22
+ }
23
+ task Tasks::DeployKeys::Destroy,
24
+ name: RakeFactory::DynamicValue.new { |ts|
25
+ ts.deploy_keys_destroy_task_name
26
+ }
27
+ task Tasks::DeployKeys::Ensure,
28
+ name: RakeFactory::DynamicValue.new { |ts|
29
+ ts.deploy_keys_ensure_task_name
30
+ },
31
+ provision_task_name: RakeFactory::DynamicValue.new { |ts|
32
+ ts.deploy_keys_provision_task_name
33
+ },
34
+ destroy_task_name: RakeFactory::DynamicValue.new { |ts|
35
+ ts.deploy_keys_destroy_task_name
36
+ }
37
+
38
+ def define_on(application)
39
+ around_define(application) do
40
+ self.class.tasks.each do |task_definition|
41
+ ns = case task_definition.klass.to_s
42
+ when /DeployKeys/
43
+ deploy_keys_namespace
44
+ else
45
+ nil
46
+ end
47
+
48
+ application.in_namespace(ns) do
49
+ task_definition
50
+ .for_task_set(self)
51
+ .define_on(application)
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -1 +1,2 @@
1
1
  require_relative 'task_sets/deploy_keys'
2
+ require_relative 'task_sets/repository'
@@ -1,3 +1,3 @@
1
1
  module RakeGithub
2
- VERSION = '0.2.0.pre.7'
2
+ VERSION = '0.2.0.pre.8'
3
3
  end
data/lib/rake_github.rb CHANGED
@@ -6,4 +6,8 @@ module RakeGithub
6
6
  def self.define_deploy_keys_tasks(opts = {}, &block)
7
7
  RakeGithub::TaskSets::DeployKeys.define(opts, &block)
8
8
  end
9
+
10
+ def self.define_repository_tasks(opts = {}, &block)
11
+ RakeGithub::TaskSets::Repository.define(opts, &block)
12
+ end
9
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre.7
4
+ version: 0.2.0.pre.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
@@ -199,6 +199,7 @@ files:
199
199
  - lib/rake_github.rb
200
200
  - lib/rake_github/task_sets.rb
201
201
  - lib/rake_github/task_sets/deploy_keys.rb
202
+ - lib/rake_github/task_sets/repository.rb
202
203
  - lib/rake_github/tasks.rb
203
204
  - lib/rake_github/tasks/deploy_keys.rb
204
205
  - lib/rake_github/tasks/deploy_keys/destroy.rb