watch_list 0.1.2 → 0.1.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: 0393f96cfe27b0285bfd762bdac9b0f167973a24
4
- data.tar.gz: 2d8f67229c357f3c392939a2202b4b8173366780
3
+ metadata.gz: 8d739d6fa5ff23c2e8d83257d1e2c92246556d4e
4
+ data.tar.gz: 312388c69caf67e5302a97033fa7908d94e30200
5
5
  SHA512:
6
- metadata.gz: 765504cd0da9408bd4739c5016309da7429208c5144c08f5cb5082091aec74540ce6dee9200e223d63d9d845b4265aad07f9e364eb1c613301c84af93d272f42
7
- data.tar.gz: 2d08916d8521a9ef1b65e7ce4a64fa3ea6a1236392f4466155547f05662ddebc0f5b06d03af07ecf4cea9b9d28c557ebd59472a2ef827209a504893fcade3baf
6
+ metadata.gz: 1784535a372164fa5e20819b97d201dbb66e2d813fb3c00034b5fe969ea658fd968cec914734529ebeea20225391e685db90e45436b0e739f505de3a2c3a0e7a
7
+ data.tar.gz: 6c7141683b0ccd9d49404da4307de108c683e7202761fe75ce4d9cb182bbcee8befdf5cd1051210bd8a7b85ea541dc91d6db6ad4bdf053189c6badee3fc5770b
data/README.md CHANGED
@@ -46,6 +46,8 @@ Usage: watch_list [options]
46
46
  --split
47
47
  -o, --output FILE
48
48
  -s, --status
49
+ --encrypt
50
+ --decrypt
49
51
  --no-color
50
52
  --debug
51
53
  -h, --help
@@ -106,6 +108,8 @@ end
106
108
  git config watch-list.pass "**secret password**"
107
109
  git config watch-list.salt "nU0+G1icf70="
108
110
  # openssl rand -base64 8
111
+
112
+ watch_list --encrypt "secret value"
109
113
  ```
110
114
 
111
115
  ```ruby
@@ -117,7 +121,7 @@ monitor "http monitor" do
117
121
 
118
122
  type :http do
119
123
  httpusername "username"
120
- httppassword :secure=>"A4wjNcr8xl71wVXqsIYuYQ=="
124
+ httppassword :secure=>"yI8mtdeyGrc16+wH9taw9g=="
121
125
  end
122
126
  end
123
127
  ```
@@ -23,16 +23,18 @@ options = {
23
23
 
24
24
  ARGV.options do |opt|
25
25
  begin
26
- opt.on('', '--api-key API_KEY') {|v| options[:apiKey] = v }
27
- opt.on('-a', '--apply') { mode = :apply }
28
- opt.on('-f', '--file FILE') {|v| file = v }
29
- opt.on('' , '--dry-run') { options[:dry_run] = true }
30
- opt.on('-e', '--export') { mode = :export }
31
- opt.on('' , '--split') { split = true }
32
- opt.on('-o', '--output FILE') {|v| output_file = v }
26
+ opt.on('' , '--api-key API_KEY') {|v| options[:apiKey] = v }
27
+ opt.on('-a', '--apply') { mode = :apply }
28
+ opt.on('-f', '--file FILE') {|v| file = v }
29
+ opt.on('' , '--dry-run') { options[:dry_run] = true }
30
+ opt.on('-e', '--export') { mode = :export }
31
+ opt.on('' , '--split') { split = true }
32
+ opt.on('-o', '--output FILE') {|v| output_file = v }
33
33
  opt.on('-s', '--status') { mode = :status }
34
- opt.on('' , '--no-color') { options[:color] = false }
35
- opt.on('' , '--debug') { options[:debug] = true }
34
+ opt.on('' , '--encrypt') { mode = :encrypt }
35
+ opt.on('' , '--decrypt') { mode = :decrypt }
36
+ opt.on('' , '--no-color') { options[:color] = false }
37
+ opt.on('' , '--debug') { options[:debug] = true }
36
38
 
37
39
  opt.on('-h', '--help') do
38
40
  puts opt.help
@@ -46,7 +48,9 @@ ARGV.options do |opt|
46
48
  exit 1
47
49
  end
48
50
 
49
- raise 'apiKey is required' unless options[:apiKey]
51
+ if [:apply, :export, :status].include?(mode) and not options[:apiKey]
52
+ raise 'apiKey is required'
53
+ end
50
54
  rescue => e
51
55
  $stderr.puts("[ERROR] #{e.message}")
52
56
  exit 1
@@ -111,6 +115,14 @@ begin
111
115
  end
112
116
  when :status
113
117
  puts JSON.pretty_generate(client.status)
118
+ when :encrypt
119
+ puts ARGV.map {|value|
120
+ WatchList::Secure.git_encrypt(value)[:secure]
121
+ }.join(' ')
122
+ when :decrypt
123
+ puts ARGV.map {|value|
124
+ WatchList::Secure.git_decrypt(:secure => value)
125
+ }.join(' ')
114
126
  end
115
127
  rescue => e
116
128
  if options[:debug]
@@ -1,3 +1,3 @@
1
1
  module WatchList
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watch_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara