circle-cli 0.0.1 → 0.0.2

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: e5bbf301ee7365a576b8477e813980b802727fd6
4
- data.tar.gz: 5abd9f1da4ee478af913888d41a50a3ca5123c03
3
+ metadata.gz: 84f8d9396d38131c1ac6a9a5fce0817658d5a8c3
4
+ data.tar.gz: d6202342ace41bb63992d03b37d6d6a1f0ff0d17
5
5
  SHA512:
6
- metadata.gz: 80590048caae9640bc34874622f9a39431322bab1cadd7bd4c6126274c019f6e520759b3522bf6f3ecbb19051bff1707c120abe3d654a56b570432474fab9979
7
- data.tar.gz: 97e93462a327b45c81948be3cd77039fdf5fb3683c09dbf5e08dd32c8773315722259184807b55378165bb894e752d6d7385a98ffc28843b5f1a06d05f92f463
6
+ metadata.gz: 2ce5fbfea58c54cc30105a1e07bf42a3cfa722d60789f89f7624631e3a606d380d57a9f0018efdf862cc79b74355127c33aaf521a04d9b55a3964981f63c564d
7
+ data.tar.gz: 453f17a3fafb3c96eaa477f0cb8cd6a0ae935331fa100d408f33cd6dcc421d157daf794a17f823fd32d93ae818a6407ef6b5bdda2c88d661278c93d5b8e0ecc9
data/README.md CHANGED
@@ -6,9 +6,39 @@ Command line tools for Circle CI
6
6
 
7
7
  $ gem install circle-cli
8
8
 
9
+ ## Setup
10
+
11
+ 1. Install Circle-CLI
12
+
13
+ ```
14
+ $ gem install circle-cli
15
+ ```
16
+
17
+ 2. Add your GitHub token
18
+
19
+ ```
20
+ $ circle github-token <github-token>
21
+ ```
22
+
23
+ 3. Add your CircleCI token
24
+
25
+ ```
26
+ $ circle token <circle-ci-token>
27
+ ```
28
+
9
29
  ## Usage
10
30
 
11
- TODO: Write usage instructions here
31
+ - Get the CI status for the HEAD of your current branch
32
+
33
+ ```
34
+ $ circle status
35
+ ```
36
+
37
+ - Open the results page for the latest CI run
38
+
39
+ ```
40
+ $ circle open
41
+ ```
12
42
 
13
43
  ## Contributing
14
44
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'circleci'
22
- spec.add_dependency 'rugged'
22
+ spec.add_dependency 'rugged', '>= 0.23'
23
23
  spec.add_dependency 'octokit'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.5'
@@ -25,6 +25,7 @@ module Circle
25
25
  def dispatch!(argv)
26
26
  @parser.parse!
27
27
  command, *args = argv
28
+ command = 'status' unless command
28
29
 
29
30
  method = "run_#{command.gsub('-', '_')}"
30
31
  if respond_to?(method)
@@ -35,12 +36,16 @@ module Circle
35
36
  end
36
37
 
37
38
  def run_status
38
- unless last_status
39
- puts 'unknown'
39
+ if last_status && last_status.state == 'success'
40
+ puts last_status.state
40
41
  exit(0)
42
+ elsif last_status
43
+ puts last_status.state
44
+ else
45
+ puts 'unknown'
41
46
  end
42
47
 
43
- puts last_status.state
48
+ exit(1)
44
49
  end
45
50
 
46
51
  def run_open
@@ -80,10 +85,10 @@ module Circle
80
85
  end
81
86
 
82
87
  def github_repo
83
- if origin.url =~ %r{git@github.com:(\w+/\w+)\.git}
88
+ if origin.url =~ %r{git@github.com:(\w+/[^.]*)\.git}
84
89
  $1
85
90
  else
86
- raise "Unsupported repo url format #{origin.url.inpect}" # TODO: support other formats, mainly https
91
+ raise "Unsupported repo url format #{origin.url.inspect}" # TODO: support other formats, mainly https
87
92
  end
88
93
  end
89
94
 
@@ -92,7 +97,7 @@ module Circle
92
97
  end
93
98
 
94
99
  def head
95
- repository.head.target
100
+ repository.head.target_id
96
101
  end
97
102
 
98
103
  def repository
@@ -1,5 +1,5 @@
1
1
  module Circle
2
2
  class CLI
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circle-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-14 00:00:00.000000000 Z
11
+ date: 2016-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: circleci
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.23'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '0.23'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: octokit
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.0.14
139
+ rubygems_version: 2.4.8
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Command line tools for Circle CI