dotenv-mh 0.1.0
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/Gemfile +8 -0
- data/README.md +29 -0
- data/Rakefile +4 -0
- data/dotenv-mh.gemspec +38 -0
- data/lib/dotenv/mh/version.rb +7 -0
- data/lib/dotenv/mh.rb +40 -0
- data/sig/dotenv/mh.rbs +6 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0c64db36b38a42c0b310070c9e089850b181b686e7655643a8488ca0f418b32c
|
4
|
+
data.tar.gz: 39ae918b5420ba32e390e22fb59d151e31074c96dc5949484dd8a987757c2826
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 83b5e884f34099874f9da4c481d19a636c9b58cfcc4bd910660a75e249c050f468a6ffc84ed5dcd0555e8fbe6a98c648ce16d6a11a2e86f8cd6781e00876a9cd
|
7
|
+
data.tar.gz: 2dc85bde05a1b874f54d6e6caad4902886984d000529aec3b9f023539dd8474fed4602436a0da9053c6e31f84b89a5e19f0f830e0657f0602e114aaa39d44556
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Dotenv::Mh
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dotenv/mh`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Install the gem and add to the application's Gemfile by executing:
|
10
|
+
|
11
|
+
$ bundle add dotenv-mh
|
12
|
+
|
13
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
14
|
+
|
15
|
+
$ gem install dotenv-mh
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
TODO: Write usage instructions here
|
20
|
+
|
21
|
+
## Development
|
22
|
+
|
23
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
24
|
+
|
25
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dotenv-mh.
|
data/Rakefile
ADDED
data/dotenv-mh.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/dotenv/mh/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "dotenv-mh"
|
7
|
+
spec.version = Dotenv::Mh::VERSION
|
8
|
+
spec.authors = ["Herrera Maxi"]
|
9
|
+
spec.email = ["herreramaxi@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "dotenv gem for loading environment variables"
|
12
|
+
spec.description = "dotenv gem for loading environment variables from .env file"
|
13
|
+
# spec.homepage = "Put your gem's website or public repo URL here."
|
14
|
+
spec.required_ruby_version = ">= 2.6.0"
|
15
|
+
|
16
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
17
|
+
|
18
|
+
# spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
20
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(__dir__) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
# Uncomment to register a new dependency of your gem
|
34
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
35
|
+
|
36
|
+
# For more information and examples about making a new gem, check out our
|
37
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
38
|
+
end
|
data/lib/dotenv/mh.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "mh/version"
|
4
|
+
|
5
|
+
module Dotenv
|
6
|
+
# module Mh
|
7
|
+
# class Dotenv
|
8
|
+
def self.load()
|
9
|
+
|
10
|
+
if(!File.file?('.env')) then
|
11
|
+
puts ".env file not found"
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
puts "loading .env file..."
|
16
|
+
|
17
|
+
File.readlines('.env').each do |line|
|
18
|
+
puts(line)
|
19
|
+
|
20
|
+
if(line.start_with?("#")) then
|
21
|
+
puts("skipping: line comment")
|
22
|
+
next
|
23
|
+
end
|
24
|
+
|
25
|
+
keyValue = line.strip().split("=", 2)
|
26
|
+
|
27
|
+
if(keyValue.length != 2) then
|
28
|
+
puts("skipping: wrong line detected")
|
29
|
+
next
|
30
|
+
end
|
31
|
+
|
32
|
+
key = keyValue[0]
|
33
|
+
value = keyValue[1]
|
34
|
+
|
35
|
+
ENV[key] = value
|
36
|
+
end
|
37
|
+
end
|
38
|
+
# end
|
39
|
+
# end
|
40
|
+
end
|
data/sig/dotenv/mh.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dotenv-mh
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Herrera Maxi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-10-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: dotenv gem for loading environment variables from .env file
|
14
|
+
email:
|
15
|
+
- herreramaxi@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- Gemfile
|
21
|
+
- README.md
|
22
|
+
- Rakefile
|
23
|
+
- dotenv-mh.gemspec
|
24
|
+
- lib/dotenv/mh.rb
|
25
|
+
- lib/dotenv/mh/version.rb
|
26
|
+
- sig/dotenv/mh.rbs
|
27
|
+
homepage:
|
28
|
+
licenses: []
|
29
|
+
metadata: {}
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options: []
|
32
|
+
require_paths:
|
33
|
+
- lib
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 2.6.0
|
39
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
requirements: []
|
45
|
+
rubygems_version: 3.3.7
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: dotenv gem for loading environment variables
|
49
|
+
test_files: []
|