travis 1.7.3.travis.641.5 → 1.7.3.travis.644.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +2 -0
  3. data/lib/travis/cli/env.rb +15 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzVlZjVlOTk5OWYwNzA2YTM3MjcxNzZjMDdlZWYyMTFhNjIwYzBkNA==
4
+ ODQwMmM1NjM1MmYwNTcyNDdjN2ViNGM0YTZlYzg0MjRmMzEzM2Q5Yg==
5
5
  data.tar.gz: !binary |-
6
- Yjk4MWY5ODM2OGJhYjQ5YTRkNTlkMGM2YmRlNzQ4MzNhMTEwM2JmOQ==
6
+ N2I3ZGQ2YTg2M2VkYmVkN2U1YjlhZWMwNGJkNWYyYzA3YTBmNGRhZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGI1YjBjN2RjNmVmNzRkODE3NGYzZDI4ODJmNzViODM2MDE0NmZiZTZjNzA3
10
- ODg4ODA0ZDUyZjcyZTA0ZDVhYjk4YTFmZjlmY2YwMDVlYTg2N2FlMWY0OGNh
11
- Njg4Y2Q4NTQ4NWYzZjFjYjE2YzMwNTY1MzZhZTdmMzRhMDA2Y2Q=
9
+ YzhjYTQyMDUyNmIwZTM0ZmI1OWU0YzVkMDk2NmFiMjdmYzQwNGI3NmNmMWYz
10
+ NWRlMzk5ODBlNGFjNzhlOWY5MTM5NDFiN2M4MTE1Nzg1MTI2Yjk1MjBjZGQx
11
+ ZWZkNjU1NzRjZDM5YmViZDUzMmE3ODNiZTBkYjA2ODY2OTAwMmQ=
12
12
  data.tar.gz: !binary |-
13
- YzI5ZTZhZmQ5OWU2ZWU4NDVjNTMzYTBjODFiOTg4ZWU3ZmNkZTQ0NmM5ODY3
14
- ODYzN2EzMGVjNzBkOTUxNTU0M2U2ZmM3NmMzNmQ4ZTc0YThjNjliNmZlMjIx
15
- N2RiODYwM2Q0ZjQxZTQ1Yjg3MWM0M2Q0YzMyMWUxOTM5MTM3ZWY=
13
+ NjYyYjZjZjY3ODMyOTc2NGIzYTFmNjE1NjEyOWU4YzI1MTg4ZTBmOGNmOGJl
14
+ MmNmZGRhZWY4NDVlZmRhY2ZjZTgyYTVmZWJmMWMzNTllNGY5NDFiYWY2ZGFl
15
+ NjMzMjUwMDcwMDRjMTdkY2Y2MDUwZmQ1NGUyYjc4MjFjMzM1ODM=
data/README.md CHANGED
@@ -834,6 +834,7 @@ Commit all changes to your .travis.yml.
834
834
  travis env set name value [options]
835
835
  travis env unset [names..] [options]
836
836
  travis env copy [names..] [options]
837
+ travis env clear [OPTIONS]
837
838
 
838
839
  -h, --help Display help
839
840
  -i, --[no-]interactive be interactive and colorful
@@ -855,6 +856,7 @@ Commit all changes to your .travis.yml.
855
856
  -P, --[no-]public make new values public
856
857
  -p, --[no-]private make new values private
857
858
  -u, --[no-]unescape do not escape values
859
+ -f, --force do not ask for confirmation when clearing out all variables
858
860
 
859
861
  You can set, list and unset environment variables, or copy them from the current environment:
860
862
 
@@ -4,12 +4,13 @@ require 'shellwords'
4
4
  module Travis
5
5
  module CLI
6
6
  class Env < RepoCommand
7
- on('-P', '--[no-]public', 'make new values public')
8
- on('-p', '--[no-]private', 'make new values private') { |c,v| c.public = !v }
7
+ on('-P', '--[no-]public', 'make new values public')
8
+ on('-p', '--[no-]private', 'make new values private') { |c,v| c.public = !v }
9
9
  on('-u', '--[no-]unescape', 'do not escape values')
10
+ on('-f', '--force', 'do not ask for confirmation when clearing out all variables')
10
11
 
11
12
  description "show or modify build environment variables"
12
- subcommands :list, :set, :unset, :copy
13
+ subcommands :list, :set, :unset, :copy, :clear
13
14
 
14
15
  def setup
15
16
  super
@@ -35,8 +36,18 @@ module Travis
35
36
  end
36
37
 
37
38
  def unset(*names)
39
+ remove_vars { |var| names.include? var.name }
40
+ end
41
+
42
+ def clear
43
+ exit if env_vars.empty?
44
+ exit 1 if interactive? and not force? and not danger_zone? "Clear out all env variables for #{color(repository.slug, :bold)}?"
45
+ remove_vars
46
+ end
47
+
48
+ def remove_vars
38
49
  env_vars.each do |var|
39
- next unless names.include? var.name
50
+ next if block_given? and not yield(var)
40
51
  say color('[x] ', [:red, :bold]) + "removing environment variable #{color "$#{var.name}", :info}"
41
52
  var.delete
42
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3.travis.641.5
4
+ version: 1.7.3.travis.644.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -41,7 +41,7 @@ authors:
41
41
  autorequire:
42
42
  bindir: bin
43
43
  cert_chain: []
44
- date: 2014-09-21 00:00:00.000000000 Z
44
+ date: 2014-09-26 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: faraday