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
data/.yardoc
ADDED
Binary file
|
data/README.rdoc
CHANGED
@@ -1,18 +1,116 @@
|
|
1
|
-
=
|
1
|
+
= Reflection
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
Reflection is designed to keep your development system in sync with your production system's files and database (by dumping).
|
4
|
+
It uses a shared git repository to store these files, which allows you to mirror your production environment without the need of
|
5
|
+
direct access to your production servers.
|
6
|
+
|
7
|
+
It provides two main command modes:
|
8
|
+
|
9
|
+
* Stash: Indented to be run on the server side, adds a specified directory and, optionally, a database dump to a shared Git repository
|
10
|
+
* Apply: To be used on a local development machine, gets content from the repository, copies it to a specified directory and optionally loads the database dump into your local database
|
11
|
+
|
12
|
+
|
13
|
+
== Get it
|
14
|
+
|
15
|
+
Reflection is a gem, hosted on Gemcutter:
|
16
|
+
|
17
|
+
|
18
|
+
gem install gemcutter
|
19
|
+
gem tumble
|
20
|
+
gem install reflection
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
== Stashing your production data
|
25
|
+
|
26
|
+
==== The simplest form:
|
27
|
+
|
28
|
+
$ reflection --stash --directory /path/to/your/assets --repository git@your-shared-repository.git
|
29
|
+
|
30
|
+
This will clone <tt>git@your-shared-repository.git</tt> and add the directory <tt>/path/to/your/assets</tt> to the repository.
|
31
|
+
Reflection keeps a local version of your repository in HOME/.reflection/stash. So the next time you run the command, there is no need of cloning it again.
|
32
|
+
|
33
|
+
|
34
|
+
==== Now, lets include a database dump
|
35
|
+
|
36
|
+
$ reflection --stash \
|
37
|
+
--directory /path/to/your/assets \
|
38
|
+
--repository git@your-shared-repository.git \
|
39
|
+
--rails /rails/root \
|
40
|
+
--rails-env production
|
41
|
+
|
42
|
+
This does the same as above, but additionally dumps your production database and adds the fresh dump to your repository.
|
43
|
+
|
44
|
+
|
45
|
+
==== I'm lazy..
|
46
|
+
|
47
|
+
You too, aren't you? So Reflection allows you to store all command line options in a config file.
|
48
|
+
|
49
|
+
|
50
|
+
$ reflection --stash \
|
51
|
+
--directory /path/to/your/assets \
|
52
|
+
--repository git@your-shared-repository.git \
|
53
|
+
--rails /rails/root \
|
54
|
+
--rails-env production \
|
55
|
+
--write /path/to/your/config
|
56
|
+
|
57
|
+
|
58
|
+
The next time you want to run the same command as above (useful for cron), you could simply call Reflection with:
|
59
|
+
|
60
|
+
$ reflection /path/to/your/config
|
61
|
+
|
62
|
+
|
63
|
+
== Getting the production stuff on your local development machine
|
64
|
+
|
65
|
+
This works exactly the same as describe above, but you would use --apply instead of --stash:
|
66
|
+
|
67
|
+
$ reflection --apply \
|
68
|
+
--directory /path/to/your/assets \
|
69
|
+
--repository git@your-shared-repository.git \
|
70
|
+
--rails /rails/root \
|
71
|
+
--rails-env development
|
72
|
+
|
73
|
+
This clones or pulls <tt>git@your-shared-repository.git</tt> (again, Reflection keeps a version of your Repository in HOME/.reflection/apply), copies the content to the specified directory (e.g. rails/application/public/assets) and optionally loads the dump into your database.
|
74
|
+
|
75
|
+
As you may have noticed, the Reflection command above got called with <tt>--rails-env development</tt>, which loads the dump in your development database (as defined by /rails/root/config/database.yml).
|
76
|
+
|
77
|
+
|
78
|
+
==== A little productivity hint
|
79
|
+
|
80
|
+
If you have a <tt>reflection.yml</tt> config file in your current application-development-directory, syncing your server-production environment is as easy as running:
|
81
|
+
|
82
|
+
$ reflection
|
83
|
+
|
84
|
+
|
85
|
+
== reflection --help
|
86
|
+
|
87
|
+
$ reflection --help
|
88
|
+
Usage: reflection --COMMAND --repository=GIT_REPO --directory=PATH
|
89
|
+
-or-
|
90
|
+
Usage: reflection /path/to/reflection-config-file.yml
|
91
|
+
|
92
|
+
On the server side:
|
93
|
+
-s, --stash Store your assets and/or a database dump in a git-repository.
|
94
|
+
On the client side:
|
95
|
+
-a, --apply Apply assets and/or a database dump loaded from a git-repository.
|
96
|
+
|
97
|
+
Required options for both:
|
98
|
+
-r, --repository GIT_URL A Git repository(url) to be used as storage
|
99
|
+
-d, --directory PATH Path to your asset directory
|
100
|
+
|
101
|
+
Additional options for both:
|
102
|
+
--rails [RAILS_ROOT] Enable dumping/applying of a Rails managed MySQL database
|
103
|
+
--rails-env [ENV] Rails environment to instrument
|
104
|
+
--write [FILE] Create a configuration FILE from the current commandline options
|
5
105
|
|
6
106
|
|
7
107
|
== Note on Patches/Pull Requests
|
8
108
|
|
9
109
|
* Fork the project.
|
10
110
|
* Make your feature addition or bug fix.
|
11
|
-
* Add
|
12
|
-
future version unintentionally.
|
111
|
+
* Add specs for it. This is important so I don't break it in a future version unintentionally.
|
13
112
|
* Commit, do not mess with rakefile, version, or history.
|
14
|
-
(if you want to have your own version, that is fine but
|
15
|
-
bump version in a commit by itself I can ignore when I pull)
|
113
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
16
114
|
* Send me a pull request. Bonus points for topic branches.
|
17
115
|
|
18
116
|
== Copyright
|
data/Reflection.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{reflection}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andreas Wolff"]
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.files = [
|
26
26
|
".document",
|
27
27
|
".gitignore",
|
28
|
+
".yardoc",
|
28
29
|
"LICENSE",
|
29
30
|
"README.rdoc",
|
30
31
|
"Rakefile",
|
@@ -32,6 +33,36 @@ Gem::Specification.new do |s|
|
|
32
33
|
"TODO",
|
33
34
|
"VERSION",
|
34
35
|
"bin/reflection",
|
36
|
+
"doc/Reflection.html",
|
37
|
+
"doc/Reflection/CLI.html",
|
38
|
+
"doc/Reflection/Command.html",
|
39
|
+
"doc/Reflection/Command/Apply.html",
|
40
|
+
"doc/Reflection/Command/Base.html",
|
41
|
+
"doc/Reflection/Command/Stash.html",
|
42
|
+
"doc/Reflection/Config.html",
|
43
|
+
"doc/Reflection/ConfigArgumentError.html",
|
44
|
+
"doc/Reflection/Directory.html",
|
45
|
+
"doc/Reflection/Directory/Base.html",
|
46
|
+
"doc/Reflection/Directory/Stash.html",
|
47
|
+
"doc/Reflection/Rails.html",
|
48
|
+
"doc/Reflection/Repository.html",
|
49
|
+
"doc/Reflection/Support.html",
|
50
|
+
"doc/Reflection/Support/Home.html",
|
51
|
+
"doc/Reflection/Support/Log.html",
|
52
|
+
"doc/Reflection/Validations.html",
|
53
|
+
"doc/_index.html",
|
54
|
+
"doc/class_list.html",
|
55
|
+
"doc/css/common.css",
|
56
|
+
"doc/css/full_list.css",
|
57
|
+
"doc/css/style.css",
|
58
|
+
"doc/file.README.html",
|
59
|
+
"doc/file_list.html",
|
60
|
+
"doc/index.html",
|
61
|
+
"doc/js/app.js",
|
62
|
+
"doc/js/full_list.js",
|
63
|
+
"doc/js/jquery.js",
|
64
|
+
"doc/method_list.html",
|
65
|
+
"doc/top-level-namespace.html",
|
35
66
|
"lib/reflection.rb",
|
36
67
|
"lib/reflection/cli.rb",
|
37
68
|
"lib/reflection/command.rb",
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
@@ -0,0 +1,153 @@
|
|
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>Module: Reflection::CLI</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 href="../_index.html">Index (C)</a> »
|
23
|
+
<a title="Reflection" href="../Reflection.html">Reflection</a>
|
24
|
+
»
|
25
|
+
<span class="title">CLI</span>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div id="search">
|
30
|
+
<a id="class_list_link" href="#">Namespace List</a>
|
31
|
+
<a id="method_list_link" href="#">Method List</a>
|
32
|
+
<a id ="file_list_link" href="#">File List</a>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="clear"></div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<iframe id="search_frame"></iframe>
|
39
|
+
|
40
|
+
<div id="content"><h1>Module: Reflection::CLI
|
41
|
+
|
42
|
+
|
43
|
+
</h1>
|
44
|
+
|
45
|
+
<dl class="box">
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
<dt class="r1 last">Defined in:</dt>
|
54
|
+
<dd class="r1 last">lib/reflection/cli.rb</dd>
|
55
|
+
|
56
|
+
</dl>
|
57
|
+
<div class="clear"></div>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
<h2>Method Summary</h2>
|
63
|
+
<ul class="summary">
|
64
|
+
|
65
|
+
<li class="public ">
|
66
|
+
<span class="summary_signature"><a title="run! (class method)" href="#run%21-class_method">+ (Object) <strong>run!</strong>(args = nil) </a>
|
67
|
+
|
68
|
+
</span>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<span class="summary_desc"></span>
|
76
|
+
|
77
|
+
</li>
|
78
|
+
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<div id="method_details">
|
85
|
+
<h2>Method Details</h2>
|
86
|
+
|
87
|
+
<div class="method_details first">
|
88
|
+
<p class="signature first" id="run!-class_method">
|
89
|
+
|
90
|
+
+ (<tt>Object</tt>) <strong>run!</strong>(args = nil)
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
</p><table class="source_code">
|
95
|
+
<tr>
|
96
|
+
<td>
|
97
|
+
<pre class="lines">
|
98
|
+
|
99
|
+
|
100
|
+
5
|
101
|
+
6
|
102
|
+
7
|
103
|
+
8
|
104
|
+
9
|
105
|
+
10
|
106
|
+
11
|
107
|
+
12
|
108
|
+
13
|
109
|
+
14
|
110
|
+
15
|
111
|
+
16
|
112
|
+
17
|
113
|
+
18
|
114
|
+
19
|
115
|
+
20</pre>
|
116
|
+
</td>
|
117
|
+
<td>
|
118
|
+
<pre class="code"><span class="info file"># File 'lib/reflection/cli.rb', line 5</span>
|
119
|
+
|
120
|
+
<span class='def def kw'>def</span> <span class='run! fid id'>run!</span><span class='lparen token'>(</span><span class='args identifier id'>args</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span><span class='rparen token'>)</span>
|
121
|
+
<span class='config identifier id'>config</span> <span class='assign token'>=</span> <span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Config constant id'>Config</span><span class='dot token'>.</span><span class='parse identifier id'>parse</span><span class='lparen token'>(</span><span class='args identifier id'>args</span><span class='rparen token'>)</span>
|
122
|
+
|
123
|
+
<span class='if if kw'>if</span> <span class='verify_config identifier id'>verify_config</span><span class='lparen token'>(</span><span class='config identifier id'>config</span><span class='rparen token'>)</span> <span class='eq op'>==</span> <span class='false false kw'>false</span>
|
124
|
+
<span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Support constant id'>Support</span><span class='dot token'>.</span><span class='exit_with_error identifier id'>exit_with_error</span><span class='lparen token'>(</span><span class='string val'>"Ahh ja, missing arguments. Please read 'reflection --help' to get a feeling of how it works."</span><span class='rparen token'>)</span>
|
125
|
+
<span class='else else kw'>else</span>
|
126
|
+
<span class='case case kw'>case</span> <span class='config identifier id'>config</span><span class='dot token'>.</span><span class='command identifier id'>command</span>
|
127
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:apply</span>
|
128
|
+
<span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Command constant id'>Command</span><span class='colon2 op'>::</span><span class='Apply constant id'>Apply</span><span class='dot token'>.</span><span class='run! fid id'>run!</span><span class='lparen token'>(</span><span class='config identifier id'>config</span><span class='rparen token'>)</span>
|
129
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:stash</span>
|
130
|
+
<span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Command constant id'>Command</span><span class='colon2 op'>::</span><span class='Stash constant id'>Stash</span><span class='dot token'>.</span><span class='run! fid id'>run!</span><span class='lparen token'>(</span><span class='config identifier id'>config</span><span class='rparen token'>)</span>
|
131
|
+
<span class='else else kw'>else</span>
|
132
|
+
<span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Support constant id'>Support</span><span class='dot token'>.</span><span class='exit_with_error identifier id'>exit_with_error</span><span class='lparen token'>(</span><span class='string val'>"Couldn't identify command. Please run 'reflection --help'."</span><span class='rparen token'>)</span>
|
133
|
+
<span class='end end kw'>end</span>
|
134
|
+
<span class='end end kw'>end</span>
|
135
|
+
<span class='end end kw'>end</span>
|
136
|
+
</pre>
|
137
|
+
</td>
|
138
|
+
</tr>
|
139
|
+
</table>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
</div>
|
143
|
+
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<div id="footer">
|
147
|
+
Generated on Wed Nov 18 18:17:11 2009 by
|
148
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
149
|
+
0.4.0 (ruby-1.8.7).
|
150
|
+
</div>
|
151
|
+
|
152
|
+
</body>
|
153
|
+
</html>
|
@@ -0,0 +1,266 @@
|
|
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>Class: Reflection::Command::Apply</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 href="../../_index.html">Index (A)</a> »
|
23
|
+
<a title="Reflection" href="../../Reflection.html">Reflection</a> » <a title="Command" href="../Command.html">Command</a>
|
24
|
+
»
|
25
|
+
<span class="title">Apply</span>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div id="search">
|
30
|
+
<a id="class_list_link" href="#">Namespace List</a>
|
31
|
+
<a id="method_list_link" href="#">Method List</a>
|
32
|
+
<a id ="file_list_link" href="#">File List</a>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="clear"></div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<iframe id="search_frame"></iframe>
|
39
|
+
|
40
|
+
<div id="content"><h1>Class: Reflection::Command::Apply
|
41
|
+
|
42
|
+
|
43
|
+
</h1>
|
44
|
+
|
45
|
+
<dl class="box">
|
46
|
+
|
47
|
+
<dt class="r1">Inherits:</dt>
|
48
|
+
<dd class="r1">
|
49
|
+
<span class="inheritName"><a title="Reflection::Command::Base" href="Base.html">Reflection::Command::Base</a></span>
|
50
|
+
|
51
|
+
<ul class="fullTree">
|
52
|
+
<li>Object</li>
|
53
|
+
|
54
|
+
<li class="next"><a title="Reflection::Command::Base" href="Base.html">Reflection::Command::Base</a></li>
|
55
|
+
|
56
|
+
<li class="next">Reflection::Command::Apply</li>
|
57
|
+
|
58
|
+
</ul>
|
59
|
+
<a href="#" class="inheritanceTree">show all</a>
|
60
|
+
|
61
|
+
</dd>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<dt class="r2 last">Defined in:</dt>
|
71
|
+
<dd class="r2 last">lib/reflection/command/apply.rb</dd>
|
72
|
+
|
73
|
+
</dl>
|
74
|
+
<div class="clear"></div>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<h2>Method Summary</h2>
|
84
|
+
<ul class="summary">
|
85
|
+
|
86
|
+
<li class="public ">
|
87
|
+
<span class="summary_signature"><a title="#run! (instance method)" href="#run%21-instance_method">- (Object) <strong>run!</strong> </a>
|
88
|
+
|
89
|
+
</span>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<span class="summary_desc"></span>
|
97
|
+
|
98
|
+
</li>
|
99
|
+
|
100
|
+
|
101
|
+
<li class="public ">
|
102
|
+
<span class="summary_signature"><a title="#validate! (instance method)" href="#validate%21-instance_method">- (Object) <strong>validate!</strong> </a>
|
103
|
+
|
104
|
+
</span>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<span class="summary_desc"></span>
|
112
|
+
|
113
|
+
</li>
|
114
|
+
|
115
|
+
|
116
|
+
</ul>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<h3 class="inherited">Methods inherited from <a title="Reflection::Command::Base" href="Base.html">Reflection::Command::Base</a></h3>
|
125
|
+
<p class="inherited"><a title="#initialize" href="Base.html#initialize-instance_method">#initialize</a>, <a title="run!" href="Base.html#run%21-class_method">run!</a>, <a title="#validate" href="Base.html#validate-instance_method">#validate</a>, <a title="#verify_that_target_is_not_a_repository" href="Base.html#verify_that_target_is_not_a_repository-instance_method">#verify_that_target_is_not_a_repository</a></p>
|
126
|
+
<div id="constructor_details">
|
127
|
+
<h2>Constructor Details</h2>
|
128
|
+
|
129
|
+
<p class="notice">This class inherits a constructor from <a title="Reflection::Command::Base" href="Base.html#initialize-instance_method">Reflection::Command::Base</a></p>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
<div id="method_details">
|
135
|
+
<h2>Method Details</h2>
|
136
|
+
|
137
|
+
<div class="method_details first">
|
138
|
+
<p class="signature first" id="run!-instance_method">
|
139
|
+
|
140
|
+
- (<tt>Object</tt>) <strong>run!</strong>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
</p><table class="source_code">
|
145
|
+
<tr>
|
146
|
+
<td>
|
147
|
+
<pre class="lines">
|
148
|
+
|
149
|
+
|
150
|
+
15
|
151
|
+
16
|
152
|
+
17
|
153
|
+
18
|
154
|
+
19
|
155
|
+
20
|
156
|
+
21
|
157
|
+
22
|
158
|
+
23
|
159
|
+
24
|
160
|
+
25
|
161
|
+
26
|
162
|
+
27
|
163
|
+
28
|
164
|
+
29
|
165
|
+
30
|
166
|
+
31
|
167
|
+
32
|
168
|
+
33
|
169
|
+
34
|
170
|
+
35
|
171
|
+
36
|
172
|
+
37
|
173
|
+
38
|
174
|
+
39
|
175
|
+
40
|
176
|
+
41
|
177
|
+
42
|
178
|
+
43</pre>
|
179
|
+
</td>
|
180
|
+
<td>
|
181
|
+
<pre class="code"><span class="info file"># File 'lib/reflection/command/apply.rb', line 15</span>
|
182
|
+
|
183
|
+
<span class='def def kw'>def</span> <span class='run! fid id'>run!</span>
|
184
|
+
<span class='stash_directory identifier id'>stash_directory</span> <span class='assign token'>=</span> <span class='Directory constant id'>Directory</span><span class='colon2 op'>::</span><span class='Stash constant id'>Stash</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Repository constant id'>Repository</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='config identifier id'>config</span><span class='dot token'>.</span><span class='repository identifier id'>repository</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='string val'>'apply'</span><span class='rparen token'>)</span>
|
185
|
+
<span class='target_directory identifier id'>target_directory</span> <span class='assign token'>=</span> <span class='Directory constant id'>Directory</span><span class='colon2 op'>::</span><span class='Base constant id'>Base</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='config identifier id'>config</span><span class='dot token'>.</span><span class='directory identifier id'>directory</span><span class='rparen token'>)</span>
|
186
|
+
|
187
|
+
<span class='get_user_approval_for_cleaning_target identifier id'>get_user_approval_for_cleaning_target</span><span class='lparen token'>(</span><span class='target_directory identifier id'>target_directory</span><span class='rparen token'>)</span>
|
188
|
+
<span class='get_user_approval_for_apply_database_dump identifier id'>get_user_approval_for_apply_database_dump</span> <span class='if if_mod kw'>if</span> <span class='config identifier id'>config</span><span class='dot token'>.</span><span class='rails_root identifier id'>rails_root</span>
|
189
|
+
|
190
|
+
<span class='verify_that_target_is_not_a_repository identifier id'>verify_that_target_is_not_a_repository</span><span class='lparen token'>(</span><span class='target_directory identifier id'>target_directory</span><span class='rparen token'>)</span>
|
191
|
+
|
192
|
+
<span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='info identifier id'>info</span> <span class='dstring node'>"Applying '#{config.repository}' >> '#{config.directory}'.."</span>
|
193
|
+
|
194
|
+
<span class='target_directory identifier id'>target_directory</span><span class='dot token'>.</span><span class='clean! fid id'>clean!</span>
|
195
|
+
|
196
|
+
<span class='if if kw'>if</span> <span class='stash_directory identifier id'>stash_directory</span><span class='dot token'>.</span><span class='exists? fid id'>exists?</span>
|
197
|
+
<span class='stash_directory identifier id'>stash_directory</span><span class='dot token'>.</span><span class='validate_repository identifier id'>validate_repository</span>
|
198
|
+
<span class='stash_directory identifier id'>stash_directory</span><span class='dot token'>.</span><span class='copy_git_index_to identifier id'>copy_git_index_to</span><span class='lparen token'>(</span><span class='target_directory identifier id'>target_directory</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
|
199
|
+
<span class='repo identifier id'>repo</span> <span class='assign token'>=</span> <span class='Repository constant id'>Repository</span><span class='dot token'>.</span><span class='new_from_path identifier id'>new_from_path</span><span class='lparen token'>(</span><span class='target_directory identifier id'>target_directory</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
|
200
|
+
<span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='reset! fid id'>reset!</span>
|
201
|
+
<span class='repo identifier id'>repo</span><span class='dot token'>.</span><span class='pull identifier id'>pull</span>
|
202
|
+
<span class='stash_directory identifier id'>stash_directory</span><span class='dot token'>.</span><span class='get_git_index_from identifier id'>get_git_index_from</span><span class='lparen token'>(</span><span class='target_directory identifier id'>target_directory</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
|
203
|
+
<span class='else else kw'>else</span>
|
204
|
+
<span class='stash_directory identifier id'>stash_directory</span><span class='dot token'>.</span><span class='clone_repository identifier id'>clone_repository</span>
|
205
|
+
<span class='stash_directory identifier id'>stash_directory</span><span class='dot token'>.</span><span class='move_content_to identifier id'>move_content_to</span><span class='lparen token'>(</span><span class='target_directory identifier id'>target_directory</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
|
206
|
+
<span class='stash_directory identifier id'>stash_directory</span><span class='dot token'>.</span><span class='get_git_index_from identifier id'>get_git_index_from</span><span class='lparen token'>(</span><span class='target_directory identifier id'>target_directory</span><span class='dot token'>.</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
|
207
|
+
<span class='end end kw'>end</span>
|
208
|
+
|
209
|
+
<span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Rails constant id'>Rails</span><span class='dot token'>.</span><span class='apply identifier id'>apply</span><span class='lparen token'>(</span><span class='config identifier id'>config</span><span class='comma token'>,</span> <span class='target_directory identifier id'>target_directory</span><span class='rparen token'>)</span>
|
210
|
+
<span class='Reflection constant id'>Reflection</span><span class='dot token'>.</span><span class='log identifier id'>log</span><span class='dot token'>.</span><span class='info identifier id'>info</span> <span class='string val'>"Apply Command done."</span>
|
211
|
+
<span class='end end kw'>end</span>
|
212
|
+
</pre>
|
213
|
+
</td>
|
214
|
+
</tr>
|
215
|
+
</table>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
<div class="method_details ">
|
219
|
+
<p class="signature " id="validate!-instance_method">
|
220
|
+
|
221
|
+
- (<tt>Object</tt>) <strong>validate!</strong>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</p><table class="source_code">
|
226
|
+
<tr>
|
227
|
+
<td>
|
228
|
+
<pre class="lines">
|
229
|
+
|
230
|
+
|
231
|
+
7
|
232
|
+
8
|
233
|
+
9
|
234
|
+
10
|
235
|
+
11
|
236
|
+
12
|
237
|
+
13</pre>
|
238
|
+
</td>
|
239
|
+
<td>
|
240
|
+
<pre class="code"><span class="info file"># File 'lib/reflection/command/apply.rb', line 7</span>
|
241
|
+
|
242
|
+
<span class='def def kw'>def</span> <span class='validate! fid id'>validate!</span>
|
243
|
+
<span class='validate identifier id'>validate</span><span class='dot token'>.</span><span class='existence_of identifier id'>existence_of</span> <span class='config identifier id'>config</span><span class='dot token'>.</span><span class='directory identifier id'>directory</span>
|
244
|
+
<span class='if if kw'>if</span> <span class='config identifier id'>config</span><span class='dot token'>.</span><span class='rails_root identifier id'>rails_root</span>
|
245
|
+
<span class='validate identifier id'>validate</span><span class='dot token'>.</span><span class='existence_of identifier id'>existence_of</span> <span class='config identifier id'>config</span><span class='dot token'>.</span><span class='rails_root identifier id'>rails_root</span>
|
246
|
+
<span class='Reflection constant id'>Reflection</span><span class='colon2 op'>::</span><span class='Rails constant id'>Rails</span><span class='dot token'>.</span><span class='validate_environment identifier id'>validate_environment</span><span class='lparen token'>(</span><span class='config identifier id'>config</span><span class='rparen token'>)</span>
|
247
|
+
<span class='end end kw'>end</span>
|
248
|
+
<span class='end end kw'>end</span>
|
249
|
+
</pre>
|
250
|
+
</td>
|
251
|
+
</tr>
|
252
|
+
</table>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
<div id="footer">
|
260
|
+
Generated on Wed Nov 18 18:17:10 2009 by
|
261
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
262
|
+
0.4.0 (ruby-1.8.7).
|
263
|
+
</div>
|
264
|
+
|
265
|
+
</body>
|
266
|
+
</html>
|