/
index.html
137 lines (108 loc) · 4.07 KB
/
index.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Mayl by txus</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<header>
<h1>Mayl</h1>
<p>A console to edit and maintain YAML files for any Ruby project</p>
<p class="view"><a href="https://github.com/txus/mayl">View the Project on GitHub <small>txus/mayl</small></a></p>
<ul>
<li><a href="https://github.com/txus/mayl/zipball/master">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/txus/mayl/tarball/master">Download <strong>TAR Ball</strong></a></li>
<li><a href="https://github.com/txus/mayl">Fork On <strong>GitHub</strong></a></li>
</ul>
</header>
<section>
<h1>mayl - a YAML console</h1>
<p>Mayl is an anagram of YAML, and also a console to create, edit and maintain
YAML files in any kind of Ruby projects.</p>
<h2>Installation</h2>
<p>Install mayl yourself:</p>
<pre><code>$ gem install mayl
</code></pre>
<h2>Usage</h2>
<p>Mayl expects your YAML files to be organized like this: one file per locale
(<code>en.yml</code>, <code>es.yml</code>, <code>ca.yml</code>...) in a directory.</p>
<p>When it starts, it needs to know where to find all these YAML files, and it
looks by default under <code>./config/locales</code> but you can always run it like <code>mayl
some/other/dir</code> to override this.</p>
<pre><code>$ mayl
Detected locales: ca, en, es
>
</code></pre>
<p>Now we'll set a new key by typing <code>set KEY</code> and typing in the translations:</p>
<pre><code>> set activerecord.models.post
ca: Article
en: Post
es: Artículo
Set activerecord.models.post to Article (ca), Post (en) and Artículo (es)
>
</code></pre>
<p>Changes get written to the file immediately. We can consult a key any time,
and in case we see any error, correct it quickly with <code>edit LOCALE NEWVALUE</code>:</p>
<pre><code>> get activerecord.models.post
ca: Article
en: Post
es: Artículo
> edit es Entrada
Set activerecord.models.post to Entrada (es)
>
</code></pre>
<h3>Namespaces</h3>
<p>If you want to work for a while inside a namespace, let's say
<code>activerecord.models</code>, you can do so by <code>cd</code>-ing into it, and even <code>ls</code> the
existing keys:</p>
<pre><code>> cd activerecord.models
activerecord.models > get post
ca: Article
en: Post
es: Entrada
activerecord.models > cd ..
activerecord > ls
models attributes
activerecord > cd ..
>
</code></pre>
<p>Cool way to navigate your YAML files huh?</p>
<h3>Other useful commands</h3>
<ul>
<li>
<code>exit</code>: Exits the console.</li>
</ul><h2>Development</h2>
<p>To run the tests:</p>
<pre><code>$ rake
</code></pre>
<p>To build the documentation under the <code>doc</code> directory:</p>
<pre><code>$ rake doc
</code></pre>
<h2>Contributing</h2>
<ol>
<li>Fork it</li>
<li>Create your feature branch (<code>git checkout -b my-new-feature</code>)</li>
<li>Commit your changes (<code>git commit -am 'Added some feature'</code>)</li>
<li>Push to the branch (<code>git push origin my-new-feature</code>)</li>
<li>Create new Pull Request</li>
</ol><h2>Who's this</h2>
<p>This was made by <a href="http://txustice.me">Josep M. Bach (Txus)</a> under the MIT
license. I'm <a href="http://twitter.com/txustice">@txustice</a> on twitter (where you
should probably follow me!).</p>
</section>
<footer>
<p>This project is maintained by <a href="https://github.com/txus">txus</a></p>
<p><small>Hosted on GitHub Pages — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>
<script src="javascripts/scale.fix.js"></script>
</body>
</html>