dotenv 2.1.0 → 2.1.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: 97b35237fb293817afb2b3fb79b08b21a5425b65
4
- data.tar.gz: f1ec39284e95bcf5a9b96e5cf3cd4aaa1e4d9e67
3
+ metadata.gz: 5508950dd1e5103013a6bfe56b9397e41c40f11e
4
+ data.tar.gz: ee3ccf9b9429d44b7ad9482159dc300407a52847
5
5
  SHA512:
6
- metadata.gz: aab63b855e90cb05ceedcc3877f425e2af3cdb94327423f3ce8f253b5da5e392a64f5b00b9114480ed83b42ad72a3ffdc1ec2bfaa0f3d94fed1c5d0858c0d459
7
- data.tar.gz: 4e097555c5daa7e2bcb800d771da52936298906ba5e3affa6b5835c50921690191d2610ceae5a1de329fa51ed64f494ea66ff5d80cc917fd34e5065019c73d4c
6
+ metadata.gz: 6550d4890592e8cb8afb5cda664cb07fb89477784ea112887716f81d8f4a5020e46e222648dbc7b4c034254eb230d4185b577a0897a34cfa5e0220bd70ce891e
7
+ data.tar.gz: 083105855f61a20b42f1f2423dfa8fd8dc30efcd6760a2789d5cd0b7c0d85beb759bb574016bf2833c71055191cba6ccb70bcc55e5f525513618b6f359b612ad
@@ -39,11 +39,11 @@ module Dotenv
39
39
  # Internal: Helper to expand list of filenames.
40
40
  #
41
41
  # Returns a hash of all the loaded environment variables.
42
- def with(*filenames, &block)
42
+ def with(*filenames)
43
43
  filenames << ".env" if filenames.empty?
44
44
 
45
45
  filenames.reduce({}) do |hash, filename|
46
- hash.merge! block.call(File.expand_path(filename)) || {}
46
+ hash.merge!(yield(File.expand_path(filename)) || {})
47
47
  end
48
48
  end
49
49
 
@@ -51,7 +51,7 @@ module Dotenv
51
51
  if instrumenter
52
52
  instrumenter.instrument(name, payload, &block)
53
53
  else
54
- block.call
54
+ yield
55
55
  end
56
56
  end
57
57
 
@@ -14,7 +14,7 @@ module Dotenv
14
14
  end
15
15
 
16
16
  def read
17
- File.open(@filename, "rb:bom|utf-8") { |file| file.read }
17
+ File.open(@filename, "rb:bom|utf-8", &:read)
18
18
  end
19
19
 
20
20
  def apply
@@ -55,10 +55,10 @@ module Dotenv
55
55
  @hash[key] = parse_value(value || "")
56
56
  elsif line.split.first == "export"
57
57
  if variable_not_set?(line)
58
- fail FormatError, "Line #{line.inspect} has an unset variable"
58
+ raise FormatError, "Line #{line.inspect} has an unset variable"
59
59
  end
60
60
  elsif line !~ /\A\s*(?:#.*)?\z/ # not comment or blank line
61
- fail FormatError, "Line #{line.inspect} doesn't match format"
61
+ raise FormatError, "Line #{line.inspect} doesn't match format"
62
62
  end
63
63
  end
64
64
 
@@ -1,3 +1,3 @@
1
1
  module Dotenv
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-14 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rubocop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.37.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.37.2
55
55
  description: Loads environment variables from `.env`.
56
56
  email:
57
57
  - brandon@opensoul.org