mascut 0.0.1 → 0.0.2

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/.document CHANGED
@@ -3,3 +3,4 @@ lib/**/*.rb
3
3
  bin/*
4
4
  features/**/*.feature
5
5
  LICENSE
6
+ HISTORY.rdoc
data/.gitignore CHANGED
@@ -15,7 +15,7 @@ tmtags
15
15
 
16
16
  ## PROJECT::GENERAL
17
17
  coverage
18
- rdoc
18
+ doc
19
19
  pkg
20
20
  *.gemspec
21
21
 
@@ -0,0 +1,5 @@
1
+ = 0.0.2 (2009-12-18)
2
+ * add cache-control
3
+
4
+ = 0.0.1 (2009-12-03)
5
+ * 1st release
@@ -1,6 +1,23 @@
1
1
  = mascut
2
2
 
3
- instant commet-like server in order to debug web pages
3
+ instant comet-like server in order to debug web pages
4
+
5
+ == Feature
6
+
7
+ * Auto script insertion to the header of your html which enables comet
8
+
9
+ == Usage
10
+
11
+ Example:
12
+ |
13
+ |- working_html.html
14
+ |- stylesheet.css
15
+
16
+ Simply execute this command at the top of your working directory
17
+ % mascut
18
+
19
+ Accessing <http://localhost:9203/working_html.html> with your browser, you can see it works as comet.
20
+ When you edit your working stuffs, your browser will automatically be reloaded!!
4
21
 
5
22
  == Copyright
6
23
 
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = 'mascut'
8
- gem.summary = 'instant commet-like server in order to debug web pages'
9
- gem.description = 'instant commet-like server in order to debug web pages'
8
+ gem.summary = 'instant comet-like server in order to debug web pages'
9
+ gem.description = 'instant comet-like server in order to debug web pages'
10
10
  gem.email = 'okitakunio@gmail.com'
11
11
  gem.homepage = 'http://github.com/okitan/mascut'
12
12
  gem.authors = %w[ okitan ]
@@ -41,7 +41,7 @@ require 'rake/rdoctask'
41
41
  Rake::RDocTask.new do |rdoc|
42
42
  version = File.exist?('VERSION') ? File.read('VERSION') : ''
43
43
 
44
- rdoc.rdoc_dir = 'rdoc'
44
+ rdoc.rdoc_dir = 'doc'
45
45
  rdoc.title = "mascut #{version}"
46
46
  rdoc.rdoc_files.include('README*')
47
47
  rdoc.rdoc_files.include('lib/**/*.rb')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -1,19 +1,19 @@
1
1
  require 'sinatra/base'
2
2
 
3
3
  class Mascut < Sinatra::Base
4
- def monitor
4
+ get '/mascut' do
5
+ headers 'Cache-Control' => 'no-cache', 'Pragma' => 'no-cache'
6
+
5
7
  now = Time.now
6
8
  files = Dir['**/*']
7
-
8
- loop do
9
- files.each {|file| return 'reload' if File.exist?(file) and now < File.mtime(file) }
10
- sleep 1
9
+
10
+ catch :reload do
11
+ loop do
12
+ files.each {|file| throw(:reload, 'reload') if File.exist?(file) and now < File.mtime(file) }
13
+ sleep 1
14
+ end
11
15
  end
12
16
  end
13
-
14
- get '/mascut' do
15
- monitor
16
- end
17
17
 
18
18
  get %r{^/(.+\.html)$} do |name|
19
19
  halt(404) unless File.exist?(name)
@@ -33,9 +33,7 @@ var comet = function() {
33
33
  }
34
34
 
35
35
  google.load('jquery', '1');
36
- google.setOnLoadCallback(function() {
37
- comet();
38
- });
36
+ google.setOnLoadCallback(comet);
39
37
  </script>
40
38
  </head>
41
39
  JS
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mascut
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - okitan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-03 00:00:00 +09:00
12
+ date: 2009-12-18 00:00:00 +09:00
13
13
  default_executable: mascut
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.2.9
34
34
  version:
35
- description: instant commet-like server in order to debug web pages
35
+ description: instant comet-like server in order to debug web pages
36
36
  email: okitakunio@gmail.com
37
37
  executables:
38
38
  - mascut
@@ -44,6 +44,7 @@ extra_rdoc_files:
44
44
  files:
45
45
  - .document
46
46
  - .gitignore
47
+ - HISTORY.rdoc
47
48
  - LICENSE
48
49
  - README.rdoc
49
50
  - Rakefile
@@ -80,7 +81,7 @@ rubyforge_project:
80
81
  rubygems_version: 1.3.5
81
82
  signing_key:
82
83
  specification_version: 3
83
- summary: instant commet-like server in order to debug web pages
84
+ summary: instant comet-like server in order to debug web pages
84
85
  test_files:
85
86
  - spec/spec_helper.rb
86
87
  - spec/mascut_spec.rb