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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWQ5NWUzMzk5MTk5N2QyOWIwZGNkNGFjNDU1ZGMzYmFlMzk0YTVkYg==
4
+ MjNlOWU2MDk1ZDYyMzQ5MGNjYTlhMTIyN2M0ODZkYWE1MTcyYjFlNw==
5
5
  data.tar.gz: !binary |-
6
- NTg0NDJlNzkwODBmMTM1ODM2ZDFmN2MyZWU1Njg3ZWQ5ZjBkYmEzNw==
6
+ ZTM2ZjRmNWM1NWQyOGZmYWZlMGUwMjIzMDU3NmVlODk2ZTkyYmViOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWVmZWU5NTUzNzdhODEyMWE0MmUyMmUzOTY3ODE5NGNjM2U4NjFmOWY1Mzdl
10
- YjhjM2JmMzBjYTRlMjU3NGRiY2ZmZjJjYTEzZmE4MTM2ZjAzMjUxNTRmYTVh
11
- ZGMwM2NlNjVkOTAyMjkyNTM2ZjgxODc2Y2NkZmRjYjI3NjM3MTg=
9
+ MmQ0MDhmOTdlMDQ0MWIwMTliYjA5YjE0YTA1ODAwNmMzZDJlOGJiNjQ1MTVl
10
+ NWZkYTVkNGI5OGVhZTc5Y2E4NmMzZjZiMTQ3N2IyZGE0Yzk5MmU5NGI3MmMx
11
+ N2I5ZDJjMjFiMWZjNDdiNDQyNWRhMWI0ZTg4NmE2ZmQ4MzRkOTY=
12
12
  data.tar.gz: !binary |-
13
- YzZkMDY2YzQ5MmVkMDgzM2Y3MDFkZmUwNzlmZWMzMTBkOTQxNzg3MTFiZWM3
14
- ZmE5Zjg5NjA1YmQ1YmE5MGI2ODlhYzkzOGE3MzE1YWI3ZjY0MmYwNGZhZjE4
15
- MDFkMDJjZTAwZjhkZmU1NWE2ZDUxNTE5NDkxOGVlMzY2Y2FkNzk=
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
 
@@ -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) if push?
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=(push)
30
- @push = push
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 me :D'
98
+ def help!
99
+ puts 'Need help :D'
100
+ puts help_page
104
101
  exit
105
102
  end
106
- alias :h? :help?
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
@@ -13,6 +13,10 @@ module Glman
13
13
  File.write(config_file, config.to_yaml)
14
14
  end
15
15
 
16
+ def show_aliases
17
+ load[:aliases]
18
+ end
19
+
16
20
  def add_user_alias(opts={})
17
21
  config = load
18
22
  aliases = config[:aliases] || {}
data/lib/glman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Glman
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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-17 00:00:00.000000000 Z
11
+ date: 2014-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler