dotenvx-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 59edcde2ee4c16f0c1581939efa3ef3426e9e062236675be8260b0b181f95558
4
+ data.tar.gz: d64364bf92173a244582f3854dd341785edb5b80ef304c6c32732d9d8eec35c6
5
+ SHA512:
6
+ metadata.gz: 05d24cff23ff0823785bc4dcf02f00639f2ce4668c43e49d2bdba0dff333742902381a6f77bbe9cd4c941a332a231373f2494629271bdbd9a8d752070096c4b1
7
+ data.tar.gz: fdae6f75731d50e53078a95c9200df1d1fb3da58d8bbc92d894aaf7d0963d2157cabd72a9b289bb682ad6885ce3fa7200a5776f88723b57972516e99c84cb0a4
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .DS_Store
13
+ .byebug_history
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
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
@@ -0,0 +1,4 @@
1
+ ## Development
2
+
3
+ 1. Bump `dotenvx/version.rb` and tag version
4
+ 2. rake release
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in dotenvx.gemspec
4
+ gemspec name: "dotenvx"
5
+ gemspec name: "dotenvx-rails"
6
+
7
+ gem "rake", "~> 12.0"
8
+ gem "rspec", "~> 3.0"
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
+ [![dotenvx](https://dotenvx.com/better-banner.png)](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
+ &nbsp;
10
+
11
+
12
+ ### Quickstart [![Gem Version](https://badge.fury.io/rb/dotenvx.svg)](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
+ &nbsp;
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,3 @@
1
+ module Dotenvx
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1 @@
1
+ require "dotenvx/rails"
data/lib/dotenvx.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "dotenvx/version"
2
+
3
+ module Dotenvx
4
+ def load(*filenames)
5
+ raise "go to [github.com/dotenvx/dotenvx] and follow ruby directions there"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dotenvx-rails
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: dotenvx
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: spring
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: []