git-gitlab 0.3.0 → 0.3.5

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.
@@ -8,7 +8,13 @@ require 'thor'
8
8
  # Gitlab Commandline interface
9
9
  #
10
10
  class GitGitlabCLI < Thor
11
- @gitlab = GitlabKernel.new
11
+
12
+ attr_reader :gitlab
13
+
14
+ def initialize(args, opts, config)
15
+ @gitlab = GitlabKernel.new
16
+ super(args, opts, config)
17
+ end
12
18
 
13
19
  desc "merge SOURCE TARGET --assign ${ASSING}", "create mergerequest SOURCE to TARGET. assign to ${ASSING}"
14
20
  long_desc <<-LONGDESC
@@ -17,8 +23,13 @@ class GitGitlabCLI < Thor
17
23
  option :assign
18
24
  option :list, :type => :boolean
19
25
  option :l , :type => :boolean
20
- def merge(source =nil, target = nil)
21
- if options[:list] || options[:l]
26
+ def merge(source = nil, target = nil)
27
+ show_all = lambda { |source, target, options|
28
+ (source == nil && target == nil) ||
29
+ options[:l] ||
30
+ options[:list]
31
+ }
32
+ if show_all.call(source, target, options)
22
33
  mergerequests = @gitlab.mergerequests
23
34
  result = mergerequests.map { |m| "\##{m.iid}, #{m.title}" }.join("\n")
24
35
  puts(result)
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Gitlab
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-23 00:00:00.000000000 Z
12
+ date: 2014-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler