cp8_cli 4.0.1 → 4.1.0

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: 514e7aef7ee94e92fcdd7259af8ad85fa40e8906
4
- data.tar.gz: 142fe1b35958372e953f17b7fedcc79d91e005f6
3
+ metadata.gz: 2fab69b664610ab8d0acab4322f83f6343582f4f
4
+ data.tar.gz: 6159063e617b8233b527dcf047b5ffcc97d367fc
5
5
  SHA512:
6
- metadata.gz: b3dc0e52326bb5372884394b3631c2777f9ca4a9f50e4c3dfc9b35d968aab2a4e8dffeff09099c40dd01a717285bd83b39ca93dae3cad68b44cb566dec58d569
7
- data.tar.gz: f56267e43b0e0fcfc102ab26b3c404e27f2fce28bd6e42847419805133c6bbddb54ea0a5e2e9556b2becbf8f271d322fb2525f07679f96465e391ed779941719
6
+ metadata.gz: 27374bea941347b1d71fc32014f33c89d72e9887339f68ec85a3c1a0c9bd846860d8ba722af3e783d97a0053046a435c4eaa44fd89a74d552eca249beb192eca
7
+ data.tar.gz: f57023a70369b6acc2ba5c06c54133d3e5b62899949af0c4ae28cb628d1d90bbecaac7d9008742a8e56c73258dec44253d5c039e528b3b2a833d52ad47913c7d
data/exe/cp8 CHANGED
@@ -23,6 +23,11 @@ module Cp8Cli
23
23
  main.open
24
24
  end
25
25
 
26
+ desc "ci", "Open CI page for current branch"
27
+ def ci
28
+ main.ci
29
+ end
30
+
26
31
  private
27
32
 
28
33
  def main
@@ -1,4 +1,5 @@
1
1
  require "active_support/core_ext/string/inflections"
2
+ require "cp8_cli/ci"
2
3
  require "cp8_cli/pull_request"
3
4
  require "cp8_cli/branch_name"
4
5
  require "cp8_cli/story_query"
@@ -30,6 +31,10 @@ module Cp8Cli
30
31
  pr.open
31
32
  end
32
33
 
34
+ def open_ci
35
+ Ci.new(branch_name: name, repo: Repo.current).open
36
+ end
37
+
33
38
  def open_story_in_browser
34
39
  if current_story
35
40
  Command.open_url current_story.url
data/lib/cp8_cli/ci.rb ADDED
@@ -0,0 +1,20 @@
1
+ module Cp8Cli
2
+ class Ci
3
+ def initialize(branch_name:, repo:)
4
+ @branch_name = branch_name
5
+ @repo = repo
6
+ end
7
+
8
+ def open
9
+ Command.open_url url
10
+ end
11
+
12
+ private
13
+
14
+ attr_reader :branch_name, :repo
15
+
16
+ def url
17
+ "https://circleci.com/gh/#{repo.user}/#{repo.name}/tree/#{URI.escape branch_name}"
18
+ end
19
+ end
20
+ end
data/lib/cp8_cli/main.rb CHANGED
@@ -32,6 +32,10 @@ module Cp8Cli
32
32
  branch.open_pull_request(options)
33
33
  end
34
34
 
35
+ def ci
36
+ Branch.current.open_ci
37
+ end
38
+
35
39
  def cleanup
36
40
  Cleanup.new(Branch.current.target).run
37
41
  end
@@ -57,7 +57,7 @@ module Cp8Cli
57
57
  end
58
58
 
59
59
  def repo
60
- @_repo ||= Repo.new
60
+ @_repo ||= Repo.current
61
61
  end
62
62
  end
63
63
  end
data/lib/cp8_cli/repo.rb CHANGED
@@ -1,5 +1,14 @@
1
1
  module Cp8Cli
2
2
  class Repo
3
+ def self.current
4
+ path = Command.read("git config --get remote.origin.url").match(/github.com[:\/](\S+\/\S+)\.git/)[1]
5
+ new(path)
6
+ end
7
+
8
+ def initialize(path)
9
+ @path = path
10
+ end
11
+
3
12
  def user
4
13
  path.split('/').first
5
14
  end
@@ -14,8 +23,6 @@ module Cp8Cli
14
23
 
15
24
  private
16
25
 
17
- def path
18
- @_path ||= Command.read("git config --get remote.origin.url").match(/github.com[:\/](\S+\/\S+)\.git/)[1]
19
- end
26
+ attr_reader :path
20
27
  end
21
28
  end
@@ -1,5 +1,5 @@
1
1
  module Cp8Cli
2
- VERSION = "4.0.1"
2
+ VERSION = "4.1.0"
3
3
 
4
4
  class Version
5
5
  def self.latest?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cp8_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-29 00:00:00.000000000 Z
11
+ date: 2017-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -304,6 +304,7 @@ files:
304
304
  - lib/cp8_cli.rb
305
305
  - lib/cp8_cli/branch.rb
306
306
  - lib/cp8_cli/branch_name.rb
307
+ - lib/cp8_cli/ci.rb
307
308
  - lib/cp8_cli/cleanup.rb
308
309
  - lib/cp8_cli/command.rb
309
310
  - lib/cp8_cli/config_store.rb