fire_watch 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fire_watch/runner.rb +11 -8
- data/lib/fire_watch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 087216a36c3964a570ea5473b84d810acf0a013c
|
4
|
+
data.tar.gz: 48660e85354cbd04ccf736624add18db58664203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf8da1ac0f7f4f7434686302af8409b457151dbbbb7203a56e7e525eb3a4757ef57c71fed20d468cd256e2e7e3256ece58df44a573f98c04ab34fa1dcf82583
|
7
|
+
data.tar.gz: 56ce9df1ca8a7a2fc3bc590c638896e21000c7b43584873c62b1540a06e7a4a0a3dcbfdb0eac41d778adfe858699bb098c0617b3c1b8d8bf300392364535c51c
|
data/lib/fire_watch/runner.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'highline'
|
2
2
|
require 'harvested'
|
3
3
|
require 'github_api'
|
4
|
+
require 'pry'
|
4
5
|
|
5
6
|
module FireWatch
|
6
7
|
class Runner
|
@@ -52,19 +53,21 @@ module FireWatch
|
|
52
53
|
harvest_username = cli.ask('Harvest Username: ')
|
53
54
|
harvest_password = cli.ask('Harvest Password: ') { |q| q.echo = false }
|
54
55
|
@harvest_client = Harvest.client(username: harvest_username, password: harvest_password, subdomain: 'wildland')
|
55
|
-
|
56
|
-
projects = @harvest_client.projects.all
|
56
|
+
clients = @harvest_client.clients.all
|
57
|
+
projects = @harvest_client.projects.all
|
57
58
|
selected_projects = []
|
58
59
|
done = false
|
59
60
|
loop do
|
60
61
|
cli.choose do |menu|
|
61
62
|
menu.prompt = "Add/Remove Project (#{selected_projects.map{|p| p.name}.join(', ')}): "
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
selected_projects.
|
66
|
-
|
67
|
-
|
63
|
+
clients.sort_by(&:name).each do |client|
|
64
|
+
projects.select{|p| p.client_id == client.id}.sort_by(&:name).each do |p|
|
65
|
+
menu.choice("#{client.name} - #{p.name}") do
|
66
|
+
if selected_projects.include? p
|
67
|
+
selected_projects.delete(p)
|
68
|
+
else
|
69
|
+
selected_projects.push(p)
|
70
|
+
end
|
68
71
|
end
|
69
72
|
end
|
70
73
|
end
|
data/lib/fire_watch/version.rb
CHANGED