relsr 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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca4948573df960dcef8b8bef529bed14b9461e70
4
- data.tar.gz: de593211017d930fff99ed08051bb06c8e749af5
3
+ metadata.gz: 573c8fedcc92906cd34469ffa7023636abf3e6b4
4
+ data.tar.gz: ee9b2213e2fcd3373efa59f810615f60cbbf35f8
5
5
  SHA512:
6
- metadata.gz: e198224981df581dd25f39b5b86e16cbd6c630b47024c775e4d47413055f1610e279aaae10ae39fa894156a0d40614873f10202b21a6af0e3712cfe16bb3fc77
7
- data.tar.gz: 1631f806a13edea365894e89756e3b8fa429162e84ec4f6949f35ea58927f0a4dbc2f19c5340dcc0acd21b8a1afcfd824ba62a290b2b5c27ae3f20c14c72e57c
6
+ metadata.gz: be4e56435ddc5002ee418ea55416eee091227ec1ce8f194bce21557d0ce42dcec188ecab54e626e09647c5bac3c2afe7118ec0a41902171c8773a560e2740c78
7
+ data.tar.gz: 13ed7e2e54734ddf2cccf46fd19d21863ba6631a048bd8f61a3c2279861e5d2c5aebd292e4b9a89bf4fc0efc2d2a3880b4d054030c03bde6ccdd8b99f4e3c86d
@@ -4,7 +4,7 @@ require 'optparse'
4
4
  module Relsr
5
5
  class Initializer
6
6
 
7
- YAML_FILE = 'relsr.yml'
7
+ YAML_FILE = '.relsr.yml'
8
8
 
9
9
  def self.init
10
10
  parse_options
@@ -32,7 +32,7 @@ module Relsr
32
32
  @options[:dry_run] = true
33
33
  end
34
34
 
35
- opts.on("-i", "--init", "Create relst.yml for project") do |v|
35
+ opts.on("-i", "--init", "Create #{YAML_FILE} for project") do |v|
36
36
  create_default_yaml
37
37
  exit 0
38
38
  end
@@ -41,7 +41,7 @@ module Relsr
41
41
 
42
42
  def self.parse_yaml
43
43
  unless File.exists?(YAML_FILE)
44
- puts 'Could not file relsr.yml file.'
44
+ puts "Could not file #{YAML_FILE} file."
45
45
  exit 1
46
46
  end
47
47
  begin
@@ -51,7 +51,7 @@ module Relsr
51
51
  @repo = config['repo']
52
52
  @label = config['label']
53
53
  rescue StandardError => error
54
- puts 'invalid relsr.yml file'
54
+ puts "invalid #{YAML_FILE} file"
55
55
  puts error.message
56
56
  exit 1
57
57
  end
@@ -1,4 +1,5 @@
1
1
  require 'octokit'
2
+ require 'colorize'
2
3
 
3
4
  module Relsr
4
5
  class ReleaseManager
@@ -17,35 +18,42 @@ module Relsr
17
18
  end
18
19
 
19
20
  def create_pull_request
20
- puts "Creating Pull Request"
21
- return if @dry_run
22
- client.create_pull_request(
23
- @repo_name,
24
- 'master',
25
- @release_branch_name,
26
- @release_branch_name,
27
- pr_body
28
- )
21
+ print_and_flush "Creating Pull Request..."
22
+ unless @dry_run
23
+ client.create_pull_request(
24
+ @repo_name,
25
+ 'master',
26
+ @release_branch_name,
27
+ @release_branch_name,
28
+ pr_body
29
+ )
30
+
31
+ end
32
+ puts 'done'.green
29
33
  end
30
34
 
31
35
  private
32
36
 
33
37
  def create_release_branch
34
- puts "Creating release branch '#{@release_branch_name}' on '#{@repo_name}'"
35
- return if @dry_run
36
- client.create_ref(@repo_name, "heads/#{@release_branch_name}", master.object.sha)
38
+ print_and_flush "Creating release branch '#{@release_branch_name}' on '#{@repo_name}'..."
39
+ unless @dry_run
40
+ client.create_ref(@repo_name, "heads/#{@release_branch_name}", master.object.sha)
41
+ end
42
+ puts 'done'.green
37
43
  end
38
44
 
39
45
  def merge_work_branches
40
46
  branches_to_merge.each do |work_branch|
41
- puts "Merging '#{work_branch}' into release"
42
- next if @dry_run
43
- client.merge(
44
- @repo_name,
45
- @release_branch_name,
46
- work_branch,
47
- commit_message: "Merging #{work_branch} into release"
48
- )
47
+ print_and_flush "Merging '#{work_branch}' into release..."
48
+ unless @dry_run
49
+ client.merge(
50
+ @repo_name,
51
+ @release_branch_name,
52
+ work_branch,
53
+ commit_message: "Merging #{work_branch} into release"
54
+ )
55
+ end
56
+ puts 'done'.green
49
57
  end
50
58
  end
51
59
 
@@ -88,5 +96,9 @@ module Relsr
88
96
  end.join("\n")
89
97
  end
90
98
 
99
+ def print_and_flush(msg)
100
+ print msg
101
+ STDOUT.flush
102
+ end
91
103
  end
92
104
  end
@@ -1,3 +1,3 @@
1
1
  module Relsr
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relsr
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
  - John Cleary
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-02 00:00:00.000000000 Z
11
+ date: 2017-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.11'
41
+ - !ruby/object:Gem::Dependency
42
+ name: colorize
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description:
42
56
  email:
43
57
  - john@createk.io