annotate_yaml 0.0.2 → 0.0.3
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/README.md +56 -2
- data/lib/annotate_yaml/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: f250ace0e7a275aa4aa88857e1fc928b5ba6dd4f
|
4
|
+
data.tar.gz: 0140c49db858f2f70f2dd52f17052b1f5647c917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a38d9e5750a221993df700f66e4b5282ac02697959eff2f0616c7acbd59171491423dd9cea6353c735bfefebb0a291da9e16b77cf937e6fa51db12e1d747818
|
7
|
+
data.tar.gz: 7ffa722bea2d770fa5551ee09b0abc14ab0a2eed9bb169bd7191dc22a40ba5254e6dc3de92334d8ab8d1c318f7263be960846632f4d8a71cbf22181aca0d679e
|
data/README.md
CHANGED
@@ -1,6 +1,56 @@
|
|
1
1
|
# AnnotateYaml
|
2
2
|
|
3
|
-
|
3
|
+
Have you never been bored to scroll up an entire YAML structure to find out how to access the value?
|
4
|
+
|
5
|
+
Fear no more, here is this marvellous gem which add comment to each value of your YAML files so you can easily use it in your views or wherever you may need it.
|
6
|
+
|
7
|
+
## Quick Exemple
|
8
|
+
|
9
|
+
Let's say you want to use the quadrillion value of this file, what is its key?
|
10
|
+
|
11
|
+
en:
|
12
|
+
number:
|
13
|
+
format:
|
14
|
+
delimiter: ! ','
|
15
|
+
precision: 3
|
16
|
+
separator: .
|
17
|
+
significant: false
|
18
|
+
strip_insignificant_zeros: false
|
19
|
+
[...]
|
20
|
+
human:
|
21
|
+
decimal_units:
|
22
|
+
format: ! '%n %u'
|
23
|
+
units:
|
24
|
+
billion: Billion
|
25
|
+
million: Million
|
26
|
+
quadrillion: Quadrillion
|
27
|
+
thousand: Thousand
|
28
|
+
trillion: Trillion
|
29
|
+
unit: ''
|
30
|
+
|
31
|
+
With annotate_yaml your YAML file will look like this:
|
32
|
+
|
33
|
+
en:
|
34
|
+
number:
|
35
|
+
format:
|
36
|
+
delimiter: ! ',' # en.number.format.delimiter
|
37
|
+
precision: 3 # en.number.format.precision
|
38
|
+
separator: . # en.number.format.separator
|
39
|
+
significant: false # en.number.format.significant
|
40
|
+
strip_insignificant_zeros: false # en.number.format.strip_insignificant_zeros
|
41
|
+
[...]
|
42
|
+
human:
|
43
|
+
decimal_units:
|
44
|
+
format: ! '%n %u' # en.number.human.decimal_units.format
|
45
|
+
units:
|
46
|
+
billion: Billion # en.number.human.decimal_units.units.billion
|
47
|
+
million: Million # en.number.human.decimal_units.units.million
|
48
|
+
quadrillion: Quadrillion # en.number.human.decimal_units.units.quadrillion
|
49
|
+
thousand: Thousand # en.number.human.decimal_units.units.thousand
|
50
|
+
trillion: Trillion # en.number.human.decimal_units.units.trillion
|
51
|
+
unit: '' # en.number.human.decimal_units.units.unit
|
52
|
+
|
53
|
+
Now you know the key is `number.human.decimal_units.units.quadrillion`, thanks annotate_yaml!
|
4
54
|
|
5
55
|
## Installation
|
6
56
|
|
@@ -18,7 +68,11 @@ Or install it yourself as:
|
|
18
68
|
|
19
69
|
## Usage
|
20
70
|
|
21
|
-
|
71
|
+
To annotate your locales run:
|
72
|
+
|
73
|
+
`rake annotate:yaml:locales`
|
74
|
+
|
75
|
+
This will add a commented key to access each value of the YAML file.
|
22
76
|
|
23
77
|
## Contributing
|
24
78
|
|