reflection 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc +0 -0
- data/README.rdoc +105 -7
- data/Reflection.gemspec +32 -1
- data/VERSION +1 -1
- data/doc/Reflection/CLI.html +153 -0
- data/doc/Reflection/Command/Apply.html +266 -0
- data/doc/Reflection/Command/Base.html +385 -0
- data/doc/Reflection/Command/Stash.html +342 -0
- data/doc/Reflection/Command.html +85 -0
- data/doc/Reflection/Config.html +902 -0
- data/doc/Reflection/ConfigArgumentError.html +92 -0
- data/doc/Reflection/Directory/Base.html +657 -0
- data/doc/Reflection/Directory/Stash.html +411 -0
- data/doc/Reflection/Directory.html +85 -0
- data/doc/Reflection/Rails.html +409 -0
- data/doc/Reflection/Repository.html +745 -0
- data/doc/Reflection/Support/Home.html +182 -0
- data/doc/Reflection/Support/Log.html +222 -0
- data/doc/Reflection/Support.html +141 -0
- data/doc/Reflection/Validations.html +135 -0
- data/doc/Reflection.html +285 -0
- data/doc/_index.html +267 -0
- data/doc/class_list.html +197 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +23 -0
- data/doc/css/style.css +261 -0
- data/doc/file.README.html +200 -0
- data/doc/file_list.html +29 -0
- data/doc/index.html +200 -0
- data/doc/js/app.js +91 -0
- data/doc/js/full_list.js +39 -0
- data/doc/js/jquery.js +19 -0
- data/doc/method_list.html +572 -0
- data/doc/top-level-namespace.html +80 -0
- metadata +32 -1
@@ -0,0 +1,200 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<title>Documentation by YARD 0.4.0</title>
|
7
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<div id="header">
|
20
|
+
<div id="menu">
|
21
|
+
|
22
|
+
<a title="Index" href="_index.html">Index</a> »
|
23
|
+
<span class="title">File: README</span>
|
24
|
+
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div id="search">
|
28
|
+
<a id="class_list_link" href="#">Namespace List</a>
|
29
|
+
<a id="method_list_link" href="#">Method List</a>
|
30
|
+
<a id ="file_list_link" href="#">File List</a>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="clear"></div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<iframe id="search_frame"></iframe>
|
37
|
+
|
38
|
+
<div id="content"><div id='filecontents'><h1>Reflection</h1>
|
39
|
+
<p>
|
40
|
+
Reflection is designed to keep your development system in sync with your
|
41
|
+
production system’s files and database (by dumping). It uses a shared
|
42
|
+
git repository to store these files, which allows you to mirror your
|
43
|
+
production environment without the need of direct access to your production
|
44
|
+
servers.
|
45
|
+
</p>
|
46
|
+
<p>
|
47
|
+
It provides two main command modes:
|
48
|
+
</p>
|
49
|
+
<ul>
|
50
|
+
<li>Stash: Indented to be run on the server side, adds a specified directory
|
51
|
+
and, optionally, a database dump to a shared Git repository
|
52
|
+
|
53
|
+
</li>
|
54
|
+
<li>Apply: To be used on a local development machine, gets content from the
|
55
|
+
repository, copies it to a specified directory and optionally loads the
|
56
|
+
database dump into your local database
|
57
|
+
|
58
|
+
</li>
|
59
|
+
</ul>
|
60
|
+
<h2>Get it</h2>
|
61
|
+
<p>
|
62
|
+
Reflection is a gem, hosted on Gemcutter:
|
63
|
+
</p>
|
64
|
+
<pre class="code">
|
65
|
+
<span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='gemcutter identifier id'>gemcutter</span>
|
66
|
+
<span class='gem identifier id'>gem</span> <span class='tumble identifier id'>tumble</span>
|
67
|
+
<span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='reflection identifier id'>reflection</span>
|
68
|
+
</pre>
|
69
|
+
<h2>Stashing your production data</h2>
|
70
|
+
<h4>The simplest form:</h4>
|
71
|
+
<pre class="code">
|
72
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span>
|
73
|
+
</pre>
|
74
|
+
<p>
|
75
|
+
This will clone <tt>git@your-shared-repository.git</tt> and add the
|
76
|
+
directory <tt>/path/to/your/assets</tt> to the repository. Reflection keeps
|
77
|
+
a local version of your repository in HOME/.reflection/stash. So the next
|
78
|
+
time you run the command, there is no need of cloning it again.
|
79
|
+
</p>
|
80
|
+
<h4>Now, lets include a database dump</h4>
|
81
|
+
<pre class="code">
|
82
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> \
|
83
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> \
|
84
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span> \
|
85
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='regexp val'>/rails/</span><span class='root identifier id'>root</span> \
|
86
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='production identifier id'>production</span>
|
87
|
+
</pre>
|
88
|
+
<p>
|
89
|
+
This does the same as above, but additionally dumps your production
|
90
|
+
database and adds the fresh dump to your repository.
|
91
|
+
</p>
|
92
|
+
<h4>I’m lazy..</h4>
|
93
|
+
<p>
|
94
|
+
You too, aren’t you? So Reflection allows you to store all command
|
95
|
+
line options in a config file.
|
96
|
+
</p>
|
97
|
+
<pre class="code">
|
98
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> \
|
99
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> \
|
100
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span> \
|
101
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='regexp val'>/rails/</span><span class='root identifier id'>root</span> \
|
102
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='production identifier id'>production</span> \
|
103
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='write identifier id'>write</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='config identifier id'>config</span>
|
104
|
+
</pre>
|
105
|
+
<p>
|
106
|
+
The next time you want to run the same command as above (useful for cron),
|
107
|
+
you could simply call Reflection with:
|
108
|
+
</p>
|
109
|
+
<pre class="code">
|
110
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='div op'>/</span><span class='path identifier id'>path</span><span class='div op'>/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='config identifier id'>config</span>
|
111
|
+
</pre>
|
112
|
+
<h2>Getting the production stuff on your local development machine</h2>
|
113
|
+
<p>
|
114
|
+
This works exactly the same as describe above, but you would use
|
115
|
+
--apply instead of --stash:
|
116
|
+
</p>
|
117
|
+
<pre class="code">
|
118
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='apply identifier id'>apply</span> \
|
119
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> \
|
120
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span> \
|
121
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='regexp val'>/rails/</span><span class='root identifier id'>root</span> \
|
122
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='development identifier id'>development</span>
|
123
|
+
</pre>
|
124
|
+
<p>
|
125
|
+
This clones or pulls <tt>git@your-shared-repository.git</tt> (again,
|
126
|
+
Reflection keeps a version of your Repository in HOME/.reflection/apply),
|
127
|
+
copies the content to the specified directory (e.g.
|
128
|
+
rails/application/public/assets) and optionally loads the dump into your
|
129
|
+
database.
|
130
|
+
</p>
|
131
|
+
<p>
|
132
|
+
As you may have noticed, the Reflection command above got called with
|
133
|
+
<tt>--rails-env development</tt>, which loads the dump in your development
|
134
|
+
database (as defined by /rails/root/config/database.yml).
|
135
|
+
</p>
|
136
|
+
<h4>A little productivity hint</h4>
|
137
|
+
<p>
|
138
|
+
If you have a <tt>reflection.yml</tt> config file in your current
|
139
|
+
application-development-directory, syncing your server-production
|
140
|
+
environment is as easy as running:
|
141
|
+
</p>
|
142
|
+
<pre class="code">
|
143
|
+
$ <span class='reflection identifier id'>reflection</span>
|
144
|
+
</pre>
|
145
|
+
<h2>reflection --help</h2>
|
146
|
+
<pre class="code">
|
147
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='help identifier id'>help</span>
|
148
|
+
<span class='Usage constant id'>Usage</span><span class='colon op'>:</span> <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='COMMAND constant id'>COMMAND</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='assign token'>=</span><span class='GIT_REPO constant id'>GIT_REPO</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span><span class='assign token'>=</span><span class='PATH constant id'>PATH</span>
|
149
|
+
<span class='minus op'>-</span><span class='or or kw'>or</span><span class='minus op'>-</span>
|
150
|
+
<span class='Usage constant id'>Usage</span><span class='colon op'>:</span> <span class='reflection identifier id'>reflection</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='reflection identifier id'>reflection</span><span class='minus op'>-</span><span class='config identifier id'>config</span><span class='minus op'>-</span><span class='file identifier id'>file</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
151
|
+
|
152
|
+
<span class='On constant id'>On</span> <span class='the identifier id'>the</span> <span class='server identifier id'>server</span> <span class='side identifier id'>side</span><span class='colon op'>:</span>
|
153
|
+
<span class='minus op'>-</span><span class='s identifier id'>s</span><span class='comma token'>,</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> <span class='Store constant id'>Store</span> <span class='your identifier id'>your</span> <span class='assets identifier id'>assets</span> <span class='and and kw'>and</span><span class='regexp val'>/or a database dump in a git-repository.
|
154
|
+
On the client side:
|
155
|
+
-a, --apply Apply assets and/o</span><span class='r identifier id'>r</span> <span class='a identifier id'>a</span> <span class='database identifier id'>database</span> <span class='dump identifier id'>dump</span> <span class='loaded identifier id'>loaded</span> <span class='from identifier id'>from</span> <span class='a identifier id'>a</span> <span class='git identifier id'>git</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span>
|
156
|
+
|
157
|
+
<span class='Required constant id'>Required</span> <span class='options identifier id'>options</span> <span class='for for kw'>for</span> <span class='both identifier id'>both</span><span class='colon op'>:</span>
|
158
|
+
<span class='minus op'>-</span><span class='r identifier id'>r</span><span class='comma token'>,</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='GIT_URL constant id'>GIT_URL</span> <span class='A constant id'>A</span> <span class='Git constant id'>Git</span> <span class='repository identifier id'>repository</span><span class='lparen token'>(</span><span class='url identifier id'>url</span><span class='rparen token'>)</span> <span class='to identifier id'>to</span> <span class='be identifier id'>be</span> <span class='used identifier id'>used</span> <span class='as identifier id'>as</span> <span class='storage identifier id'>storage</span>
|
159
|
+
<span class='minus op'>-</span><span class='d identifier id'>d</span><span class='comma token'>,</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='PATH constant id'>PATH</span> <span class='Path constant id'>Path</span> <span class='to identifier id'>to</span> <span class='your identifier id'>your</span> <span class='asset identifier id'>asset</span> <span class='directory identifier id'>directory</span>
|
160
|
+
|
161
|
+
<span class='Additional constant id'>Additional</span> <span class='options identifier id'>options</span> <span class='for for kw'>for</span> <span class='both identifier id'>both</span><span class='colon op'>:</span>
|
162
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='lbrack token'>[</span><span class='RAILS_ROOT constant id'>RAILS_ROOT</span><span class='rbrack token'>]</span> <span class='Enable constant id'>Enable</span> <span class='dumping identifier id'>dumping</span><span class='div op'>/</span><span class='applying identifier id'>applying</span> <span class='of identifier id'>of</span> <span class='a identifier id'>a</span> <span class='Rails constant id'>Rails</span> <span class='managed identifier id'>managed</span> <span class='MySQL constant id'>MySQL</span> <span class='database identifier id'>database</span>
|
163
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='lbrack token'>[</span><span class='ENV constant id'>ENV</span><span class='rbrack token'>]</span> <span class='Rails constant id'>Rails</span> <span class='environment identifier id'>environment</span> <span class='to identifier id'>to</span> <span class='instrument identifier id'>instrument</span>
|
164
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='write identifier id'>write</span> <span class='lbrack token'>[</span><span class='FILE constant id'>FILE</span><span class='rbrack token'>]</span> <span class='Create constant id'>Create</span> <span class='a identifier id'>a</span> <span class='configuration identifier id'>configuration</span> <span class='FILE constant id'>FILE</span> <span class='from identifier id'>from</span> <span class='the identifier id'>the</span> <span class='current identifier id'>current</span> <span class='commandline identifier id'>commandline</span> <span class='options identifier id'>options</span>
|
165
|
+
</pre>
|
166
|
+
<h2>Note on Patches/Pull Requests</h2>
|
167
|
+
<ul>
|
168
|
+
<li>Fork the project.
|
169
|
+
|
170
|
+
</li>
|
171
|
+
<li>Make your feature addition or bug fix.
|
172
|
+
|
173
|
+
</li>
|
174
|
+
<li>Add specs for it. This is important so I don’t break it in a future
|
175
|
+
version unintentionally.
|
176
|
+
|
177
|
+
</li>
|
178
|
+
<li>Commit, do not mess with rakefile, version, or history. (if you want to
|
179
|
+
have your own version, that is fine but bump version in a commit by itself
|
180
|
+
I can ignore when I pull)
|
181
|
+
|
182
|
+
</li>
|
183
|
+
<li>Send me a pull request. Bonus points for topic branches.
|
184
|
+
|
185
|
+
</li>
|
186
|
+
</ul>
|
187
|
+
<h2>Copyright</h2>
|
188
|
+
<p>
|
189
|
+
Copyright © 2009 Andreas Wolff. See LICENSE for details.
|
190
|
+
</p>
|
191
|
+
</div></div>
|
192
|
+
|
193
|
+
<div id="footer">
|
194
|
+
Generated on Wed Nov 18 18:17:10 2009 by
|
195
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
196
|
+
0.4.0 (ruby-1.8.7).
|
197
|
+
</div>
|
198
|
+
|
199
|
+
</body>
|
200
|
+
</html>
|
data/doc/file_list.html
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
7
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
9
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
10
|
+
<base target="_parent" />
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<h1 id="full_list_header">File List</h1>
|
14
|
+
<div id="search">Search: <input type="text" /></div>
|
15
|
+
<div class="clear"></div>
|
16
|
+
<ul id="full_list">
|
17
|
+
|
18
|
+
|
19
|
+
<li class="r1 ">
|
20
|
+
|
21
|
+
<a title="README" href="index.html">README</a>
|
22
|
+
|
23
|
+
|
24
|
+
</li>
|
25
|
+
|
26
|
+
</ul>
|
27
|
+
</body>
|
28
|
+
</html>
|
29
|
+
|
data/doc/index.html
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
+
<title>Documentation by YARD 0.4.0</title>
|
7
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<div id="header">
|
20
|
+
<div id="menu">
|
21
|
+
|
22
|
+
<a title="Index" href="_index.html">Index</a> »
|
23
|
+
<span class="title">File: README</span>
|
24
|
+
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div id="search">
|
28
|
+
<a id="class_list_link" href="#">Namespace List</a>
|
29
|
+
<a id="method_list_link" href="#">Method List</a>
|
30
|
+
<a id ="file_list_link" href="#">File List</a>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="clear"></div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<iframe id="search_frame"></iframe>
|
37
|
+
|
38
|
+
<div id="content"><div id='filecontents'><h1>Reflection</h1>
|
39
|
+
<p>
|
40
|
+
Reflection is designed to keep your development system in sync with your
|
41
|
+
production system’s files and database (by dumping). It uses a shared
|
42
|
+
git repository to store these files, which allows you to mirror your
|
43
|
+
production environment without the need of direct access to your production
|
44
|
+
servers.
|
45
|
+
</p>
|
46
|
+
<p>
|
47
|
+
It provides two main command modes:
|
48
|
+
</p>
|
49
|
+
<ul>
|
50
|
+
<li>Stash: Indented to be run on the server side, adds a specified directory
|
51
|
+
and, optionally, a database dump to a shared Git repository
|
52
|
+
|
53
|
+
</li>
|
54
|
+
<li>Apply: To be used on a local development machine, gets content from the
|
55
|
+
repository, copies it to a specified directory and optionally loads the
|
56
|
+
database dump into your local database
|
57
|
+
|
58
|
+
</li>
|
59
|
+
</ul>
|
60
|
+
<h2>Get it</h2>
|
61
|
+
<p>
|
62
|
+
Reflection is a gem, hosted on Gemcutter:
|
63
|
+
</p>
|
64
|
+
<pre class="code">
|
65
|
+
<span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='gemcutter identifier id'>gemcutter</span>
|
66
|
+
<span class='gem identifier id'>gem</span> <span class='tumble identifier id'>tumble</span>
|
67
|
+
<span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='reflection identifier id'>reflection</span>
|
68
|
+
</pre>
|
69
|
+
<h2>Stashing your production data</h2>
|
70
|
+
<h4>The simplest form:</h4>
|
71
|
+
<pre class="code">
|
72
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span>
|
73
|
+
</pre>
|
74
|
+
<p>
|
75
|
+
This will clone <tt>git@your-shared-repository.git</tt> and add the
|
76
|
+
directory <tt>/path/to/your/assets</tt> to the repository. Reflection keeps
|
77
|
+
a local version of your repository in HOME/.reflection/stash. So the next
|
78
|
+
time you run the command, there is no need of cloning it again.
|
79
|
+
</p>
|
80
|
+
<h4>Now, lets include a database dump</h4>
|
81
|
+
<pre class="code">
|
82
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> \
|
83
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> \
|
84
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span> \
|
85
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='regexp val'>/rails/</span><span class='root identifier id'>root</span> \
|
86
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='production identifier id'>production</span>
|
87
|
+
</pre>
|
88
|
+
<p>
|
89
|
+
This does the same as above, but additionally dumps your production
|
90
|
+
database and adds the fresh dump to your repository.
|
91
|
+
</p>
|
92
|
+
<h4>I’m lazy..</h4>
|
93
|
+
<p>
|
94
|
+
You too, aren’t you? So Reflection allows you to store all command
|
95
|
+
line options in a config file.
|
96
|
+
</p>
|
97
|
+
<pre class="code">
|
98
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> \
|
99
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> \
|
100
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span> \
|
101
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='regexp val'>/rails/</span><span class='root identifier id'>root</span> \
|
102
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='production identifier id'>production</span> \
|
103
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='write identifier id'>write</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='config identifier id'>config</span>
|
104
|
+
</pre>
|
105
|
+
<p>
|
106
|
+
The next time you want to run the same command as above (useful for cron),
|
107
|
+
you could simply call Reflection with:
|
108
|
+
</p>
|
109
|
+
<pre class="code">
|
110
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='div op'>/</span><span class='path identifier id'>path</span><span class='div op'>/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='config identifier id'>config</span>
|
111
|
+
</pre>
|
112
|
+
<h2>Getting the production stuff on your local development machine</h2>
|
113
|
+
<p>
|
114
|
+
This works exactly the same as describe above, but you would use
|
115
|
+
--apply instead of --stash:
|
116
|
+
</p>
|
117
|
+
<pre class="code">
|
118
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='apply identifier id'>apply</span> \
|
119
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='assets identifier id'>assets</span> \
|
120
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='git identifier id'>git</span><span class='@your ivar id'>@your</span><span class='minus op'>-</span><span class='shared identifier id'>shared</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span><span class='git identifier id'>git</span> \
|
121
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='regexp val'>/rails/</span><span class='root identifier id'>root</span> \
|
122
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='development identifier id'>development</span>
|
123
|
+
</pre>
|
124
|
+
<p>
|
125
|
+
This clones or pulls <tt>git@your-shared-repository.git</tt> (again,
|
126
|
+
Reflection keeps a version of your Repository in HOME/.reflection/apply),
|
127
|
+
copies the content to the specified directory (e.g.
|
128
|
+
rails/application/public/assets) and optionally loads the dump into your
|
129
|
+
database.
|
130
|
+
</p>
|
131
|
+
<p>
|
132
|
+
As you may have noticed, the Reflection command above got called with
|
133
|
+
<tt>--rails-env development</tt>, which loads the dump in your development
|
134
|
+
database (as defined by /rails/root/config/database.yml).
|
135
|
+
</p>
|
136
|
+
<h4>A little productivity hint</h4>
|
137
|
+
<p>
|
138
|
+
If you have a <tt>reflection.yml</tt> config file in your current
|
139
|
+
application-development-directory, syncing your server-production
|
140
|
+
environment is as easy as running:
|
141
|
+
</p>
|
142
|
+
<pre class="code">
|
143
|
+
$ <span class='reflection identifier id'>reflection</span>
|
144
|
+
</pre>
|
145
|
+
<h2>reflection --help</h2>
|
146
|
+
<pre class="code">
|
147
|
+
$ <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='help identifier id'>help</span>
|
148
|
+
<span class='Usage constant id'>Usage</span><span class='colon op'>:</span> <span class='reflection identifier id'>reflection</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='COMMAND constant id'>COMMAND</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='assign token'>=</span><span class='GIT_REPO constant id'>GIT_REPO</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span><span class='assign token'>=</span><span class='PATH constant id'>PATH</span>
|
149
|
+
<span class='minus op'>-</span><span class='or or kw'>or</span><span class='minus op'>-</span>
|
150
|
+
<span class='Usage constant id'>Usage</span><span class='colon op'>:</span> <span class='reflection identifier id'>reflection</span> <span class='regexp val'>/path/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='reflection identifier id'>reflection</span><span class='minus op'>-</span><span class='config identifier id'>config</span><span class='minus op'>-</span><span class='file identifier id'>file</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
151
|
+
|
152
|
+
<span class='On constant id'>On</span> <span class='the identifier id'>the</span> <span class='server identifier id'>server</span> <span class='side identifier id'>side</span><span class='colon op'>:</span>
|
153
|
+
<span class='minus op'>-</span><span class='s identifier id'>s</span><span class='comma token'>,</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='stash identifier id'>stash</span> <span class='Store constant id'>Store</span> <span class='your identifier id'>your</span> <span class='assets identifier id'>assets</span> <span class='and and kw'>and</span><span class='regexp val'>/or a database dump in a git-repository.
|
154
|
+
On the client side:
|
155
|
+
-a, --apply Apply assets and/o</span><span class='r identifier id'>r</span> <span class='a identifier id'>a</span> <span class='database identifier id'>database</span> <span class='dump identifier id'>dump</span> <span class='loaded identifier id'>loaded</span> <span class='from identifier id'>from</span> <span class='a identifier id'>a</span> <span class='git identifier id'>git</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span><span class='dot token'>.</span>
|
156
|
+
|
157
|
+
<span class='Required constant id'>Required</span> <span class='options identifier id'>options</span> <span class='for for kw'>for</span> <span class='both identifier id'>both</span><span class='colon op'>:</span>
|
158
|
+
<span class='minus op'>-</span><span class='r identifier id'>r</span><span class='comma token'>,</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='repository identifier id'>repository</span> <span class='GIT_URL constant id'>GIT_URL</span> <span class='A constant id'>A</span> <span class='Git constant id'>Git</span> <span class='repository identifier id'>repository</span><span class='lparen token'>(</span><span class='url identifier id'>url</span><span class='rparen token'>)</span> <span class='to identifier id'>to</span> <span class='be identifier id'>be</span> <span class='used identifier id'>used</span> <span class='as identifier id'>as</span> <span class='storage identifier id'>storage</span>
|
159
|
+
<span class='minus op'>-</span><span class='d identifier id'>d</span><span class='comma token'>,</span> <span class='minus op'>-</span><span class='minus op'>-</span><span class='directory identifier id'>directory</span> <span class='PATH constant id'>PATH</span> <span class='Path constant id'>Path</span> <span class='to identifier id'>to</span> <span class='your identifier id'>your</span> <span class='asset identifier id'>asset</span> <span class='directory identifier id'>directory</span>
|
160
|
+
|
161
|
+
<span class='Additional constant id'>Additional</span> <span class='options identifier id'>options</span> <span class='for for kw'>for</span> <span class='both identifier id'>both</span><span class='colon op'>:</span>
|
162
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span> <span class='lbrack token'>[</span><span class='RAILS_ROOT constant id'>RAILS_ROOT</span><span class='rbrack token'>]</span> <span class='Enable constant id'>Enable</span> <span class='dumping identifier id'>dumping</span><span class='div op'>/</span><span class='applying identifier id'>applying</span> <span class='of identifier id'>of</span> <span class='a identifier id'>a</span> <span class='Rails constant id'>Rails</span> <span class='managed identifier id'>managed</span> <span class='MySQL constant id'>MySQL</span> <span class='database identifier id'>database</span>
|
163
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='rails identifier id'>rails</span><span class='minus op'>-</span><span class='env identifier id'>env</span> <span class='lbrack token'>[</span><span class='ENV constant id'>ENV</span><span class='rbrack token'>]</span> <span class='Rails constant id'>Rails</span> <span class='environment identifier id'>environment</span> <span class='to identifier id'>to</span> <span class='instrument identifier id'>instrument</span>
|
164
|
+
<span class='minus op'>-</span><span class='minus op'>-</span><span class='write identifier id'>write</span> <span class='lbrack token'>[</span><span class='FILE constant id'>FILE</span><span class='rbrack token'>]</span> <span class='Create constant id'>Create</span> <span class='a identifier id'>a</span> <span class='configuration identifier id'>configuration</span> <span class='FILE constant id'>FILE</span> <span class='from identifier id'>from</span> <span class='the identifier id'>the</span> <span class='current identifier id'>current</span> <span class='commandline identifier id'>commandline</span> <span class='options identifier id'>options</span>
|
165
|
+
</pre>
|
166
|
+
<h2>Note on Patches/Pull Requests</h2>
|
167
|
+
<ul>
|
168
|
+
<li>Fork the project.
|
169
|
+
|
170
|
+
</li>
|
171
|
+
<li>Make your feature addition or bug fix.
|
172
|
+
|
173
|
+
</li>
|
174
|
+
<li>Add specs for it. This is important so I don’t break it in a future
|
175
|
+
version unintentionally.
|
176
|
+
|
177
|
+
</li>
|
178
|
+
<li>Commit, do not mess with rakefile, version, or history. (if you want to
|
179
|
+
have your own version, that is fine but bump version in a commit by itself
|
180
|
+
I can ignore when I pull)
|
181
|
+
|
182
|
+
</li>
|
183
|
+
<li>Send me a pull request. Bonus points for topic branches.
|
184
|
+
|
185
|
+
</li>
|
186
|
+
</ul>
|
187
|
+
<h2>Copyright</h2>
|
188
|
+
<p>
|
189
|
+
Copyright © 2009 Andreas Wolff. See LICENSE for details.
|
190
|
+
</p>
|
191
|
+
</div></div>
|
192
|
+
|
193
|
+
<div id="footer">
|
194
|
+
Generated on Wed Nov 18 18:17:10 2009 by
|
195
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
196
|
+
0.4.0 (ruby-1.8.7).
|
197
|
+
</div>
|
198
|
+
|
199
|
+
</body>
|
200
|
+
</html>
|
data/doc/js/app.js
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
function createSourceLinks() {
|
2
|
+
$('#method_details .source_code, #constructor_details .source_code, #method_missing_details .source_code').
|
3
|
+
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
4
|
+
$('.toggleSource').toggle(function() {
|
5
|
+
$(this).parent().next().slideDown(100);
|
6
|
+
$(this).text("Hide source");
|
7
|
+
},
|
8
|
+
function() {
|
9
|
+
$(this).parent().next().slideUp(100);
|
10
|
+
$(this).text("View source");
|
11
|
+
});
|
12
|
+
}
|
13
|
+
|
14
|
+
function createDefineLinks() {
|
15
|
+
var tHeight = 0;
|
16
|
+
$('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
|
17
|
+
$('.toggleDefines').toggle(function() {
|
18
|
+
tHeight = $(this).parent().prev().height();
|
19
|
+
$(this).prev().show();
|
20
|
+
$(this).parent().prev().height($(this).parent().height());
|
21
|
+
$(this).text("(less)");
|
22
|
+
},
|
23
|
+
function() {
|
24
|
+
$(this).prev().hide();
|
25
|
+
$(this).parent().prev().height(tHeight);
|
26
|
+
$(this).text("more...")
|
27
|
+
});
|
28
|
+
}
|
29
|
+
|
30
|
+
function createFullTreeLinks() {
|
31
|
+
var tHeight = 0;
|
32
|
+
$('.inheritanceTree').toggle(function() {
|
33
|
+
tHeight = $(this).parent().prev().height();
|
34
|
+
$(this).prev().prev().hide();
|
35
|
+
$(this).prev().show();
|
36
|
+
$(this).text("(hide)");
|
37
|
+
$(this).parent().prev().height($(this).parent().height());
|
38
|
+
},
|
39
|
+
function() {
|
40
|
+
$(this).prev().prev().show();
|
41
|
+
$(this).prev().hide();
|
42
|
+
$(this).parent().prev().height(tHeight);
|
43
|
+
$(this).text("show all")
|
44
|
+
});
|
45
|
+
}
|
46
|
+
|
47
|
+
function fixBoxInfoHeights() {
|
48
|
+
$('dl.box dd.r1, dl.box dd.r2').each(function() {
|
49
|
+
$(this).prev().height($(this).height());
|
50
|
+
});
|
51
|
+
}
|
52
|
+
|
53
|
+
function searchFrameLinks() {
|
54
|
+
$('#method_list_link').click(function() {
|
55
|
+
toggleSearchFrame(this, relpath + 'method_list.html');
|
56
|
+
});
|
57
|
+
|
58
|
+
$('#class_list_link').click(function() {
|
59
|
+
toggleSearchFrame(this, relpath + 'class_list.html');
|
60
|
+
});
|
61
|
+
|
62
|
+
$('#file_list_link').click(function() {
|
63
|
+
toggleSearchFrame(this, relpath + 'file_list.html');
|
64
|
+
});
|
65
|
+
}
|
66
|
+
|
67
|
+
function toggleSearchFrame(id, link) {
|
68
|
+
var frame = $('#search_frame');
|
69
|
+
$('#search a').removeClass('active').addClass('inactive');
|
70
|
+
if (frame.attr('src') == link && frame.css('display') != "none") {
|
71
|
+
frame.slideUp(100);
|
72
|
+
$('#search a').removeClass('active inactive');
|
73
|
+
}
|
74
|
+
else {
|
75
|
+
$(id).addClass('active').removeClass('inactive');
|
76
|
+
frame.attr('src', link).slideDown(100);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
function linkSummaries() {
|
81
|
+
$('.summary_signature').click(function() {
|
82
|
+
window.parent.location = $(this).find('a').attr('href');
|
83
|
+
});
|
84
|
+
}
|
85
|
+
|
86
|
+
$(createSourceLinks);
|
87
|
+
$(createDefineLinks);
|
88
|
+
$(createFullTreeLinks);
|
89
|
+
$(fixBoxInfoHeights);
|
90
|
+
$(searchFrameLinks);
|
91
|
+
$(linkSummaries);
|
data/doc/js/full_list.js
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
function fullListSearch() {
|
2
|
+
$('#search input').keyup(function() {
|
3
|
+
var value = this.value.toLowerCase();
|
4
|
+
if (value == "") {
|
5
|
+
$('#full_list li').show();
|
6
|
+
}
|
7
|
+
else {
|
8
|
+
$('#full_list li').each(function() {
|
9
|
+
if ($(this).children('a').text().toLowerCase().indexOf(value) == -1) {
|
10
|
+
$(this).hide();
|
11
|
+
}
|
12
|
+
else {
|
13
|
+
$(this).show();
|
14
|
+
}
|
15
|
+
});
|
16
|
+
}
|
17
|
+
$('#full_list li:even:visible').removeClass('r2').addClass('r1');
|
18
|
+
$('#full_list li:odd:visible').removeClass('r1').addClass('r2');
|
19
|
+
|
20
|
+
if ($('#full_list li:visible').size() == 0) {
|
21
|
+
$('#noresults').fadeIn();
|
22
|
+
}
|
23
|
+
else {
|
24
|
+
$('#noresults').hide();
|
25
|
+
}
|
26
|
+
});
|
27
|
+
|
28
|
+
$('#search input').focus();
|
29
|
+
$('#full_list').after("<div id='noresults'>No results were found.</div>")
|
30
|
+
}
|
31
|
+
|
32
|
+
function linkList() {
|
33
|
+
$('#full_list li').click(function() {
|
34
|
+
window.parent.location = $(this).find('a').attr('href');
|
35
|
+
});
|
36
|
+
}
|
37
|
+
|
38
|
+
$(fullListSearch);
|
39
|
+
$(linkList);
|