env_gem 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/env_gem.rb +27 -0
- metadata +42 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6e0b4bde11e42646d6721f78af8531432dd535d59d0669c94cc7a60ca00a44c8
|
|
4
|
+
data.tar.gz: 8f8cebc53435b53d0a5ce62ddb5418a7ed8e045781ba6255e7d426a56236b662
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5f038a73726fa17eb77c1d0f3dbbcd5c8c41ba429977cfb0e83d6f8afbff1fdbf15707f8b96db683112be9446e34b59c46ae77b47292c1d6ab3857efca493f6a
|
|
7
|
+
data.tar.gz: d69501b4c9b536cafb36ae42689b90b10251b047e7e1ffb2e5ed97b1c760c656f9cd449055700e995a89ac744b69c9f7acb8e190582a13ad24a294fbcdd41121
|
data/lib/env_gem.rb
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class Env_list
|
|
2
|
+
def self.load_env(file_path)
|
|
3
|
+
keys=[]
|
|
4
|
+
File.foreach(file_path) do |line|
|
|
5
|
+
next if line.strip.empty? || line.start_with?('#')
|
|
6
|
+
|
|
7
|
+
key,value=line.strip.split("=")
|
|
8
|
+
ENV[key]=value if key && value
|
|
9
|
+
|
|
10
|
+
keys.push(key)
|
|
11
|
+
end
|
|
12
|
+
#display key value pair
|
|
13
|
+
keys.each do |k|
|
|
14
|
+
puts "#{k}="+ENV[k]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
# load_env('.env')
|
|
18
|
+
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
obj=Env_list.new
|
|
23
|
+
obj.load_env(".env")
|
|
24
|
+
|
|
25
|
+
puts ENV["Email"]
|
|
26
|
+
|
|
27
|
+
|
metadata
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: env_gem
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.5
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Habi Pyatha
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Env_list.load_env('.env')
|
|
14
|
+
email:
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/env_gem.rb
|
|
20
|
+
homepage:
|
|
21
|
+
licenses: []
|
|
22
|
+
metadata: {}
|
|
23
|
+
post_install_message:
|
|
24
|
+
rdoc_options: []
|
|
25
|
+
require_paths:
|
|
26
|
+
- lib
|
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
28
|
+
requirements:
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '0'
|
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '0'
|
|
37
|
+
requirements: []
|
|
38
|
+
rubygems_version: 3.5.20
|
|
39
|
+
signing_key:
|
|
40
|
+
specification_version: 4
|
|
41
|
+
summary: Lists the gem variables
|
|
42
|
+
test_files: []
|