gitlab_awesome_release 0.1.0.beta6 → 0.1.0.beta7

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
  SHA1:
3
- metadata.gz: 2ed66cdb87806104213ff64c55a4ef882b40f4af
4
- data.tar.gz: 4a2670019037a5bfdbd2f7a934c0230fa91196e6
3
+ metadata.gz: 1c0eed3767a7d29e0651f78c873dc36f5bd13ee0
4
+ data.tar.gz: fd13563bad278be9c8d3055a09b429f10516d115
5
5
  SHA512:
6
- metadata.gz: 210c2476ac7ab7dfb574eb2eb7258a2dc3266d82880739299f7dbaddb6ff1d55665c22518445f01a2ee964898f1e03bd907b219fa06b0f072b194d814f090fc5
7
- data.tar.gz: bfef44f89224418257752c0888dc1cac939bc1fe7df5deb2751d673f2a5c3f84c000f03a1915103ff1eadfaa3a05998d94e89527918eee89d8064c2c8dadbf72
6
+ metadata.gz: e72936c53da657150d04467c4a5b06b30cbf58dc8f76daf0762327202815e86dca7003e9599755a231b096ef041c2706028c26a2db6215f8d2efd494abb7d4bd
7
+ data.tar.gz: af27d2340df14b6465b74d8e8cc3593515a38ebd6f9592ad3c572843dd12eed8be82e54553db75ba894934130fcf56caa63af1893147fa493c361f4ade8c442a
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  ## Unreleased
2
- [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta5...HEAD)
2
+ [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta6...HEAD)
3
3
 
4
4
 
5
+ ## v0.1.0.beta6
6
+ [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta5...v0.1.0.beta6)
7
+
8
+ * Add MR iid check [!12](https://gitlab.com/sue445/gitlab_awesome_release/merge_requests/12) *@sue445*
9
+ * Write document [!13](https://gitlab.com/sue445/gitlab_awesome_release/merge_requests/13) *@sue445*
10
+
5
11
  ## v0.1.0.beta5
6
12
  [full changelog](https://gitlab.com/sue445/gitlab_awesome_release/compare/v0.1.0.beta4...v0.1.0.beta5)
7
13
 
data/README.md CHANGED
@@ -3,7 +3,7 @@ Generate changelog from tags and MergeRequests on [GitLab](https://about.gitlab.
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/gitlab_awesome_release.svg)](https://badge.fury.io/rb/gitlab_awesome_release)
5
5
  [![build status](https://gitlab.com/ci/projects/9759/status.png?ref=master)](https://gitlab.com/ci/projects/9759?ref=master)
6
- [![Dependency Status](https://gemnasium.com/c2e0c69e2a02b4bb66481fb32f368e0e.svg)](https://gemnasium.com/a2f4eb18c1920eb39d8e9f1f807dd830)
6
+ [![Dependency Status](https://gemnasium.com/7f058801015a4fbcf603d936c08836a4.svg)](https://gemnasium.com/19478d2f2735ee355f4c6cd1b8d2c12e)
7
7
 
8
8
  ## Example
9
9
  see [CHANGELOG.md](CHANGELOG.md)
@@ -2,7 +2,7 @@ require "active_support/all"
2
2
  require "gitlab_awesome_release/version"
3
3
  require "gitlab_awesome_release/project"
4
4
  require "gitlab"
5
- # require "gitlab_awesome_release/gitlab_logging_ext"
5
+ require "gitlab_awesome_release/gitlab_logging_ext"
6
6
 
7
7
  module GitlabAwesomeRelease
8
8
  # Your code goes here...
@@ -89,9 +89,10 @@ module GitlabAwesomeRelease
89
89
  @logger = Logger.new(STDOUT)
90
90
  @logger.level = logger_level(option_or_env(:log_level))
91
91
  @logger.formatter = proc{ |severity, datetime, progname, message|
92
- "[#{datetime}] #{message}\n"
92
+ "[#{datetime}] #{severity} #{message}\n"
93
93
  }
94
94
 
95
+ Gitlab::Request.logger = @logger
95
96
  GitlabAwesomeRelease::Project.new(
96
97
  api_endpoint: gitlab_api_endpoint,
97
98
  private_token: gitlab_api_private_token,
@@ -1,24 +1,24 @@
1
1
  module GitlabAwesomeRelease
2
2
  module GitlabLoggingExt
3
- def get(path, options={})
4
- start_time = Time.now
3
+ [:get, :post, :put, :delete].each do |method|
4
+ define_method method do |path, options = {}|
5
+ begin
6
+ start_time = Time.now
5
7
 
6
- super(path, options)
8
+ super(path, options)
9
+ ensure
10
+ end_time = Time.now
7
11
 
8
- ensure
9
- end_time = Time.now
10
-
11
- # NOTE: options[:headers] contains PRIVATE-TOKEN
12
- _options = options.reject{ |k, _v| k == :headers }
13
- logger.debug "(#{end_time - start_time} sec) GET #{path} #{_options}"
14
- end
15
-
16
- def logger
17
- @logger ||= Logger.new(STDOUT)
12
+ # NOTE: options[:headers] contains PRIVATE-TOKEN
13
+ _options = options.reject{ |k, _v| k == :headers }
14
+ logger.debug "(#{end_time - start_time} sec) #{method.upcase} #{path} #{_options}"
15
+ end
16
+ end
18
17
  end
19
18
  end
20
19
  end
21
20
 
22
21
  Gitlab::Request.class_eval do
23
22
  prepend GitlabAwesomeRelease::GitlabLoggingExt
23
+ cattr_accessor :logger
24
24
  end
@@ -109,8 +109,11 @@ module GitlabAwesomeRelease
109
109
  end
110
110
 
111
111
  def add_merge_request_label(mr, label)
112
- Gitlab.update_merge_request(escaped_project_name, mr.id, labels: label)
113
- @logger.info "Add [#{label}] to !#{mr.iid}"
112
+ labels = mr.labels
113
+ labels << label
114
+
115
+ Gitlab.update_merge_request(escaped_project_name, mr.id, labels: labels.uniq.join(","))
116
+ @logger.info "Add [#{label}] to !#{mr.iid} #{mr.title}"
114
117
  end
115
118
 
116
119
  private
@@ -1,3 +1,3 @@
1
1
  module GitlabAwesomeRelease
2
- VERSION = "0.1.0.beta6"
2
+ VERSION = "0.1.0.beta7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_awesome_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta6
4
+ version: 0.1.0.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-12 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport