see 0.0.14 → 0.0.15

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: f657044308b688199f6e95775490454f1187330b
4
- data.tar.gz: d3623340153b83e58ae29f76a07dccaac75ba8a7
3
+ metadata.gz: 6dfd09f371cb9b482be160f5cee9dd45f021babd
4
+ data.tar.gz: a02a09842f3163b6e6fbfce3ae223cf9da28e302
5
5
  SHA512:
6
- metadata.gz: 17865fd9e8ed24a06bb47a1d938e36b7db3396f7549237b2cd604c4b77b518ddbb36bd6b4280d4c32a830c7646cb9151c07c92e7d9742787d03bb2c0851fa6a5
7
- data.tar.gz: 09ee947e6257f22fd762c7a532a4ca7914f3cf8da9ec59ab43d46002631fbc6db67aa3dfe677aa95442c733ebb1218885c7be3033abf16c88b01685ff5910b18
6
+ metadata.gz: 9932d03b657781b0c54d32eda0c1de1f8d3e7f827df0477013f10f9d6b32f9f12f7ba564eb00707f95cd8068a5cbbc7b702889d97ae1d38a045fafe281ca6dc3
7
+ data.tar.gz: 602a8811c2ab6cd597614617165d80cd5f3f87d52ab0a3225c21793f4daab8ebb459815ed0518bb75014e4182782742d1b826c639b834c8c001a0aca5ed7d418
@@ -1,3 +1,4 @@
1
+ require 'json'
1
2
 
2
3
  module See
3
4
  module Plugins
@@ -7,11 +8,25 @@ module See
7
8
  end
8
9
 
9
10
  def run(config, info, no_info)
10
- CircleCi.configure do |config|
11
- config.token = ENV['CIRCLE_CI_ACCESS_TOKEN']
11
+ token = ENV['CIRCLE_CI_ACCESS_TOKEN']
12
+ unless token
13
+ no_info << "CircleCI - " + "You must set CIRCLE_CI_ACCESS_TOKEN env variable".red
14
+ return
15
+ end
16
+
17
+ CircleCi.configure do |cfg|
18
+ cfg.token = token
12
19
  end
13
20
 
14
21
  response = CircleCi::Project.recent_builds(config['circle']['account'], config['circle']['repository'])
22
+ if response.errors.length > 0
23
+ info << "\nCircleCI - " + "Errors encountered:".red
24
+ response.errors.each do |error|
25
+ info << " - " + "Error #{error.code}:".red + " #{JSON.parse(error.message)['message'].strip}"
26
+ end
27
+ return
28
+ end
29
+
15
30
  info << "\nCircleCI - " + "Latest Builds:".light_blue
16
31
  response.body[0..4].each do |thing|
17
32
  if thing['committer_date']
@@ -8,7 +8,13 @@ module See
8
8
  end
9
9
 
10
10
  def run(config, info, no_info)
11
- PivotalTracker::Client.token = ENV['PIVOTAL_TRACKER_ACCESS_TOKEN']
11
+ token = ENV['PIVOTAL_TRACKER_ACCESS_TOKEN']
12
+ unless token
13
+ no_info << "Tracker - " + "You must set PIVOTAL_TRACKER_ACCESS_TOKEN env variable".red
14
+ return
15
+ end
16
+
17
+ PivotalTracker::Client.token = token
12
18
  project = PivotalTracker::Project.find(config['pivotal']['project'])
13
19
 
14
20
  next_unowned_story = nil
@@ -10,8 +10,12 @@ module See
10
10
  def run(config, info, no_info)
11
11
  repository = config["travis"]["repository"]
12
12
  builds = Travis::Repository.find(repository).recent_builds[0..4].map do |build|
13
- time = "- #{build.finished_at.strftime("%b %e,%l:%M %p")}".black
14
- state = build.failed? ? build.state.capitalize.red : build.state.capitalize.green
13
+ time = ( build.finished_at ? "- #{build.finished_at.strftime("%b %e,%l:%M %p")}" : "- running" ).black
14
+ if build.pending?
15
+ state = build.state.capitalize.cyan
16
+ else
17
+ state = build.unsuccessful? ? build.state.capitalize.red : build.state.capitalize.green
18
+ end
15
19
  " - #{state} #{build.commit.short_sha.light_yellow} #{("#"+build.number).light_green} #{build.commit.subject} #{time}"
16
20
  end
17
21
 
data/lib/see/runner.rb CHANGED
@@ -24,18 +24,38 @@ module See
24
24
  exit 1
25
25
  end
26
26
 
27
- info = []
28
- no_info = []
29
- config.each do |configuration|
30
- info = []
31
- name = configuration[0]
32
- See::Plugins.run_plugin(name, config, info, no_info)
33
- puts info
27
+ progress = Thread.new do
28
+ print "Pulling data from #{config.length} source#{config.length == 1 ? '' : 's'}"
29
+ while true
30
+ sleep 0.25
31
+ print '.'
32
+ end
34
33
  end
35
34
 
35
+ threads = []
36
+ config.each do |cfg|
37
+ threads << Thread.new do
38
+ See::Plugins.run_plugin(cfg[0], config, good=[], bad=[])
39
+ Thread.current[:good] = good
40
+ Thread.current[:bad] = bad
41
+ end
42
+ end
43
+
44
+ good = []
45
+ bad = []
46
+ threads.each do |t|
47
+ t.join
48
+ good << t[:good] if t[:good]
49
+ bad << t[:bad] if t[:bad]
50
+ end
51
+
52
+ progress.kill
53
+ puts
54
+
55
+ good.sort_by {|a| a[0]}.each {|g| puts g}
36
56
  puts
37
- if no_info.count > 0
38
- puts no_info
57
+ unless bad.empty?
58
+ puts bad.sort
39
59
  puts
40
60
  end
41
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: see
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Avila
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-19 00:00:00.000000000 Z
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday