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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a051f6dadf6bd20755ecf81cf0c5dd8a257986f
4
- data.tar.gz: 539bdf8d4968eaaf1a5e278985f29610d389eb03
3
+ metadata.gz: 087216a36c3964a570ea5473b84d810acf0a013c
4
+ data.tar.gz: 48660e85354cbd04ccf736624add18db58664203
5
5
  SHA512:
6
- metadata.gz: 9e7927f3db060acd14b86255a0a356bb3c855c31bb49bf7857a5f98f6fbf4ae5345b1e0c8eed1e01ad3d84320c3f7b8fe2c7637a9d7e32a4b7ec67006813dd8a
7
- data.tar.gz: 7a5fef0ea269c95f64f719c82451d94d8103bb974356738c2188fafc22ead5855f47e6e0bba06521ccb569727078a414db5f7079bb5ccb90b7c124eba36c0b0e
6
+ metadata.gz: acf8da1ac0f7f4f7434686302af8409b457151dbbbb7203a56e7e525eb3a4757ef57c71fed20d468cd256e2e7e3256ece58df44a573f98c04ab34fa1dcf82583
7
+ data.tar.gz: 56ce9df1ca8a7a2fc3bc590c638896e21000c7b43584873c62b1540a06e7a4a0a3dcbfdb0eac41d778adfe858699bb098c0617b3c1b8d8bf300392364535c51c
@@ -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.sort_by{|p| p.name}
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
- projects.each do |p|
63
- menu.choice(p.name) do
64
- if selected_projects.include? p
65
- selected_projects.delete(p)
66
- else
67
- selected_projects.push(p)
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
@@ -1,3 +1,3 @@
1
1
  module FireWatch
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fire_watch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Weakley