glman 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +4 -0
- data/lib/glman/commands/base.rb +18 -1
- data/lib/glman/repos/git_repo.rb +7 -0
- data/lib/glman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTJiNTc0YjQwNWVmMmE3NzIxOTgxZmMzOTUyNGI5MzFiNzE0YjY4NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzU2YWRmNmNhN2E0ZGQ0NDIxOWVhYTcyMDgzZDAzYTVlMmY1MmM4Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDQxYWY0ODcxMGQ4MjIyNjIwMmE2MTFiNTk3ZTgzNjViYWFiY2Q1ZGVkZWI2
|
10
|
+
MDk2N2FiZDIzNTgzMDRkNzA0MWUzOWZiNmFiOWYxODI1YjI5NGUyNGFiY2Yx
|
11
|
+
MmI5YWNjMTY5MDZlNWQ3NjdiYmY0ZmVmNjkxZWRkMjlmNmY3MTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWZlMjgyMWMyZWQ2OWM5MGZjOTliZTE4MjM1NzlhZWY0Y2I0ODI4ZGUwMTZk
|
14
|
+
YjI1Mjg2MjE1M2E5ZTk5ZTVjMDA4YzEyOGY1ZjFjZTYxOGM4YjI1MmZkYzZh
|
15
|
+
M2U4ODMyODhlMjlmM2Y3ZDMxNGU5MTgwYmJjOGQ4MTg2ODk0MjU=
|
data/README.md
CHANGED
@@ -44,6 +44,10 @@ 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
|
48
|
+
|
49
|
+
$ glman mr <user_email_or_alias> --push <origin(default 'origin')>
|
50
|
+
|
47
51
|
make full syntax
|
48
52
|
|
49
53
|
$ glman mr <user_email_or_alias> <message> <target_branch>
|
data/lib/glman/commands/base.rb
CHANGED
@@ -15,15 +15,25 @@ module Glman
|
|
15
15
|
p 'You realy want to create merge request master to master ?' if current_branch == 'master'
|
16
16
|
target_branch = params[2] || 'master'
|
17
17
|
user_id = get_user_id(user_name)
|
18
|
-
message = params[1] || git_repo.last_commit_message || current_branch
|
18
|
+
message = params[1] || git_repo.last_commit_message || current_branch
|
19
19
|
repository_name = git_repo.repository_name
|
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(push, current_branch) if push?
|
24
|
+
|
23
25
|
projects_repo.create_merge_request(repository_name, params)
|
24
26
|
ap params.merge({user_name: user_name, repository_name: repository_name})
|
25
27
|
end
|
26
28
|
|
29
|
+
def push(origin)
|
30
|
+
@push = origin || 'origin'
|
31
|
+
end
|
32
|
+
|
33
|
+
def push?
|
34
|
+
@push
|
35
|
+
end
|
36
|
+
|
27
37
|
def show=(bool)
|
28
38
|
@show = bool
|
29
39
|
end
|
@@ -108,6 +118,13 @@ module Glman
|
|
108
118
|
end
|
109
119
|
private
|
110
120
|
|
121
|
+
attr_reader :push
|
122
|
+
|
123
|
+
def push_branch_first(origin, branch)
|
124
|
+
p "push branch: #{branch} to origin: #{origin}"
|
125
|
+
git_repo.push(origin, branch)
|
126
|
+
end
|
127
|
+
|
111
128
|
def show_all_mrs
|
112
129
|
ap projects_repo.get_merge_requests(git_repo.repository_name)
|
113
130
|
end
|
data/lib/glman/repos/git_repo.rb
CHANGED
data/lib/glman/version.rb
CHANGED