hu 1.1.1 → 1.1.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hu/collab.rb +13 -1
  3. data/lib/hu/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f10d4842d2340744f5c404c5559b62e744b8e61
4
- data.tar.gz: 1c7730939bba527fc2018b6068a9c70a415bc843
3
+ metadata.gz: 4d3e7d5397ca1407be4e8e0a651d65e10fb6f733
4
+ data.tar.gz: 7c1b1be7cba228576e3403d8259ec654b4aa8861
5
5
  SHA512:
6
- metadata.gz: 14dd19a03982ea3565205f2e5790d6edd9a1f9e485b362837a7ab0bbb95b175dd7636b11deea0c9d68c4ba655ae142e07b17218a66b2f2f20a24f8ae4863aca3
7
- data.tar.gz: 8b6130943bd2b5c44ae610dee0693bc8aab7c630cf9d5ce3aca099c760bf7074a76da11dea2964f5ea3c4b3291469187e8c078b09a933f517115690997d0303c
6
+ metadata.gz: ffafe29f5abba66540fee1a76b27f01b3b8a99ce0b03b8aa32ad35f1bacf854279eed320618a787dba9176b1715d7771b472da628f4afda527c4b2acf8a75f30
7
+ data.tar.gz: ee98357ee12c80f4ab4920647b10be3891e4e7a352f0ea0bc78a83b4970a2571e74c85cdabffc078274175f77fd9950825c128bac9182d83174ef79cb660464d
@@ -22,6 +22,10 @@ module Hu
22
22
  text "Start by exporting the current mapping,"
23
23
  text "edit to taste, then diff and import."
24
24
  text ""
25
+ text "The environment variable HU_IGNORE_APPS"
26
+ text "may contain space delimited glob(7) patterns"
27
+ text "of apps to be ignored."
28
+ text ""
25
29
  text "WARNING: If you remove yourself from an application"
26
30
  text " then hu won't be able to see it anymore."
27
31
  def collab; end
@@ -182,6 +186,7 @@ module Hu
182
186
  unless parsed.include? 'apps'
183
187
  raise ArgumentError, "Malformed input, key 'apps' not found."
184
188
  end
189
+ parsed['apps'].reject!{ |e| ignored_app?(e) }
185
190
  parsed['apps'].each do |app_name, v|
186
191
  unless heroku_state['apps'].include? app_name
187
192
  raise ArgumentError, "Unknown application: #{app_name}"
@@ -193,11 +198,18 @@ module Hu
193
198
  parsed
194
199
  end
195
200
 
201
+ def ignored_app?(app_name)
202
+ ENV.fetch('HU_IGNORE_APPS','').split(' ').each do |p|
203
+ return true if File.fnmatch(p, app_name)
204
+ end
205
+ false
206
+ end
207
+
196
208
  def heroku_state(force_refresh=false)
197
209
  return @heroku_state unless force_refresh or @heroku_state.nil?
198
210
  all_collaborators = Set.new
199
211
  data = { 'apps' => {} }
200
- app_names = h.app.list.map{|e| e['name']}
212
+ app_names = h.app.list.map{|e| e['name']}.reject{ |e| ignored_app?(e) }
201
213
  threads = []
202
214
  app_names.each_with_index do |app_name,i|
203
215
  threads << Thread.new do
@@ -1,3 +1,3 @@
1
1
  module Hu
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - moe