eye-userenv 0.0.2 → 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 +4 -4
- data/lib/eye-userenv/extend/application_opts.rb +14 -4
- data/lib/eye-userenv/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecea2a84db5bee879f21bb4badeb8dad77c0cafb
|
4
|
+
data.tar.gz: b83b447f63537d28e0ced17355e53492d78d5cae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3e6ba4d3602568b7b708e93b45cb72d43d88cbc1ef97e4deac962ac2705a1395704f4fbf1be31c6c08444724f5c833cd435b7f4a372aeac95257311cfc76552
|
7
|
+
data.tar.gz: 7218554e0fce611d0540e0dfe7fd6785e9f26f2ba70c550957d4ca392cc994fd2c6dc7eb5bcc34197afc44e61d81abe54744c83067693c0a506a4e4a9e183cd1
|
@@ -1,8 +1,18 @@
|
|
1
|
-
Eye::Dsl::ApplicationOpts
|
1
|
+
Eye::Dsl::ApplicationOpts
|
2
|
+
class Eye::Dsl::ApplicationOpts
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
4
|
+
create_options_methods([:user_env_from], Hash)
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
Eye::Dsl::PureOpts
|
9
|
+
class Eye::Dsl::PureOpts
|
10
|
+
|
11
|
+
def set_user_env_from(opts={})
|
12
|
+
raise Eye::Dsl::Error, "Missing uid and/or env_file option" unless opts.has_key?(:uid) || opts.has_key?(:env_file)
|
13
|
+
|
14
|
+
infos = Etc.getpwnam opts[:uid]
|
15
|
+
file_path = File.join(infos.dir, opts[:env_file])
|
6
16
|
|
7
17
|
envs = IO.read(file_path).lines.inject({}) do |out, line|
|
8
18
|
if result = /(?<key>\p{Word}*)=(?<value>.*)/.match(line)
|
data/lib/eye-userenv/version.rb
CHANGED