![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
user_config is a library to manage configuration files in user's home directory for ruby libraries or applications. The format of a configuration file is yaml.
The class UserConfig manages values of configuration, which is handled as a set of hashes and is saved to yaml files in specified directory under user's home directory.
uconf = UserConfig.new(".some_config")
The directory ~/.some_config is created in the directory ENV['HOME']. To set the value "world" for the key "hello" of ~/.some_config/file.yaml,
uconf["file.yaml"]["hello"] = "world"
The value is not saved to the file. To do that,
uconf["file.yaml"].save
If we want to create initial files with default values, we use the method UserConfig#default.
UserConfig.default('conf.yaml', { 'key1' => 'val1', 'key2' => 'val2' })
uconf = UserConfig.new('.some_config')
uconf.create('conf.yaml')
The file ~/.some_config'/confi.yaml is created. To create another file 'conf2.yaml',
UserConfig.default('conf2.yaml', { 'hello' => 'world'})
uconf.create('conf2.yaml')
We load files in the above example as the following code.
uconf = UserConfig.new('.some_config')
yaml = uconf['conf.yaml']
p yaml['key1']
p yaml['key2']
UserConfig#save_all save all yaml files.
uconf = UserConfig.new('.some_config')
yaml = uconf['conf.yaml']
yaml['key1'] = 'modified_val1'
yaml['key3'] = 'val3'
yaml.save
If we modify some files, we can save all files by UserConfig#save_all.
yaml2 = uconf['conf2.yaml']
yaml2['new_key'] = 'ABCDE'
uconf.save_all
In internal of UserConfig::YAMLFile, the methods of Hash is called except for some methods.
uconf = UserConfig.new('.some_config')
yaml = uconf['conf.yaml']
yaml.each do |key, val|
...
end
yaml.empty?
Copyright (c) 2011 Takayuki YAMAGUCHI. See LICENSE.txt for further details.
FAQs
Unknown package
We found that user_config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.