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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmVhYzZhOWVjODgyYjQ1OTdmYTdhNDY4OTkwOThmMmNlNTQ5YWVlOA==
4
+ YTJiNTc0YjQwNWVmMmE3NzIxOTgxZmMzOTUyNGI5MzFiNzE0YjY4NQ==
5
5
  data.tar.gz: !binary |-
6
- Y2EyNjY1NDc2OWU1M2U2NTg0MDNlOTIzMmJiYjkzM2I3YmE3NTIwZQ==
6
+ MzU2YWRmNmNhN2E0ZGQ0NDIxOWVhYTcyMDgzZDAzYTVlMmY1MmM4Ng==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTUyYzE1YWIwNDAwNzNlZDg2MzAxZDYyZTllZTIwZDAzNmJiNGVmNDRhYmUw
10
- OWI2MjY4YmRhM2JiNWJjMThmNTczY2ZmNmFiN2EyYWFhNjNkY2E5ZjM0MzFk
11
- NWYzNTQyMDBlY2M3MWRjNmYwNjE4ODZjNzFmMzM1NTQ3MTUyMTE=
9
+ MDQxYWY0ODcxMGQ4MjIyNjIwMmE2MTFiNTk3ZTgzNjViYWFiY2Q1ZGVkZWI2
10
+ MDk2N2FiZDIzNTgzMDRkNzA0MWUzOWZiNmFiOWYxODI1YjI5NGUyNGFiY2Yx
11
+ MmI5YWNjMTY5MDZlNWQ3NjdiYmY0ZmVmNjkxZWRkMjlmNmY3MTk=
12
12
  data.tar.gz: !binary |-
13
- ODY4YjBmMTlkYTM2MThhY2E5N2Y5YWJjOWMxMDYzOTJkOTliMWYwZTkwN2Zj
14
- YWQ4YjhiZTVlNzQ4NmJhOWI4ZDlkMjA4YWJhODgxNjQyMDM1NTE0NzliOWQ4
15
- YjNlNzg5YTk0ZGQ4Mjg0OWQ5OTExOTQyMmY4NjU5ZWEwNjNkNzU=
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>
@@ -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.split('_').join(' ')
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
@@ -24,6 +24,13 @@ module Glman
24
24
  rescue
25
25
  nil
26
26
  end
27
+
28
+ def push(origin, branch)
29
+ cmd = "git push #{origin} #{branch}"
30
+ %x[#{cmd}]
31
+ rescue
32
+ nil
33
+ end
27
34
  end
28
35
  end
29
36
  end
data/lib/glman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Glman
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glman
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
  - Paweł Niemczyk