olag 0.1.18 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +10 -0
- data/codnar.html +18 -14
- data/lib/olag/rake.rb +6 -4
- data/lib/olag/test/with_tempfile.rb +6 -5
- data/lib/olag/version.rb +1 -1
- metadata +5 -5
data/ChangeLog
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
2012-03-18 Oren Ben-Kiki <github-oren@ben-kiki.org>
|
2
|
+
|
3
|
+
* Remove bug introduced by previous fix.
|
4
|
+
* Fix nasty timing bug (tempfile finalizer).
|
5
|
+
* Update to latest gem versions.
|
6
|
+
|
7
|
+
2012-01-27 Oren Ben-Kiki <github-oren@ben-kiki.org>
|
8
|
+
|
9
|
+
* Fix syntax highlighting.
|
10
|
+
|
1
11
|
2012-01-17 Oren Ben-Kiki <github-oren@ben-kiki.org>
|
2
12
|
|
3
13
|
* Add hack for sorting hash YAML keys.
|
data/codnar.html
CHANGED
@@ -800,12 +800,12 @@ The Olag::Rake class sets up the tasks listed above as follows:
|
|
800
800
|
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">olag/update_version</span><span class="Special">"</span>
|
801
801
|
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">olag/version</span><span class="Special">"</span>
|
802
802
|
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">rake/clean</span><span class="Special">"</span>
|
803
|
-
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">rake/gempackagetask</span><span class="Special">"</span>
|
804
|
-
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">rake/rdoctask</span><span class="Special">"</span>
|
805
803
|
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">rake/testtask</span><span class="Special">"</span>
|
806
804
|
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">rcov/rcovtask</span><span class="Special">"</span>
|
805
|
+
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">rdoc/task</span><span class="Special">"</span>
|
807
806
|
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">reek/rake/task</span><span class="Special">"</span>
|
808
807
|
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">roodi</span><span class="Special">"</span>
|
808
|
+
<span class="PreProc">require</span> <span class="Special">"</span><span class="Constant">rubygems/package_task</span><span class="Special">"</span>
|
809
809
|
|
810
810
|
<span class="PreProc">module</span> <span class="Type">Olag</span>
|
811
811
|
|
@@ -827,6 +827,8 @@ Automate Rake task creation for a gem.
|
|
827
827
|
<pre class='ruby code syntax'>
|
828
828
|
<span class="PreProc">class</span> <span class="Type">Rake</span>
|
829
829
|
|
830
|
+
<span class="PreProc">include</span> ::<span class="Type">Rake</span>::<span class="Type">DSL</span>
|
831
|
+
|
830
832
|
</pre>
|
831
833
|
<table class='layout'>
|
832
834
|
<tr>
|
@@ -884,18 +886,18 @@ Define a task that does “everything”.
|
|
884
886
|
<td class='html'>
|
885
887
|
<div class='rdoc comment markup'>
|
886
888
|
<p>
|
887
|
-
This is a problem. If the version number gets updated,
|
889
|
+
This is a problem. If the version number gets updated, Gem::PackageTask
|
888
890
|
fails. This is better than if it used the old version number, I suppose,
|
889
891
|
but not as nice as if it just used @spec.version everywhere. The solution
|
890
|
-
for this is to do a dry run before doing the final <
|
891
|
-
<
|
892
|
+
for this is to do a dry run before doing the final <code>rake</code>
|
893
|
+
<code>commit</code>, which is a good idea in general.
|
892
894
|
</p>
|
893
895
|
</div>
|
894
896
|
</td>
|
895
897
|
</tr>
|
896
898
|
</table>
|
897
899
|
<pre class='ruby code syntax'>
|
898
|
-
|
900
|
+
<span class="Type">Gem</span>::<span class="Type">PackageTask</span>.new(<span class="Identifier">@spec</span>) { |<span class="Identifier">package</span>| }
|
899
901
|
end
|
900
902
|
|
901
903
|
</pre>
|
@@ -1790,14 +1792,14 @@ This module contains all the Olag code.
|
|
1790
1792
|
<div class='rdoc comment markup'>
|
1791
1793
|
<p>
|
1792
1794
|
This version number. The third number is automatically updated to track the
|
1793
|
-
number of Git commits by running <
|
1795
|
+
number of Git commits by running <code>rake version</code>.
|
1794
1796
|
</p>
|
1795
1797
|
</div>
|
1796
1798
|
</td>
|
1797
1799
|
</tr>
|
1798
1800
|
</table>
|
1799
1801
|
<pre class='ruby code syntax'>
|
1800
|
-
<span class="Type">VERSION</span> = <span class="Special">"</span><span class="Constant">0.1.
|
1802
|
+
<span class="Type">VERSION</span> = <span class="Special">"</span><span class="Constant">0.1.22</span><span class="Special">"</span>
|
1801
1803
|
|
1802
1804
|
end
|
1803
1805
|
</pre>
|
@@ -3385,8 +3387,8 @@ when the test is done.
|
|
3385
3387
|
file = <span class="Type">Tempfile</span>.open(path, directory)
|
3386
3388
|
file.write(content)
|
3387
3389
|
file.close(<span class="Constant">false</span>)
|
3388
|
-
(<span class="Identifier">@tempfiles</span> ||= []) <<
|
3389
|
-
<span class="Statement">return</span> path
|
3390
|
+
(<span class="Identifier">@tempfiles</span> ||= []) << file
|
3391
|
+
<span class="Statement">return</span> file.path
|
3390
3392
|
<span class="PreProc">end</span>
|
3391
3393
|
|
3392
3394
|
</pre>
|
@@ -3409,8 +3411,8 @@ complex file tests that can’t use FakeFS.
|
|
3409
3411
|
<pre class='ruby code syntax'>
|
3410
3412
|
<span class="PreProc">def</span> <span class="Identifier">create_tempdir</span>(directory = <span class="Special">"</span><span class="Constant">.</span><span class="Special">"</span>)
|
3411
3413
|
file = <span class="Type">Tempfile</span>.open(<span class="Special">"</span><span class="Constant">dir</span><span class="Special">"</span>, directory)
|
3412
|
-
(<span class="Identifier">@tempfiles</span> ||= []) <<
|
3413
|
-
<span class="Type">File</span>.delete(path)
|
3414
|
+
(<span class="Identifier">@tempfiles</span> ||= []) << file
|
3415
|
+
<span class="Type">File</span>.delete(path = file.path)
|
3414
3416
|
<span class="Type">Dir</span>.mkdir(path)
|
3415
3417
|
<span class="Statement">return</span> path
|
3416
3418
|
<span class="PreProc">end</span>
|
@@ -3456,7 +3458,8 @@ Automatically clean up the temporary files when the test is done.
|
|
3456
3458
|
<span class="PreProc">def</span> <span class="Identifier">teardown</span>
|
3457
3459
|
tempfile_original_teardown
|
3458
3460
|
(<span class="Identifier">@tempfiles</span> || []).each <span class="Statement">do</span> |<span class="Identifier">tempfile</span>|
|
3459
|
-
|
3461
|
+
path = tempfile.path
|
3462
|
+
<span class="Type">FileUtils</span>.rm_rf(path) <span class="Statement">if</span> <span class="Type">File</span>.exist?(path)
|
3460
3463
|
<span class="Statement">end</span>
|
3461
3464
|
<span class="PreProc">end</span>
|
3462
3465
|
|
@@ -4655,7 +4658,8 @@ function contents_lists() {
|
|
4655
4658
|
var container;
|
4656
4659
|
var indices = [];
|
4657
4660
|
var h_elements = all_h_elements();
|
4658
|
-
for (var e in h_elements)
|
4661
|
+
/* Using "for (var e in h_elements)" is too sensitive to other libraries */
|
4662
|
+
for (var e = 0; e < h_elements.length; e++) {
|
4659
4663
|
h = h_elements[e];
|
4660
4664
|
var level = h.tagName.substring(1, 2) - 1;
|
4661
4665
|
container = pop_container(container, indices, level);
|
data/lib/olag/rake.rb
CHANGED
@@ -4,18 +4,20 @@ require "olag/gem_specification"
|
|
4
4
|
require "olag/update_version"
|
5
5
|
require "olag/version"
|
6
6
|
require "rake/clean"
|
7
|
-
require "rake/gempackagetask"
|
8
|
-
require "rake/rdoctask"
|
9
7
|
require "rake/testtask"
|
10
8
|
require "rcov/rcovtask"
|
9
|
+
require "rdoc/task"
|
11
10
|
require "reek/rake/task"
|
12
11
|
require "roodi"
|
12
|
+
require "rubygems/package_task"
|
13
13
|
|
14
14
|
module Olag
|
15
15
|
|
16
16
|
# Automate Rake task creation for a gem.
|
17
17
|
class Rake
|
18
18
|
|
19
|
+
include ::Rake::DSL
|
20
|
+
|
19
21
|
# Define all the Rake tasks.
|
20
22
|
def initialize(spec)
|
21
23
|
@spec = spec
|
@@ -34,12 +36,12 @@ module Olag
|
|
34
36
|
define_verify_task
|
35
37
|
define_doc_task
|
36
38
|
define_commit_task
|
37
|
-
# This is a problem. If the version number gets updated,
|
39
|
+
# This is a problem. If the version number gets updated, Gem::PackageTask
|
38
40
|
# fails. This is better than if it used the old version number, I
|
39
41
|
# suppose, but not as nice as if it just used @spec.version everywhere.
|
40
42
|
# The solution for this is to do a dry run before doing the final +rake+
|
41
43
|
# +commit+, which is a good idea in general.
|
42
|
-
::
|
44
|
+
Gem::PackageTask.new(@spec) { |package| }
|
43
45
|
end
|
44
46
|
|
45
47
|
# {{{ Verify gem functionality
|
@@ -12,8 +12,8 @@ module Test
|
|
12
12
|
file = Tempfile.open(path, directory)
|
13
13
|
file.write(content)
|
14
14
|
file.close(false)
|
15
|
-
(@tempfiles ||= []) <<
|
16
|
-
return path
|
15
|
+
(@tempfiles ||= []) << file
|
16
|
+
return file.path
|
17
17
|
end
|
18
18
|
|
19
19
|
# Create a temporary directory on the disk. The directory will be
|
@@ -21,8 +21,8 @@ module Test
|
|
21
21
|
# complex file tests that can't use FakeFS.
|
22
22
|
def create_tempdir(directory = ".")
|
23
23
|
file = Tempfile.open("dir", directory)
|
24
|
-
(@tempfiles ||= []) <<
|
25
|
-
File.delete(path)
|
24
|
+
(@tempfiles ||= []) << file
|
25
|
+
File.delete(path = file.path)
|
26
26
|
Dir.mkdir(path)
|
27
27
|
return path
|
28
28
|
end
|
@@ -38,7 +38,8 @@ module Test
|
|
38
38
|
def teardown
|
39
39
|
tempfile_original_teardown
|
40
40
|
(@tempfiles || []).each do |tempfile|
|
41
|
-
|
41
|
+
path = tempfile.path
|
42
|
+
FileUtils.rm_rf(path) if File.exist?(path)
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
data/lib/olag/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: olag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 22
|
10
|
+
version: 0.1.22
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Oren Ben-Kiki
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-03-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: Saikuro
|
@@ -205,7 +205,7 @@ licenses: []
|
|
205
205
|
post_install_message:
|
206
206
|
rdoc_options:
|
207
207
|
- --title
|
208
|
-
- Olag 0.1.
|
208
|
+
- Olag 0.1.22
|
209
209
|
- --main
|
210
210
|
- README.rdoc
|
211
211
|
- --line-numbers
|