s3_config 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/s3_config/cli.rb +13 -11
- data/lib/s3_config/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: e186bea791a92b33cdc94e1ac695ff54b07b78f5
|
4
|
+
data.tar.gz: 002d681421a1868434762f6c997334b544b33baf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1508796682cfe35e4fb6b86794f13a3a0124a0f91fbb3549083335980651779656ef25154ba7f5dc7a67419655e516bc2ad9baaa4132ea903ce517d2f3e5f9f8
|
7
|
+
data.tar.gz: b1fd8cf059e7b0063d8be63abb12d57a2e418a4815c15377aabe550e3a4eb25cda33ea715c8969bad59ae66402a1c63a64da9f99b5c14e33aa0f6544a233ea58
|
data/lib/s3_config/cli.rb
CHANGED
@@ -31,21 +31,23 @@ module S3Config
|
|
31
31
|
end
|
32
32
|
|
33
33
|
desc "set", "Set S3Config variable for environment. eg: config set production KEY=value"
|
34
|
-
def set(environment=nil,
|
34
|
+
def set(environment=nil, *key_values)
|
35
35
|
return unless validate_installed!
|
36
36
|
return error "Environment required. eg: config set production KEY=value" if environment.nil?
|
37
|
-
key, value = key_value.split '='
|
38
|
-
return error "Key required. eg: config set production KEY=value" if key.nil?
|
39
|
-
key.upcase!
|
40
|
-
if value.nil?
|
41
|
-
error "Value required. eg: config set production KEY=value"
|
42
|
-
say "Use `config unset` to delete a key"
|
43
|
-
return
|
44
|
-
end
|
45
37
|
@application = S3Config.adapter.new environment: environment
|
46
38
|
version = @application.latest_version
|
47
|
-
|
48
|
-
|
39
|
+
key_values.each do |key_value|
|
40
|
+
key, value = key_value.split '='
|
41
|
+
return error "Key required. eg: config set production KEY=value" if key.nil?
|
42
|
+
key.upcase!
|
43
|
+
if value.nil?
|
44
|
+
error "Value required. eg: config set production KEY=value"
|
45
|
+
say "Use `config unset` to delete a key"
|
46
|
+
return
|
47
|
+
end
|
48
|
+
@application.write key, value
|
49
|
+
say "Set #{key}=#{value} (#{environment})"
|
50
|
+
end
|
49
51
|
say "====="
|
50
52
|
if @application.latest_version != version
|
51
53
|
say "New version: v#{@application.latest_version}"
|
data/lib/s3_config/version.rb
CHANGED