autoreload 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/MANIFEST DELETED
@@ -1,14 +0,0 @@
1
- #!mast .ruby .yardopts bin lib spec try [A-Z][A-Z]*
2
- .ruby
3
- .yardopts
4
- lib/autoreload/reloader.rb
5
- lib/autoreload/version.rb
6
- lib/autoreload.rb
7
- spec/autoreload_spec.rb
8
- try/changeme.rb
9
- try/start.rb
10
- HISTORY.rdoc
11
- PROFILE
12
- README.rdoc
13
- VERSION
14
- COPYING.rdoc
data/PROFILE DELETED
@@ -1,28 +0,0 @@
1
- ---
2
- title : AutoReload
3
- summary: Automatically reload library files
4
-
5
- requirements:
6
- - detroit (build)
7
- - minitest (test)
8
-
9
- authors:
10
- - Thomas Sawyer <transfire@gmail.com>
11
- - Kouichirou Eto
12
-
13
- description:
14
- Autoreload automatically reloads library files when they have been
15
- updated. It is especially useful when testing stateless services
16
- such as web applications.
17
-
18
- resources:
19
- home: http://rubyworks.github.com/autoreload
20
- code: http://github.com/rubyworks/autoreload
21
- gem: http://rubygems.org/gems/autoreload
22
-
23
- created: 2007-07-01
24
-
25
- copyrights:
26
- - 2010 Thomas Sawyer (BSD-2)
27
- - 2003 Kouichiro Eto (RUBY)
28
-
@@ -1,61 +0,0 @@
1
- = AutoReload
2
-
3
-
4
- == Description
5
-
6
- Autoreload automatically reloads library files after they
7
- have been updated. It is especailly useful when testing
8
- stateless services such as web applications.
9
-
10
- IMPORTANT! Version 1.0+ has a new API. It also works best
11
- under Ruby 1.9 or above. Under Ruby 1.8 or older files are
12
- reloaded regardless of whether they actually have changed
13
- since the last load. Whereas in Ruby 1.9+, they only reload
14
- if the mtime on the file is newer than the previous time.
15
-
16
-
17
- == Resources
18
-
19
- * {Homepage}[http://rubyworks.github.com/autoreload]
20
- * {Source Code}[http://github.com/rubyworks/autoreload]
21
-
22
-
23
- == Synopsis
24
-
25
- Say we have a library <tt>foo.rb</tt> in our load path:
26
-
27
- def foo
28
- 1
29
- end
30
-
31
- We can then run the following script, <tt>example.rb</tt>:
32
-
33
- require 'autoreload'
34
-
35
- autoreload(:interval=>2, :verbose=>true) do
36
- require 'foo.rb'
37
- end
38
-
39
- loop {
40
- puts foo
41
- sleep 2
42
- }
43
-
44
- With that running we can change <tt>foo.rb</tt> and the change
45
- will take effect in <tt>example.rb</tt> within two seconds of
46
- being made.
47
-
48
- Note, that autoreload only works with _required_ files. It cannot
49
- monitor files that are broght in with _load_. This is because
50
- $LOADED_FEATURES is used to track which files are monitored.
51
-
52
-
53
- == Copyrights
54
-
55
- Copyright (c) 2003,2007 Kouichirou Eto
56
-
57
- Copyright (c) 2010 Thomas Sawyer
58
-
59
- BSD 2-Clause License
60
-
61
- See COPYING.rdoc for more information.
data/Rakefile DELETED
@@ -1,9 +0,0 @@
1
- require 'rake/testtask'
2
-
3
- Rake::TestTask.new do |t|
4
- t.libs << "lib"
5
- t.libs << "tmp"
6
- t.test_files = FileList['spec/*_spec.rb']
7
- t.verbose = false
8
- end
9
-
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.0
@@ -1,143 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'yaml'
4
-
5
- Gem::Specification.new do |gemspec|
6
-
7
- manifest = Dir.glob('manifest{,.txt)', File::FNM_CASEFOLD).first
8
-
9
- scm = case
10
- when File.directory?('.git')
11
- :git
12
- end
13
-
14
- files = case
15
- when manifest
16
- File.readlines(manifest).
17
- map{ |line| line.srtip }.
18
- reject{ |line| line.empty? || line[0,1] == '#' }
19
- when scm == :git
20
- `git ls-files -z`.split("\0")
21
- else
22
- Dir.glob('{**/}{.*,*}') # TODO: be more specific using standard locations ?
23
- end.select{ |path| File.file?(path) }
24
-
25
- patterns = {
26
- :bin_files => 'bin/*',
27
- :lib_files => 'lib/{**/}*.rb',
28
- :ext_files => 'ext/{**/}extconf.rb',
29
- :doc_files => '*.{txt,rdoc,md,markdown,tt,textile}',
30
- :test_files => '{test/{**/}*_test.rb,spec/{**/}*_spec.rb}'
31
- }
32
-
33
- glob_files = lambda { |pattern|
34
- Dir.glob(pattern).select { |path|
35
- File.file?(path) && files.include?(path)
36
- }
37
- }
38
-
39
- #files = glob_files[patterns[:files]]
40
-
41
- executables = glob_files[patterns[:bin_files]].map do |path|
42
- File.basename(path)
43
- end
44
-
45
- extensions = glob_files[patterns[:ext_files]].map do |path|
46
- File.basename(path)
47
- end
48
-
49
- metadata = YAML.load_file('.ruby')
50
-
51
- # build-out the gemspec
52
-
53
- case metadata['revision']
54
- when 0
55
- gemspec.name = metadata['name']
56
- gemspec.version = metadata['version']
57
- gemspec.summary = metadata['summary']
58
- gemspec.description = metadata['description']
59
-
60
- metadata['authors'].each do |author|
61
- gemspec.authors << author['name']
62
-
63
- if author.has_key?('email')
64
- if gemspec.email
65
- gemspec.email << author['email']
66
- else
67
- gemspec.email = [author['email']]
68
- end
69
- end
70
- end
71
-
72
- gemspec.licenses = metadata['licenses']
73
-
74
- metadata['requirements'].each do |req|
75
- name = req['name']
76
- version = req['version']
77
- groups = req['groups']
78
-
79
- #development = req['development']
80
- #if development
81
- # # populate development dependencies
82
- # if gemspec.respond_to?(:add_development_dependency)
83
- # gemspec.add_development_dependency(name,*version)
84
- # else
85
- # gemspec.add_dependency(name,*version)
86
- # end
87
- #else
88
- # # populate runtime dependencies
89
- # if gemspec.respond_to?(:add_runtime_dependency)
90
- # gemspec.add_runtime_dependency(name,*version)
91
- # else
92
- # gemspec.add_dependency(name,*version)
93
- # end
94
- #end
95
-
96
- if groups.empty? or groups.include?('runtime')
97
- # populate runtime dependencies
98
- if gemspec.respond_to?(:add_runtime_dependency)
99
- gemspec.add_runtime_dependency(name,*version)
100
- else
101
- gemspec.add_dependency(name,*version)
102
- end
103
- else
104
- # populate development dependencies
105
- if gemspec.respond_to?(:add_development_dependency)
106
- gemspec.add_development_dependency(name,*version)
107
- else
108
- gemspec.add_dependency(name,*version)
109
- end
110
- end
111
- end
112
-
113
- # convert external dependencies into a requirements
114
- if metadata['external_dependencies']
115
- ##gemspec.requirements = [] unless metadata['external_dependencies'].empty?
116
- metadata['external_dependencies'].each do |req|
117
- gemspec.requirements << req.to_s
118
- end
119
- end
120
-
121
- # determine homepage from resources
122
- homepage = metadata['resources'].find{ |key, url| key =~ /^home/ }
123
- gemspec.homepage = homepage.last if homepage
124
-
125
- gemspec.require_paths = metadata['load_path'] || ['lib']
126
- gemspec.post_install_message = metadata['install_message']
127
-
128
- # RubyGems specific metadata
129
- gemspec.files = files
130
- gemspec.extensions = extensions
131
- gemspec.executables = executables
132
-
133
- if Gem::VERSION < '1.7.'
134
- gemspec.default_executable = gemspec.executables.first
135
- end
136
-
137
- gemspec.test_files = glob_files[patterns[:test_files]]
138
-
139
- unless gemspec.files.include?('.document')
140
- gemspec.extra_rdoc_files = glob_files[patterns[:doc_files]]
141
- end
142
- end
143
- end
Binary file
@@ -1,149 +0,0 @@
1
- body {
2
- background-color: #E1D1F1;
3
- font-family: "Georgia", sans-serif;
4
- font-size: 16px;
5
- line-height: 1.6em;
6
- padding: 1.6em 0 0 0;
7
- color: #333;
8
- }
9
- h1, h2, h3, h4, h5, h6 {
10
- color: #444;
11
- }
12
- h1 {
13
- font-family: sans-serif;
14
- font-weight: normal;
15
- font-size: 3.7em;
16
- line-height: 0.8em;
17
- letter-spacing: -0.1ex;
18
- margin: 0 5px 0 0;
19
- padding: 10px 0 20px 0;
20
- }
21
- h2 {
22
- margin-top: 40px;
23
- }
24
- pre {
25
- border-radius: 8px;
26
- }
27
- li {
28
- padding: 0;
29
- margin: 0;
30
- list-style-type: square;
31
- }
32
- a {
33
- color: #5E5AFF;
34
- background-color: #DAC;
35
- font-weight: normal;
36
- text-decoration: underline;
37
- }
38
- blockquote {
39
- font-size: 90%;
40
- font-style: italic;
41
- border-left: 1px solid #111;
42
- padding-left: 1em;
43
- }
44
- .caps {
45
- font-size: 80%;
46
- }
47
-
48
- #main {
49
- width: 45em;
50
- padding: 0;
51
- margin: 0 auto;
52
- }
53
-
54
- .coda {
55
- text-align: right;
56
- color: #77f;
57
- font-size: smaller;
58
- }
59
-
60
- h1.title { font-weight: bold; font-size: 4em; }
61
-
62
- table {
63
- font-size: 90%;
64
- line-height: 1.4em;
65
- color: #ff8;
66
- background-color: #111;
67
- padding: 2px 10px 2px 10px;
68
- border-style: dashed;
69
- }
70
-
71
- th {
72
- color: #fff;
73
- }
74
-
75
- td {
76
- padding: 2px 10px 2px 10px;
77
- }
78
-
79
- .success {
80
- color: #0CC52B;
81
- }
82
-
83
- .failed {
84
- color: #E90A1B;
85
- }
86
-
87
- .unknown {
88
- color: #995000;
89
- }
90
- pre, code {
91
- font-family: monospace;
92
- font-size: 90%;
93
- line-height: 1.4em;
94
- color: #ff8;
95
- background-color: #111;
96
- padding: 5px 10px 5px 10px;
97
- }
98
- .comment { color: #aaa; font-style: italic; }
99
- .keyword { color: #eff; font-weight: bold; }
100
- .punct { color: #eee; font-weight: bold; }
101
- .symbol { color: #0bb; }
102
- .string { color: #6b4; }
103
- .ident { color: #ff8; }
104
- .constant { color: #66f; }
105
- .regex { color: #ec6; }
106
- .number { color: #F99; }
107
- .expr { color: #227; }
108
-
109
- #version {
110
- float: right;
111
- text-align: right;
112
- font-family: sans-serif;
113
- font-weight: normal;
114
- background-color: #B3ABFF;
115
- color: #141331;
116
- padding: 15px 20px 10px 20px;
117
- margin: 0 auto;
118
- margin-top: 15px;
119
- border: 3px solid #141331;
120
- border-radius: 12px;
121
- }
122
-
123
- #version .numbers {
124
- display: block;
125
- font-size: 4em;
126
- line-height: 0.8em;
127
- letter-spacing: -0.1ex;
128
- margin-bottom: 15px;
129
- }
130
-
131
- #version p {
132
- text-decoration: none;
133
- color: #141331;
134
- background-color: #B3ABFF;
135
- margin: 0;
136
- padding: 0;
137
- }
138
-
139
- #version a {
140
- text-decoration: none;
141
- color: #141331;
142
- background-color: #B3ABFF;
143
- }
144
-
145
- .clickable {
146
- cursor: pointer;
147
- cursor: hand;
148
- }
149
-
@@ -1,135 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
- <head>
4
- <link rel="icon" type="image/png" href="assets/icon.png" />
5
- <link rel="stylesheet" href="assets/screen.css" type="text/css" media="screen" />
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
- <title>AutoReload</title>
8
- <style>
9
- #rubyworks{ position: fixed; bottom: 0; right: 3px; padding: 0; opacity: 0.2; }
10
- </style>
11
- <script type="text/javascript">
12
- window.onload = function() {
13
- settings = {
14
- tl: { radius: 10 },
15
- tr: { radius: 10 },
16
- bl: { radius: 10 },
17
- br: { radius: 10 },
18
- antiAlias: true,
19
- autoPad: true,
20
- validTags: ["div"]
21
- }
22
- var versionBox = new curvyCorners(settings, document.getElementById("version"));
23
- versionBox.applyCornersToAll();
24
- }
25
- </script>
26
- </head>
27
- <body>
28
-
29
- <div id="main">
30
- <h1 class="title">AutoReload</h1>
31
- <div id="version" class="clickable" onclick='document.location = "http://rubygems.org/gems/autoreload"; return false'>
32
- <p>Get Version</p>
33
- <a href="http://rubygems.org/gems/autoreload" class="numbers">1.0.0</a>
34
- </div>
35
- <h1>you don't have to restart your program</h1>
36
-
37
- <h2>What Is It?</h2>
38
-
39
- <p>Autoreload reloads libraries automatically at regular intervals
40
- when files are updated.</p>
41
-
42
- <h2>Installing</h2>
43
-
44
- <pre syntax="ruby">$ gem install autoreload</pre>
45
-
46
-
47
- <h2>The Basics</h2>
48
-
49
-
50
- <pre class="ruby">
51
- # foo.rb
52
- def foo
53
- 1
54
- end
55
- </pre>
56
-
57
- <pre class="ruby">
58
- # sample1.rb
59
- require 'autoreload'
60
-
61
- autoreload(:interval=>1, :verbose=>true) do
62
- require 'foo'
63
- end
64
-
65
- loop {
66
- puts foo
67
- sleep 1
68
- }
69
- </pre>
70
-
71
-
72
- <p>In this situation, run the script <code>sample1.rb</code>. You see that the
73
- number 1 is shown repeatedly. Then, while that is still running,
74
- update the file <code>foo.rb</code>. For example, change the number 1 to 2
75
- and save it. Then, the library automatically check the update
76
- and reload it. You'll see the number 2 is shown.</p>
77
-
78
- <h2>Documentation</h2>
79
-
80
- <ul>
81
- <li><a href="http://rubydoc.info/gems/autoreload/frames">RubyDoc.info</a></li>
82
- </ul>
83
-
84
-
85
- <h2>Repository</h2>
86
-
87
- <p>This project is hosted on <a href="http://rubyworks.github.com/autoreload">GitHub.com</a>.</p>
88
-
89
- <p>The repository is <code>git://github.com/rubyworks/autoreload.git</code>
90
- for anonymous access.</p>
91
-
92
- <h2>Copying</h2>
93
-
94
- <p>(FreeBSD License)</p>
95
-
96
- <p>Copyright (c) 2010 Thomas Sawyer</p>
97
-
98
- <p>Copyright (c) 2003 Kouichirou Eto</p>
99
-
100
- <h2>Contact</h2>
101
-
102
- <p>Comments are welcome. Send an email to Trans "transfire <em>at</em> gmail <em>dot</em> org".</p>
103
-
104
- <p>Autoreload is a <a href="http://rubyworks.github.com">RubyWorks</a> project.</p>
105
-
106
- <p class="coda">
107
- <a href="mailto:transfire@gmail.com">Trans</a>, 2011-07-15<br>
108
- Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
109
- </p>
110
- </div>
111
-
112
- <div style="margin: 40px auto; width: 730px;">
113
- <script type="text/javascript"><!--
114
- google_ad_client = "ca-pub-1126154564663472";
115
- /* RUBYWORKS 09-10-02 728x90 */
116
- google_ad_slot = "0788888658";
117
- google_ad_width = 728;
118
- google_ad_height = 90;
119
- //-->
120
- </script>
121
- <script type="text/javascript"
122
- src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
123
- </script>
124
- </div>
125
-
126
- <!-- insert site tracking codes here, like Google Urchin -->
127
-
128
- <div id="rubyworks">
129
- <a href="http://rubyworks.github.com">
130
- <img src="http://rubyworks.github.com/assets/images/seal.png" height="175px" />
131
- </a>
132
- </div>
133
-
134
- </body>
135
- </html>