env-tmp 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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +2 -0
  3. data/lib/env-tmp.rb +18 -0
  4. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 260fc4e82768e1924091284546b83d064e983a4a2523f84b75a4f701ac2e271a
4
+ data.tar.gz: 3178403686851dfe0f7c69c79a351fb392c3e684c8a54def8f55f0879ac825dd
5
+ SHA512:
6
+ metadata.gz: 8ef05298a93763d0e33c0063661e8f9c25230bbcc7c143ee02c7d9d29f6f1fa7cf4492c520fe25ef471da6db24dc845c439f545664880fe8d33f07b6ac71b0cc
7
+ data.tar.gz: c10aa51852f18898fe78c2ab2c7c64e98d751eb1bcde16bdb1349a92fc4d030bac63e8ca0f8c575409d75723d4fd89aa79daeba8fd14b07e5b5372d35776cc30
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # environment-temp
2
+ Ruby module for temporarily changing ENV
data/lib/env-tmp.rb ADDED
@@ -0,0 +1,18 @@
1
+ # VERSION: 1.0
2
+ # DATE: 2025-03-30
3
+ # DESCRIPTION: This module provides a temporary environment for the current process.
4
+
5
+
6
+ def ENV.tmp()
7
+ hold = ENV.to_h
8
+
9
+ begin
10
+ yield
11
+ ensure
12
+ ENV.clear
13
+
14
+ hold.each do |key, value|
15
+ ENV[key] = value
16
+ end
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: env-tmp
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Mike O'Sullivan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-03-30 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Temporarily set environment variables
14
+ email: mike@idocs.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - README.md
20
+ - lib/env-tmp.rb
21
+ homepage: https://github.com/mikosullivan/environment-temp
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.3.5
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: env-tmp
44
+ test_files: []