gitcycle 0.2.18 → 0.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/gitcycle.gemspec +1 -1
  2. data/lib/gitcycle.rb +11 -21
  3. metadata +4 -4
data/gitcycle.gemspec CHANGED
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "gitcycle"
9
- s.version = '0.2.18'
9
+ s.version = '0.2.19'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = [ 'Winton Welsh' ]
12
12
  s.email = [ 'mail@wintoni.us' ]
data/lib/gitcycle.rb CHANGED
@@ -422,7 +422,8 @@ class Gitcycle
422
422
  branch = pull
423
423
 
424
424
  if branch && !collab?(branch)
425
- branch = create_pull_request(branch)
425
+ force = branch['labels'] && branch['labels'].include?('Pass')
426
+ branch = create_pull_request(branch, force)
426
427
  end
427
428
 
428
429
  if branch == false
@@ -596,7 +597,7 @@ class Gitcycle
596
597
  Launchy.open(readme)
597
598
  end
598
599
 
599
- def create_pull_request(branch=nil)
600
+ def create_pull_request(branch=nil, force=false)
600
601
  unless branch
601
602
  puts "\nRetrieving branch information from gitcycle.\n".green
602
603
  branch = get('branch',
@@ -605,7 +606,7 @@ class Gitcycle
605
606
  )
606
607
  end
607
608
 
608
- if branch && !branch['issue_url']
609
+ if branch && (force || !branch['issue_url'])
609
610
  puts "Creating GitHub pull request.\n".green
610
611
  branch = get('branch',
611
612
  'branch[create_pull_request]' => true,
@@ -643,6 +644,13 @@ class Gitcycle
643
644
  name = "qa_#{source}_#{qa_branch['user']}"
644
645
 
645
646
  unless qa_branch['branches'].empty?
647
+ qa_branch['branches'][range].each do |branch|
648
+ if source != branch['source']
649
+ puts "You can only QA issues based on '#{source}'\n".red
650
+ exit
651
+ end
652
+ end
653
+
646
654
  unless options[:preserve]
647
655
  if branches(:match => name, :all => true)
648
656
  puts "Deleting old QA branch '#{name}'.\n".green
@@ -663,18 +671,11 @@ class Gitcycle
663
671
  puts "\n"
664
672
  end
665
673
 
666
- warnings = {}
667
-
668
674
  qa_branch['branches'][range].each do |branch|
669
675
  issue = branch['issue']
670
676
  owner, repo = branch['repo'].split(':')
671
677
  home = branch['home']
672
678
 
673
- if source != branch['source']
674
- warnings[branch['source']] ||= []
675
- warnings[branch['source']] << branch['issue']
676
- end
677
-
678
679
  output = merge_remote_branch(
679
680
  :owner => home,
680
681
  :repo => repo,
@@ -689,17 +690,6 @@ class Gitcycle
689
690
  puts "\nType '".yellow + "gitc qa pass".green + "' to approve all issues in this branch.\n".yellow
690
691
  puts "Type '".yellow + "gitc qa fail".red + "' to reject all issues in this branch.\n".yellow
691
692
  end
692
-
693
- unless warnings.empty?
694
- puts "\n#{"WARNING:".red} If you pass this QA branch, the following branches will merge into '#{source.yellow}':\n"
695
-
696
- warnings.each do |(branch, issues)|
697
- issues.collect! { |issue| "##{issue}" }
698
- puts " #{branch.yellow} (#{issues.join(', ')})"
699
- end
700
-
701
- puts "\nBe sure this is correct!\n".yellow
702
- end
703
693
  end
704
694
 
705
695
  qa_branch
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitcycle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 18
10
- version: 0.2.18
9
+ - 19
10
+ version: 0.2.19
11
11
  platform: ruby
12
12
  authors:
13
13
  - Winton Welsh
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-01 00:00:00 -07:00
18
+ date: 2012-05-02 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency