hackathon_drone 0.0.1 → 0.0.2

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.
@@ -57,7 +57,6 @@ module HackathonDrone
57
57
  exit
58
58
  end
59
59
 
60
-
61
60
  Curses.noecho
62
61
  Curses.curs_set(0)
63
62
  Curses.init_screen
@@ -65,19 +64,19 @@ module HackathonDrone
65
64
  Curses.setpos(0,0)
66
65
  Curses.addstr "Monitoring #{@config.project}"
67
66
  Curses.refresh
67
+ Curses.setpos(2,0)
68
68
  while true
69
69
  # Validate that the venue is in progress
70
70
  venue = HackathonDrone::REST.get(@config.get('host'), @config.get('port'), VENUE_PATH.gsub(/:id/, team['venue_id'].to_s))
71
71
  if venue and venue['state'] == 'started'
72
72
  team_stats = Git::BranchStats.analyze
73
73
  team = @config.set('team', HackathonDrone::REST.put(@config.get('host'), @config.get('port'), TEAM_PATH.gsub(/:id/, team['id'].to_s).gsub(/:venue_id/, team['venue_id'].to_s), team_stats))
74
- Curses.setpos(2,0)
75
- Curses.addstr(YAML.dump(team))
74
+
75
+ report(team, team_stats)
76
76
  else
77
77
  if venue
78
78
  if venue['state'] == "open"
79
- Curses.setpos(2,0)
80
- Curses.addstr('Venue is still open, waiting for venue to start...')
79
+ Curses.addstr 'Venue is still open, waiting for venue to start...'
81
80
  else
82
81
  puts "This venue is '#{venue['state']}'! It is not in progress."
83
82
  exit
@@ -91,7 +90,7 @@ module HackathonDrone
91
90
  Curses.refresh
92
91
 
93
92
  # Re-analyze in x seconds
94
- sleep 5
93
+ sleep 10
95
94
  end
96
95
  ensure
97
96
  Curses.close_screen
@@ -109,6 +108,36 @@ module HackathonDrone
109
108
  puts Git::BranchStats.analyze
110
109
  end
111
110
 
111
+
112
+ no_commands do
113
+ def report(team, team_stats)
114
+ y = 2
115
+ Curses.setpos(y,0)
116
+ Curses.addstr("Team: #{team['name']}")
117
+ y += 2
118
+ Curses.setpos(y,0)
119
+ Curses.addstr("+#{team['additions']} lines")
120
+ Curses.setpos(y,20)
121
+ Curses.addstr("-#{team['deletions']} lines")
122
+ y += 2
123
+ Curses.setpos(y,0)
124
+ Curses.addstr("#{team['files_changed']} files")
125
+ Curses.setpos(y,20)
126
+ Curses.addstr("#{team['commits']} commits")
127
+
128
+ y += 1
129
+ team['language_stats'].each do |stats|
130
+ y += 1
131
+ Curses.setpos(y,0)
132
+ Curses.addstr("#{stats[0]}: #{stats[1]} bytes")
133
+ end
134
+
135
+ y += 2
136
+ Curses.setpos(y,0)
137
+ team_stats[:warnings].each {|warning| Curses.addstr(warning)} if team_stats[:warnings]
138
+ end
139
+ end
140
+
112
141
  end
113
142
 
114
143
  end
@@ -1,3 +1,3 @@
1
1
  module HackathonDrone
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackathon_drone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-16 00:00:00.000000000 Z
12
+ date: 2013-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: git-branch_stats
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 1.8.23
87
+ rubygems_version: 1.8.25
88
88
  signing_key:
89
89
  specification_version: 3
90
90
  summary: Follow your hackathon!