makerakeworkwell 1.0.0
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.
- data.tar.gz.sig +1 -0
- data/.autotest +26 -0
- data/.gemtest +0 -0
- data/History.txt +6 -0
- data/Manifest.txt +7 -0
- data/README.txt +120 -0
- data/Rakefile +20 -0
- data/lib/make/rake/work/well.rb +45 -0
- data/test/test_makerakeworkwell.rb +8 -0
- metadata +159 -0
- metadata.gz.sig +1 -0
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
��n=f�OJ�>�&���݇5x��D$:��N/�1՛��9�a.}�dj��%g{n��]�����d�ix�q�����F=�%"D�����.�?��
|
data/.autotest
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "autotest/restart"
|
4
|
+
|
5
|
+
Autotest.add_hook :initialize do |at|
|
6
|
+
at.testlib = "minitest/autorun"
|
7
|
+
at.add_exception "tmp"
|
8
|
+
|
9
|
+
# at.extra_files << "../some/external/dependency.rb"
|
10
|
+
#
|
11
|
+
# at.libs << ":../some/external"
|
12
|
+
#
|
13
|
+
# at.add_exception "vendor"
|
14
|
+
#
|
15
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
16
|
+
# at.files_matching(/test_.*rb$/)
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# %w(TestA TestB).each do |klass|
|
20
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
21
|
+
# end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Autotest.add_hook :run_command do |at|
|
25
|
+
# system "rake build"
|
26
|
+
# end
|
data/.gemtest
ADDED
File without changes
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
= make
|
2
|
+
= rake
|
3
|
+
= work
|
4
|
+
= well
|
5
|
+
|
6
|
+
home :: https://github.com/seattlerb/makerakeworkwell
|
7
|
+
rdoc :: http://docs.seattlerb.org/makerakeworkwell
|
8
|
+
|
9
|
+
== DESCRIPTION:
|
10
|
+
|
11
|
+
make/rake/work/well provides two simple modifications to rake that
|
12
|
+
make working with file tasks cleaner, easier, and faster.
|
13
|
+
|
14
|
+
== Rationale:
|
15
|
+
|
16
|
+
=== FileTask
|
17
|
+
|
18
|
+
After extensive discussion with Jim, I believe we've agreed to
|
19
|
+
disagree on what rake is and how it should work. To Jim, rake is a
|
20
|
+
build tool (ie, a make replacement), plain and simple. I think it's
|
21
|
+
grown past that. To me, rake is a task execution engine with built in
|
22
|
+
dependency management and a whole lot of helpers to make writing said
|
23
|
+
tasks clean and easy. Whether there are files involved or not is less
|
24
|
+
of a concern in my mind, but when there are files involved, they often
|
25
|
+
seem to be problematic.
|
26
|
+
|
27
|
+
As such, make/rake/work/well patches rake to work with files in the
|
28
|
+
way that works best for my brain. Specifically, I think that every
|
29
|
+
file should map directly to their own dependencies and targets should
|
30
|
+
follow the entire tree of dependencies to see if they should rebuild
|
31
|
+
or not. For example:
|
32
|
+
|
33
|
+
target1 ---> source1 --+--> required1 ---> required2
|
34
|
+
|
|
35
|
+
target2 ---> source2 --+
|
36
|
+
|
37
|
+
If required2 changes, target1 and target2 should be rebuilt.
|
38
|
+
|
39
|
+
Jim would rather see the dependencies modeled in the old-school make
|
40
|
+
way:
|
41
|
+
|
42
|
+
target1 --+--> source1
|
43
|
+
|
|
44
|
+
+--> required1
|
45
|
+
|
|
46
|
+
+--> required2
|
47
|
+
|
48
|
+
target2 --+--> source2
|
49
|
+
|
|
50
|
+
+--> required1
|
51
|
+
|
|
52
|
+
+--> required2
|
53
|
+
|
54
|
+
This requires a manual expansion of the transitive closure of the
|
55
|
+
dependencies. This flattens everything, causes a lot of fan-out, and
|
56
|
+
makes it harder to see how things interrelate.
|
57
|
+
|
58
|
+
My patches to rake replace FileTask#needed? and FileTask#timestamp to
|
59
|
+
cause the scenario described above to work correctly. It uses caching
|
60
|
+
to prevent a lot of extra fstats from happening and winds up
|
61
|
+
performing at least fast as rake.
|
62
|
+
|
63
|
+
I've been using this for the last 6 months in zenweb for very large
|
64
|
+
dependency graphs and it has been working great for me.
|
65
|
+
|
66
|
+
=== Phony
|
67
|
+
|
68
|
+
It also defines a :phony task that you can use as a dependency. Rake
|
69
|
+
has very strange notions on how file and non-file based tasks should
|
70
|
+
interact. Specifically, file tasks use the timestamp of their
|
71
|
+
dependencies to determine whether they should build. Task defines its
|
72
|
+
timestamp to be the max its dependencies or Time.now if there are
|
73
|
+
none. That forces a file task depending on a non-file-task to always
|
74
|
+
build.
|
75
|
+
|
76
|
+
Depending on phony reverses this. This allows file-based tasks
|
77
|
+
to use non-file-based tasks as prerequisites without forcing them to
|
78
|
+
rebuild. For example:
|
79
|
+
|
80
|
+
task :isolate => :phony
|
81
|
+
|
82
|
+
file "lib/ruby18_parser.rb" => :isolate
|
83
|
+
file "lib/ruby19_parser.rb" => :isolate
|
84
|
+
|
85
|
+
I've been using this in ruby_parser for the last 6 months and it
|
86
|
+
cleaned up a bunch of confusion as to why my files kept rebuilding
|
87
|
+
over and over.
|
88
|
+
|
89
|
+
== REQUIREMENTS:
|
90
|
+
|
91
|
+
* rake
|
92
|
+
|
93
|
+
== INSTALL:
|
94
|
+
|
95
|
+
* sudo gem install makerakeworkwell
|
96
|
+
|
97
|
+
== LICENSE:
|
98
|
+
|
99
|
+
(The MIT License)
|
100
|
+
|
101
|
+
Copyright (c) Ryan Davis, seattle.rb
|
102
|
+
|
103
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
104
|
+
a copy of this software and associated documentation files (the
|
105
|
+
'Software'), to deal in the Software without restriction, including
|
106
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
107
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
108
|
+
permit persons to whom the Software is furnished to do so, subject to
|
109
|
+
the following conditions:
|
110
|
+
|
111
|
+
The above copyright notice and this permission notice shall be
|
112
|
+
included in all copies or substantial portions of the Software.
|
113
|
+
|
114
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
115
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
116
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
117
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
118
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
119
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
120
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "hoe"
|
5
|
+
|
6
|
+
Hoe.plugin :isolate
|
7
|
+
Hoe.plugin :seattlerb
|
8
|
+
|
9
|
+
Hoe.spec "makerakeworkwell" do
|
10
|
+
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
11
|
+
|
12
|
+
dependency "rake", "~> 0.9.2"
|
13
|
+
end
|
14
|
+
|
15
|
+
task :docs do
|
16
|
+
fonts = '"Courier New", Courier, monospace'
|
17
|
+
sh %(echo 'h1 { font-family: #{fonts}; }' >> doc/rdoc.css)
|
18
|
+
end
|
19
|
+
|
20
|
+
# vim: syntax=ruby
|
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
gem "rake", "~> 0.9.2"
|
3
|
+
|
4
|
+
require 'rake'
|
5
|
+
|
6
|
+
module MakeRakeWorkWell
|
7
|
+
VERSION = "1.0.0"
|
8
|
+
end
|
9
|
+
|
10
|
+
module Rake
|
11
|
+
class FileTask
|
12
|
+
alias old_needed? needed?
|
13
|
+
alias old_timestamp timestamp
|
14
|
+
|
15
|
+
def needed?
|
16
|
+
! File.exist?(name) || timestamp > real_timestamp
|
17
|
+
end
|
18
|
+
|
19
|
+
def real_timestamp
|
20
|
+
File.exist?(name) && File.mtime(name.to_s) || Rake::EARLY
|
21
|
+
end
|
22
|
+
|
23
|
+
def timestamp
|
24
|
+
@timestamp ||=
|
25
|
+
if File.exist?(name)
|
26
|
+
a = File.mtime(name.to_s)
|
27
|
+
b = super unless prerequisites.empty?
|
28
|
+
[a, b].compact.max
|
29
|
+
else
|
30
|
+
Rake::EARLY
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
##
|
37
|
+
# Defines a :phony task that you can use as a dependency. This allows
|
38
|
+
# file-based tasks to use non-file-based tasks as prerequisites
|
39
|
+
# without forcing them to rebuild.
|
40
|
+
#
|
41
|
+
# See FileTask#out_of_date? and Task#timestamp for more info.
|
42
|
+
|
43
|
+
def (Rake::Task.define_task(:phony)).timestamp
|
44
|
+
Time.at 0
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: makerakeworkwell
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Ryan Davis
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain:
|
17
|
+
- |
|
18
|
+
-----BEGIN CERTIFICATE-----
|
19
|
+
MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
20
|
+
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
21
|
+
GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
|
22
|
+
AwwKcnlhbm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05-25 00:00:00 Z
|
40
|
+
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
prerelease: false
|
44
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ~>
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
hash: 63
|
50
|
+
segments:
|
51
|
+
- 0
|
52
|
+
- 9
|
53
|
+
- 2
|
54
|
+
version: 0.9.2
|
55
|
+
type: :runtime
|
56
|
+
version_requirements: *id001
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: minitest
|
59
|
+
prerelease: false
|
60
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
hash: 7
|
66
|
+
segments:
|
67
|
+
- 3
|
68
|
+
- 0
|
69
|
+
version: "3.0"
|
70
|
+
type: :development
|
71
|
+
version_requirements: *id002
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: rdoc
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ~>
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
hash: 19
|
81
|
+
segments:
|
82
|
+
- 3
|
83
|
+
- 10
|
84
|
+
version: "3.10"
|
85
|
+
type: :development
|
86
|
+
version_requirements: *id003
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: hoe
|
89
|
+
prerelease: false
|
90
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ~>
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
hash: 7
|
96
|
+
segments:
|
97
|
+
- 3
|
98
|
+
- 0
|
99
|
+
version: "3.0"
|
100
|
+
type: :development
|
101
|
+
version_requirements: *id004
|
102
|
+
description: |-
|
103
|
+
make/rake/work/well provides two simple modifications to rake that
|
104
|
+
make working with file tasks cleaner, easier, and faster.
|
105
|
+
email:
|
106
|
+
- ryand-ruby@zenspider.com
|
107
|
+
executables: []
|
108
|
+
|
109
|
+
extensions: []
|
110
|
+
|
111
|
+
extra_rdoc_files:
|
112
|
+
- History.txt
|
113
|
+
- Manifest.txt
|
114
|
+
- README.txt
|
115
|
+
files:
|
116
|
+
- .autotest
|
117
|
+
- History.txt
|
118
|
+
- Manifest.txt
|
119
|
+
- README.txt
|
120
|
+
- Rakefile
|
121
|
+
- lib/make/rake/work/well.rb
|
122
|
+
- test/test_makerakeworkwell.rb
|
123
|
+
- .gemtest
|
124
|
+
homepage:
|
125
|
+
licenses: []
|
126
|
+
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options:
|
129
|
+
- --main
|
130
|
+
- README.txt
|
131
|
+
require_paths:
|
132
|
+
- lib
|
133
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
139
|
+
segments:
|
140
|
+
- 0
|
141
|
+
version: "0"
|
142
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
version: "0"
|
151
|
+
requirements: []
|
152
|
+
|
153
|
+
rubyforge_project: makerakeworkwell
|
154
|
+
rubygems_version: 1.8.17
|
155
|
+
signing_key:
|
156
|
+
specification_version: 3
|
157
|
+
summary: make/rake/work/well provides two simple modifications to rake that make working with file tasks cleaner, easier, and faster.
|
158
|
+
test_files:
|
159
|
+
- test/test_makerakeworkwell.rb
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
>�ᤱ�Y��,��JR���,5o�B!%��J<��X �N��Xf�-Fc�����c
|