danger-github_ext 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6811daa08f325b5223648e5fd7089827a967b832
4
- data.tar.gz: 3307f829adcf177b574db69b81a122884df1911a
3
+ metadata.gz: 9aef5642a691e206cec6442b330d56b7f5ac0e65
4
+ data.tar.gz: bf57496ae5dfb8cb3ac41cc74479331627077f2f
5
5
  SHA512:
6
- metadata.gz: 4577a6406ace00550f0d6ffa313b792f07120603ad58ec534f218e926dd9bbc0d00da0ff6348699e3a01c26881b8c80d7d3946c43a56d064dd945c48111b1246
7
- data.tar.gz: a43349f3e5de3ab5b35c43a09ede6c73d1e1b26e6c166acc0320b5b29dec1ac01bf98b9860e458c266351be774d3a7a4ddf762f07306603e73c58948187b96da
6
+ metadata.gz: 6fe40e4513e3eeaceae06e2fe94e09c9f90f78ba14bb42a965b9fafa2427da780453dea399a80317978a3dc2fe7469a3003ae7ccce00d3836fe16c24e0d96610
7
+ data.tar.gz: 7be2e05c1ea80a9e8a47ad1025ca75a3669ff5c5cb36c09e6545c65681a7e4d3277e3f65a32d13ef9f2cfc9475cf4f6775de6f2d1ffeae350ffb01d68f812302
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-github_ext (0.0.2)
4
+ danger-github_ext (0.0.3)
5
5
  danger-plugin-api (~> 1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -30,6 +30,26 @@ github.remove_labels 'build failed'</pre>
30
30
  github.statuses</pre>
31
31
  </blockquote>
32
32
 
33
+ <blockquote>Update the title of the pull request
34
+ <pre>
35
+ github.update_pr_tile 'Updated title'</pre>
36
+ </blockquote>
37
+
38
+ <blockquote>Update the body of the pull request
39
+ <pre>
40
+ github.update_pr_body 'Updated body'</pre>
41
+ </blockquote>
42
+
43
+ <blockquote>Close the pull request
44
+ <pre>
45
+ github.close</pre>
46
+ </blockquote>
47
+
48
+ <blockquote>Open the pull request
49
+ <pre>
50
+ github.open</pre>
51
+ </blockquote>
52
+
33
53
 
34
54
 
35
55
 
@@ -46,6 +66,14 @@ github.statuses</pre>
46
66
 
47
67
  `statuses` - get current commit statuses
48
68
 
69
+ `update_pr_title` - Update the title of the pull request
70
+
71
+ `update_pr_body` - Update the body of pull request
72
+
73
+ `close` - Close the pull request
74
+
75
+ `open` - Open the pull request
76
+
49
77
 
50
78
 
51
79
 
@@ -1,3 +1,3 @@
1
1
  module GithubExt
2
- VERSION = "0.0.2".freeze
2
+ VERSION = "0.0.3".freeze
3
3
  end
@@ -22,6 +22,22 @@ module Danger
22
22
  #
23
23
  # github.statuses
24
24
  #
25
+ # @example Update the title of the pull request
26
+ #
27
+ # github.update_pr_tile 'Updated title'
28
+ #
29
+ # @example Update the body of the pull request
30
+ #
31
+ # github.update_pr_body 'Updated body'
32
+ #
33
+ # @example Close the pull request
34
+ #
35
+ # github.close
36
+ #
37
+ # @example Open the pull request
38
+ #
39
+ # github.open
40
+ #
25
41
  # @see duck8823/danger-github_ext
26
42
  # @tags github
27
43
  #
@@ -92,5 +108,41 @@ module Danger
92
108
  val.sort{|a, b| b[:date] <=> a[:date] }[0]
93
109
  }
94
110
  end
111
+
112
+ # Update the title of the pull request
113
+ # @return [Sawyer::Resource]
114
+ #
115
+ def update_pr_title(title)
116
+ @repo ||= self.pr_json.base.repo.full_name
117
+ @number ||= self.pr_json.number
118
+ self.api.update_pull_request(@repo, @number, {:title => title})
119
+ end
120
+
121
+ # Update the body of pull request
122
+ # @return [Sawyer::Resource]
123
+ #
124
+ def update_pr_body(body)
125
+ @repo ||= self.pr_json.base.repo.full_name
126
+ @number ||= self.pr_json.number
127
+ self.api.update_pull_request(@repo, @number, {:body => body})
128
+ end
129
+
130
+ # Close the pull request
131
+ # @return [Sawyer::Resource]
132
+ #
133
+ def close
134
+ @repo ||= self.pr_json.base.repo.full_name
135
+ @number ||= self.pr_json.number
136
+ self.api.update_pull_request(@repo, @number, {:state => 'closed'})
137
+ end
138
+
139
+ # Open the pull request
140
+ # @return [Sawyer::Resource]
141
+ #
142
+ def open
143
+ @repo ||= self.pr_json.base.repo.full_name
144
+ @number ||= self.pr_json.number
145
+ self.api.update_pull_request(@repo, @number, {:state => 'open'})
146
+ end
95
147
  end
96
148
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-github_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-16 00:00:00.000000000 Z
11
+ date: 2017-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api