abak-flow 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -16,14 +16,16 @@ module Abak::Flow
16
16
  c.option '--base STRING', String, 'Имя ветки, в которую нужно принять изменения'
17
17
 
18
18
  c.action do |args, options|
19
- repository = Hub::Commands.send :local_repo
20
- current_branch = repository.current_branch.short_name
21
- request_rules = {
22
- :feature => :develop,
23
- :hotfix => :master
24
- }
19
+ request_rules = {:feature => :develop, :hotfix => :master}
25
20
  jira_browse_url = 'http://jira.dev.apress.ru/browse/'
26
21
 
22
+ repository = Hub::Commands.send :local_repo
23
+ current_branch = repository.current_branch.short_name
24
+ remote_branch, task = current_branch.split('/').push(nil).map(&:to_s)
25
+
26
+ title = args.first.to_s.strip
27
+ title = task if task =~ /^\w+\-\d{1,}$/ && title.empty?
28
+
27
29
  # Проверим, что мы не в мастере или девелопе
28
30
  if [:master, :develop].include? current_branch.to_sym
29
31
  say 'Нельзя делать pull request из меток master или develop'
@@ -37,14 +39,13 @@ module Abak::Flow
37
39
  exit
38
40
  end
39
41
 
40
- if args.first.to_s.empty?
41
- say 'Пожалуйста, укажите в заголовке номер вашей задачи, например так:'
42
- say '=> git request "PC-001"'
42
+ if title.empty?
43
+ say 'Пожалуйста, укажите что-нибудь для заголовка pull request, например номер вашей задачи вот так:'
44
+ say '=> git request publish "PC-001"'
43
45
  exit
44
46
  end
45
47
 
46
48
  # Расставим ветки согласно правилам
47
- remote_branch, task = current_branch.split('/').push(nil).map(&:to_s)
48
49
  head = "#{repository.repo_owner}:#{current_branch}"
49
50
  base = "#{repository.remote_by_name('upstream').project.owner}:#{request_rules.fetch(remote_branch.to_sym, '')}"
50
51
 
@@ -57,7 +58,7 @@ module Abak::Flow
57
58
  Hub::Runner.execute('push', repository.main_project.remote.name, current_branch)
58
59
 
59
60
  # Запостим pull request на upstream
60
- command_options = ['pull-request', args.first, '-b', base, '-h', head]
61
+ command_options = ['pull-request', title, '-b', base, '-h', head]
61
62
  command_options |= ['-d', jira_browse_url + task] if task =~ /^\w+\-\d{1,}$/
62
63
 
63
64
  say '=> Делаю pull request на upstream'
@@ -95,7 +96,7 @@ module Abak::Flow
95
96
  end
96
97
 
97
98
  unless task =~ /^\w+\-\d{1,}$/
98
- say '=> Вы приняли верное решение :)' && exit unless agree("Лучше всего завести задачу с именем примерно такого формата PC-001, может попробуем заного? [yes/no/y/n]:")
99
+ say '=> Вы приняли верное решение :)' && exit if agree("Лучше всего завести задачу с именем примерно такого формата PC-001, может попробуем заного? [y/n]:")
99
100
  end
100
101
 
101
102
  Hub::Runner.execute('flow', 'feature', 'start', task)
@@ -115,7 +116,7 @@ module Abak::Flow
115
116
  end
116
117
 
117
118
  unless task =~ /^\w+\-\d{1,}$/
118
- say '=> Вы приняли верное решение :)' && exit unless agree("Лучше всего завести задачу с именем примерно такого формата PC-001, может попробуем заного? [yes/no/y/n]:")
119
+ say '=> Вы приняли верное решение :)' && exit if agree("Лучше всего завести задачу с именем примерно такого формата PC-001, может попробуем заного? [y/n]:")
119
120
  end
120
121
 
121
122
  Hub::Runner.execute('flow', 'hotfix', 'start', task)
@@ -143,7 +144,7 @@ module Abak::Flow
143
144
 
144
145
  warning = "Внимание! Alarm! Danger! Achtung\nЕсли вы удалите ветку на удаленном репозитории, а ваш pull request еще не приняли, вы рискуете потерять проделанную работу.\nВы уверены, что хотите продолжить?"
145
146
  if [:all, :origin].include?(type)
146
- say '=> Вы приняли верное решение :)' && exit unless agree("#{warning} [yes/no/y/n]:")
147
+ say '=> Вы приняли верное решение :)' && exit unless agree("#{warning} [y/n]:")
147
148
  end
148
149
 
149
150
  # @TODO Проверку на наличие ветки на origin
@@ -1,5 +1,5 @@
1
1
  module Abak
2
2
  module Flow
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abak-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-06 00:00:00.000000000Z
12
+ date: 2012-02-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hub
16
- requirement: &70259714493600 !ruby/object:Gem::Requirement
16
+ requirement: &18970680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70259714493600
24
+ version_requirements: *18970680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: commander
27
- requirement: &70259714493180 !ruby/object:Gem::Requirement
27
+ requirement: &18970160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70259714493180
35
+ version_requirements: *18970160
36
36
  description: Простой набор правил и комманд, заточеных для работы в git-flow с использование
37
37
  в качестве удаленного репозитория github
38
38
  email:
@@ -78,3 +78,4 @@ signing_key:
78
78
  specification_version: 3
79
79
  summary: Совмещение 2-х подходов разработки Git-flow & Github-flow
80
80
  test_files: []
81
+ has_rdoc: