cocks_env 0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/cocks_env.rb +16 -0
  2. metadata +3 -2
data/cocks_env.rb ADDED
@@ -0,0 +1,16 @@
1
+ module Cocks
2
+ def self.load_env dir
3
+ Dir[File.join(dir, "*")].each do |file|
4
+ ENV[File.basename(file)] = File.read(file)
5
+ end
6
+ end
7
+
8
+ def self.env name
9
+ if ! ENV.has_key?(name)
10
+ raise ArgumentError.new("#{ name } isn't an environment variable")
11
+ else
12
+ ENV[name].strip
13
+ end
14
+ end
15
+
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocks_env
3
3
  version: !ruby/object:Gem::Version
4
- version: '0'
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -17,7 +17,8 @@ email:
17
17
  executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
- files: []
20
+ files:
21
+ - cocks_env.rb
21
22
  has_rdoc: true
22
23
  homepage:
23
24
  licenses: []