-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.txt
More file actions
36 lines (24 loc) · 1.19 KB
/
Copy pathREADME.txt
File metadata and controls
36 lines (24 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
= Java Properties Files in Ruby
I don't know if there's a real need for this, and if there is the jruby
people probably have it covered a lot better than I do. These classes
were mainly whipped up as an exercise in creating a ruby gem.
= JavaProperties::Properties
A class that can read and write to Java properties files that behaves
otherwise as a standard ruby Enumerable. The keys to this object can
be provided as Strings or Symbols, but internally they are Symbols.
require 'rubygems'
require 'java_properties'
# Create a new object from a file
props = JavaProperties::Properties.new("/path/to/file.properties")
# Merge in another file
props.load("/path/to/other/file.properties")
# Behaves as an Enumerable
props.each{ |key,value| puts "#{key} = #{value}" }
= properties2yaml
An executable script to convert an existing properties file to a YAML
file. There is no script to go the other way because not all YAML
files can be saved into a properties file. (That and I was feeling lazy.)
Usage: properties2yaml [options] [INPUT] [OUTPUT]
Options are:
-s, --stdin Read input from standard input instead of an input file
-h, --help Show this help message.