alerty 0.2.0 → 0.2.1

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: 453543dbd00954cb81e72e140fdfc4e032ff69db
4
- data.tar.gz: 49224e75b73369a2b943c87d3973aacfa6a123bb
3
+ metadata.gz: 7e8514222f9d30f9529bb65aefef3b44281a34fc
4
+ data.tar.gz: 1df34b31d04c6aec0984043abde447c44880a8ac
5
5
  SHA512:
6
- metadata.gz: 53f44b191c4e84f232fd795284f8893b13e594f8e32f2366866bc47542df9027c4ec360a32175e70a4e093d0fe85d85ec593a10a4403877247bc95dc47eb6abc
7
- data.tar.gz: ad6dc6757731631ef8967c334fc810758984d139134003ea839f5dabd8dcfbc132df4cf37b8debae8ff3ba865006310a64ee14af9ba5afffff9d505d96871423
6
+ metadata.gz: c5f2f853bea3d7ee5f27db0aab9e3d5af087a7d8022210db406d664b7889bee558bbaa10061341a54a05ede6add4688fe8bdfd8514e6acb9ad66670adce349fd
7
+ data.tar.gz: fadb6a86ea8f2a7b79bee38cc9f068aa7d26d28fe5d1fc4950cc824e44ab78e3e904172da2d0c5f0438d55da863303d07c7fdafec50df3e2d86282d802f2f2cd
@@ -1,3 +1,9 @@
1
+ # 0.2.1 (2016/09/25)
2
+
3
+ Enhancements:
4
+
5
+ * Add --dotenv option to load environment variables from .env file
6
+
1
7
  # 0.2.0 (2016/09/25)
2
8
 
3
9
  Enhancements:
data/README.md CHANGED
@@ -55,6 +55,7 @@ Usage: alerty [options] -- command
55
55
  --retry-limit NUMBER number of retries (default: 0)
56
56
  --retry-wait SECONDS retry interval = retry wait +/- 12.5% randomness (default: 1.0)
57
57
  -d, --debug debug mode
58
+ --dotenv Load environment variables from .env file with dotenv
58
59
  ```
59
60
 
60
61
  ## Plugins
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "alerty"
3
- gem.version = '0.2.0'
3
+ gem.version = '0.2.1'
4
4
  gem.author = ['Naotoshi Seo']
5
5
  gem.email = ['sonots@gmail.com']
6
6
  gem.homepage = 'https://github.com/sonots/alerty'
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.add_runtime_dependency 'hashie'
17
17
  gem.add_runtime_dependency 'oneline_log_formatter'
18
18
  gem.add_runtime_dependency 'frontkick', '>= 0.4.0'
19
+ gem.add_runtime_dependency 'dotenv'
19
20
 
20
21
  gem.add_development_dependency 'rspec'
21
22
  gem.add_development_dependency 'pry'
@@ -46,6 +46,9 @@ class Alerty
46
46
  op.on('-d', '--debug', "debug mode") {|v|
47
47
  opts[:debug] = true
48
48
  }
49
+ op.on('--dotenv', "Load environment variables from .env file with dotenv") {|v|
50
+ opts[:dotenv] = true
51
+ }
49
52
 
50
53
  op.parse!(argv)
51
54
  opts[:command] = argv.join(' ')
@@ -18,6 +18,10 @@ class Alerty
18
18
  def config
19
19
  @config ||=
20
20
  begin
21
+ if dotenv?
22
+ require 'dotenv'
23
+ Dotenv.load
24
+ end
21
25
  content = File.read(config_path)
22
26
  erb = ERB.new(content, nil, '-')
23
27
  erb_content = erb.result
@@ -62,6 +66,10 @@ class Alerty
62
66
  !!opts[:debug]
63
67
  end
64
68
 
69
+ def dotenv?
70
+ !!opts[:dotenv]
71
+ end
72
+
65
73
  def retry_interval
66
74
  @random ||= Random.new
67
75
  randomness = retry_wait * 0.125
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alerty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.4.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: dotenv
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement