dotenvx 0.0.1
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/.gitignore +13 -0
- data/.rspec +3 -0
- data/CHANGELOG.md +9 -0
- data/DEVELOPMENT.md +4 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +42 -0
- data/LICENSE +28 -0
- data/README.md +27 -0
- data/Rakefile +35 -0
- data/dotenvx-rails.gemspec +32 -0
- data/dotenvx.gemspec +31 -0
- data/lib/dotenvx/rails.rb +38 -0
- data/lib/dotenvx/version.rb +3 -0
- data/lib/dotenvx-rails.rb +1 -0
- data/lib/dotenvx.rb +7 -0
- metadata +103 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dd4b3bbc927d44665870f9a6d3ef60b3213b69ad048d306f6c66416de047adb7
|
4
|
+
data.tar.gz: 682b7bb172972025f4c68243c8a6c27c8308034a0e5184927c8d0004a552ad49
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: '08006992dd5ffb626047fb48bd77516e23bffa8b47ee5d04919472263596b38ec9f7e9cde06fa8191eb65111518e3fee59169fb0655c7bc20a7a3e89127647cf'
|
7
|
+
data.tar.gz: a25786f760c1a7634f693d369613e0819fd1e1c55f308930613c3484d67f02eac065402dae769311a4ce2e81d3efc2ff830f09105c6d208329257bb241858dbf
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
4
|
+
|
5
|
+
## [Unreleased](https://github.com/dotenv-org/dotenvx-ruby/compare/v0.1.0...main)
|
6
|
+
|
7
|
+
## 0.1.0 and prior
|
8
|
+
|
9
|
+
Please see commit history.
|
data/DEVELOPMENT.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dotenvx (0.0.1)
|
5
|
+
dotenvx-rails (0.0.1)
|
6
|
+
dotenvx (= 0.0.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
byebug (11.1.3)
|
12
|
+
diff-lcs (1.5.1)
|
13
|
+
rake (12.3.3)
|
14
|
+
rspec (3.13.0)
|
15
|
+
rspec-core (~> 3.13.0)
|
16
|
+
rspec-expectations (~> 3.13.0)
|
17
|
+
rspec-mocks (~> 3.13.0)
|
18
|
+
rspec-core (3.13.1)
|
19
|
+
rspec-support (~> 3.13.0)
|
20
|
+
rspec-expectations (3.13.3)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.13.0)
|
23
|
+
rspec-mocks (3.13.2)
|
24
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
+
rspec-support (~> 3.13.0)
|
26
|
+
rspec-support (3.13.1)
|
27
|
+
spring (4.2.1)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
arm64-darwin-23
|
31
|
+
ruby
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
byebug
|
35
|
+
dotenvx!
|
36
|
+
dotenvx-rails!
|
37
|
+
rake (~> 12.0)
|
38
|
+
rspec (~> 3.0)
|
39
|
+
spring
|
40
|
+
|
41
|
+
BUNDLED WITH
|
42
|
+
2.5.11
|
data/LICENSE
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
BSD 3-Clause License
|
2
|
+
|
3
|
+
Copyright (c) 2024, Scott Motte
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
7
|
+
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
9
|
+
list of conditions and the following disclaimer.
|
10
|
+
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
13
|
+
and/or other materials provided with the distribution.
|
14
|
+
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
16
|
+
contributors may be used to endorse or promote products derived from
|
17
|
+
this software without specific prior written permission.
|
18
|
+
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
[](https://dotenvx.com)
|
2
|
+
|
3
|
+
*a better dotenv*–from the creator of [`dotenv`](https://github.com/motdotla/dotenv).
|
4
|
+
|
5
|
+
* run anywhere (cross-platform)
|
6
|
+
* multi-environment
|
7
|
+
* encrypted envs
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
### Quickstart [](https://badge.fury.io/rb/dotenvx)
|
13
|
+
|
14
|
+
Install and use it in code just like ruby `dotenv`.
|
15
|
+
|
16
|
+
```sh
|
17
|
+
gem install dotenvx
|
18
|
+
```
|
19
|
+
```ruby
|
20
|
+
# index.rb
|
21
|
+
require "dotenvx/load"
|
22
|
+
|
23
|
+
puts "Hello #{ENV["HELLO"]}"
|
24
|
+
```
|
25
|
+
|
26
|
+
|
27
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
require "bundler/gem_helper"
|
4
|
+
|
5
|
+
namespace "dotenvx" do
|
6
|
+
Bundler::GemHelper.install_tasks name: "dotenvx"
|
7
|
+
end
|
8
|
+
|
9
|
+
class DotenvxRailsGemHelper < Bundler::GemHelper
|
10
|
+
def guard_already_tagged
|
11
|
+
# noop
|
12
|
+
end
|
13
|
+
|
14
|
+
def tag_version
|
15
|
+
# noop
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
namespace "dotenvx-rails" do
|
20
|
+
DotenvxRailsGemHelper.install_tasks name: "dotenvx-rails"
|
21
|
+
end
|
22
|
+
|
23
|
+
task build: ["dotenvx:build", "dotenvx-rails:build"]
|
24
|
+
task install: ["dotenvx:install", "dotenvx-rails:install"]
|
25
|
+
task release: ["dotenvx:release", "dotenvx-rails:release"]
|
26
|
+
|
27
|
+
require "rspec/core/rake_task"
|
28
|
+
|
29
|
+
desc "Run all specs"
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
31
|
+
t.rspec_opts = %w[--color]
|
32
|
+
t.verbose = false
|
33
|
+
end
|
34
|
+
|
35
|
+
task :default => :spec
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'lib/dotenvx/version'
|
2
|
+
|
3
|
+
Gem::Specification.new "dotenvx-rails" do |spec|
|
4
|
+
spec.name = "dotenvx-rails"
|
5
|
+
spec.version = Dotenvx::VERSION
|
6
|
+
spec.authors = ["motdotla"]
|
7
|
+
spec.email = ["mot@mot.la"]
|
8
|
+
|
9
|
+
spec.summary = %q{[dotenvx.com] a better dotenv–from the creator of `dotenv`}
|
10
|
+
spec.description = %q{[dotenvx.com] a better dotenv–from the creator of `dotenv`}
|
11
|
+
spec.homepage = "https://github.com/dotenvx/dotenvx-ruby"
|
12
|
+
spec.license = "BSD-3-Clause"
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/dotenvx/dotenvx-ruby"
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/dotenvx/dotenvx-ruby"
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_dependency "dotenvx", Dotenvx::VERSION
|
29
|
+
|
30
|
+
spec.add_development_dependency "spring"
|
31
|
+
spec.add_development_dependency "byebug"
|
32
|
+
end
|
data/dotenvx.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'lib/dotenvx/version'
|
2
|
+
|
3
|
+
Gem::Specification.new "dotenvx" do |spec|
|
4
|
+
spec.name = "dotenvx"
|
5
|
+
spec.version = Dotenvx::VERSION
|
6
|
+
spec.authors = ["motdotla"]
|
7
|
+
spec.email = ["mot@mot.la"]
|
8
|
+
|
9
|
+
spec.summary = %q{[dotenvx.com] a better dotenv–from the creator of `dotenv`}
|
10
|
+
spec.description = %q{[dotenvx.com] a better dotenv–from the creator of `dotenv`}
|
11
|
+
spec.homepage = "https://github.com/dotenvx/dotenvx-ruby"
|
12
|
+
spec.license = "BSD-3-Clause"
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/dotenvx/dotenvx-ruby"
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/dotenvx/dotenvx-ruby"
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_development_dependency "rake"
|
29
|
+
spec.add_development_dependency "rspec"
|
30
|
+
spec.add_development_dependency "byebug"
|
31
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "dotenvx"
|
2
|
+
|
3
|
+
# Fix for rake tasks loading in development
|
4
|
+
#
|
5
|
+
# Dotenv loads environment variables when the Rails application is initialized.
|
6
|
+
# When running `rake`, the Rails application is initialized in development.
|
7
|
+
# Rails includes some hacks to set `RAILS_ENV=test` when running `rake test`,
|
8
|
+
# but rspec does not include the same hacks.
|
9
|
+
#
|
10
|
+
# See https://github.com/bkeepers/dotenv/issues/219
|
11
|
+
if defined?(Rake.application)
|
12
|
+
task_regular_expression = /^(default$|parallel:spec|spec(:|$))/
|
13
|
+
if Rake.application.top_level_tasks.grep(task_regular_expression).any?
|
14
|
+
environment = Rake.application.options.show_tasks ? "development" : "test"
|
15
|
+
Rails.env = ENV["RAILS_ENV"] ||= environment
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Dotenvx.instrumenter = ActiveSupport::Notifications
|
20
|
+
|
21
|
+
# Watch all loaded env files with Spring
|
22
|
+
begin
|
23
|
+
require "spring/commands"
|
24
|
+
ActiveSupport::Notifications.subscribe(/^dotenv/) do |*args|
|
25
|
+
event = ActiveSupport::Notifications::Event.new(*args)
|
26
|
+
Spring.watch event.payload[:env].filename if Rails.application
|
27
|
+
end
|
28
|
+
rescue LoadError, ArgumentError
|
29
|
+
# Spring is not available
|
30
|
+
end
|
31
|
+
|
32
|
+
module Dotenvx
|
33
|
+
class Railtie
|
34
|
+
def load
|
35
|
+
Dotenvx.load(*dotenvx_files)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "dotenvx/rails"
|
data/lib/dotenvx.rb
ADDED
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dotenvx
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- motdotla
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-10-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: byebug
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: "[dotenvx.com] a better dotenv–from the creator of `dotenv`"
|
56
|
+
email:
|
57
|
+
- mot@mot.la
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- CHANGELOG.md
|
65
|
+
- DEVELOPMENT.md
|
66
|
+
- Gemfile
|
67
|
+
- Gemfile.lock
|
68
|
+
- LICENSE
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- dotenvx-rails.gemspec
|
72
|
+
- dotenvx.gemspec
|
73
|
+
- lib/dotenvx-rails.rb
|
74
|
+
- lib/dotenvx.rb
|
75
|
+
- lib/dotenvx/rails.rb
|
76
|
+
- lib/dotenvx/version.rb
|
77
|
+
homepage: https://github.com/dotenvx/dotenvx-ruby
|
78
|
+
licenses:
|
79
|
+
- BSD-3-Clause
|
80
|
+
metadata:
|
81
|
+
homepage_uri: https://github.com/dotenvx/dotenvx-ruby
|
82
|
+
source_code_uri: https://github.com/dotenvx/dotenvx-ruby
|
83
|
+
changelog_uri: https://github.com/dotenvx/dotenvx-ruby
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 2.3.0
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
requirements: []
|
99
|
+
rubygems_version: 3.5.11
|
100
|
+
signing_key:
|
101
|
+
specification_version: 4
|
102
|
+
summary: "[dotenvx.com] a better dotenv–from the creator of `dotenv`"
|
103
|
+
test_files: []
|