glman 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +2 -2
- data/lib/glman/commands/base.rb +37 -12
- data/lib/glman/configuration.rb +4 -0
- data/lib/glman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjNlOWU2MDk1ZDYyMzQ5MGNjYTlhMTIyN2M0ODZkYWE1MTcyYjFlNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTM2ZjRmNWM1NWQyOGZmYWZlMGUwMjIzMDU3NmVlODk2ZTkyYmViOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmQ0MDhmOTdlMDQ0MWIwMTliYjA5YjE0YTA1ODAwNmMzZDJlOGJiNjQ1MTVl
|
10
|
+
NWZkYTVkNGI5OGVhZTc5Y2E4NmMzZjZiMTQ3N2IyZGE0Yzk5MmU5NGI3MmMx
|
11
|
+
N2I5ZDJjMjFiMWZjNDdiNDQyNWRhMWI0ZTg4NmE2ZmQ4MzRkOTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWZmNDMzMzFhOTFlMTYyNzllZmRmZTFhNTdhMzA1OGJmNmNmOTM4YTA3ODhl
|
14
|
+
ZjAzMDE5ZmViNjNhZjc2NTE2YmU5NzQyYjk2OWE1MjI1OGUzYmQ4ZWMwMjAz
|
15
|
+
MWY1YzRhMzAzN2JhZGM2ZmRiMmYyMjY4ZDMzYTM4OWU1MWUzNTE=
|
data/README.md
CHANGED
@@ -44,9 +44,9 @@ make default: (make merge request from current branch to master with last commit
|
|
44
44
|
|
45
45
|
$ glman mr <user_email_or_alias>
|
46
46
|
|
47
|
-
make with git push origin current_branch
|
47
|
+
make with git push <origin> current_branch
|
48
48
|
|
49
|
-
$ glman mr <user_email_or_alias> --push
|
49
|
+
$ glman mr <user_email_or_alias> --push <origin (default 'origin')>
|
50
50
|
|
51
51
|
make full syntax
|
52
52
|
|
data/lib/glman/commands/base.rb
CHANGED
@@ -20,18 +20,14 @@ module Glman
|
|
20
20
|
|
21
21
|
params = {assignee_id: user_id, title: message, source_branch: current_branch, target_branch: target_branch}
|
22
22
|
|
23
|
-
push_branch_first(current_branch)
|
23
|
+
push_branch_first(origin, current_branch) unless origin.nil?
|
24
24
|
|
25
25
|
projects_repo.create_merge_request(repository_name, params)
|
26
26
|
ap params.merge({user_name: user_name, repository_name: repository_name})
|
27
27
|
end
|
28
28
|
|
29
|
-
def push=(
|
30
|
-
@
|
31
|
-
end
|
32
|
-
|
33
|
-
def push?
|
34
|
-
@push
|
29
|
+
def push=(origin=nil)
|
30
|
+
@origin = origin || 'origin'
|
35
31
|
end
|
36
32
|
|
37
33
|
def show=(bool)
|
@@ -61,7 +57,7 @@ module Glman
|
|
61
57
|
if clear?
|
62
58
|
configuration.clear_user_aliases
|
63
59
|
else
|
64
|
-
configuration.add_user_alias(email: params[0], alias: params[1])
|
60
|
+
params.empty? ? show_aliases : configuration.add_user_alias(email: params[0], alias: params[1])
|
65
61
|
end
|
66
62
|
config
|
67
63
|
end
|
@@ -99,14 +95,16 @@ module Glman
|
|
99
95
|
end
|
100
96
|
|
101
97
|
# Show help
|
102
|
-
def help
|
103
|
-
puts 'help
|
98
|
+
def help!
|
99
|
+
puts 'Need help :D'
|
100
|
+
puts help_page
|
104
101
|
exit
|
105
102
|
end
|
106
|
-
alias :h
|
103
|
+
alias :h! :help!
|
107
104
|
|
108
105
|
#Exec
|
109
106
|
def call(name=nil, *params)
|
107
|
+
intro
|
110
108
|
case name.to_s.strip
|
111
109
|
when 'config' then config(params)
|
112
110
|
when 'alias' then user_alias(params)
|
@@ -117,8 +115,9 @@ module Glman
|
|
117
115
|
end
|
118
116
|
end
|
119
117
|
private
|
118
|
+
attr_reader :origin
|
120
119
|
|
121
|
-
def push_branch_first(branch)
|
120
|
+
def push_branch_first(origin, branch)
|
122
121
|
p "push branch: #{branch} to origin: origin"
|
123
122
|
git_repo.push('origin', branch)
|
124
123
|
end
|
@@ -146,6 +145,32 @@ module Glman
|
|
146
145
|
def git_repo
|
147
146
|
@git_repo ||= Repos::GitRepo.new
|
148
147
|
end
|
148
|
+
|
149
|
+
def help_page
|
150
|
+
%{
|
151
|
+
commands:
|
152
|
+
|
153
|
+
config # display current configuration
|
154
|
+
config <gitlab_url> <private_token> --init # init configuration
|
155
|
+
|
156
|
+
alias # display aliases
|
157
|
+
alias <user_email> <alias> # make alias for user email
|
158
|
+
alias --clear # clear all aliases
|
159
|
+
|
160
|
+
cache # build user cache for better performance RECOMMENDED
|
161
|
+
cache --clear # clear user cache
|
162
|
+
|
163
|
+
mr <user_email_or_alias> # create merge request for user for current branch to master with title as last commit message
|
164
|
+
|
165
|
+
mr <user_email_or_alias> <message> <target_branch> --push <origin> # full options for merge request (default origin is a origin :D)
|
166
|
+
|
167
|
+
Any questions pniemczyk@o2.pl or go to https://github.com/pniemczyk/glman
|
168
|
+
}
|
169
|
+
end
|
170
|
+
|
171
|
+
def intro
|
172
|
+
puts "Glman ver: #{VERSION}"
|
173
|
+
end
|
149
174
|
end
|
150
175
|
end
|
151
176
|
end
|
data/lib/glman/configuration.rb
CHANGED
data/lib/glman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Niemczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|