rascut 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/rascut.rb +1 -1
- data/lib/rascut/command.rb +1 -1
- data/lib/rascut/config.rb +5 -1
- data/lib/rascut/file_observer.rb +16 -2
- data/lib/rascut/httpd.rb +12 -7
- metadata +2 -2
data/History.txt
CHANGED
data/lib/rascut.rb
CHANGED
data/lib/rascut/command.rb
CHANGED
data/lib/rascut/config.rb
CHANGED
@@ -53,6 +53,7 @@ module Rascut
|
|
53
53
|
@params[:observe_files] << '.'
|
54
54
|
end
|
55
55
|
|
56
|
+
op.on('-h', '--help', 'show this message') { puts op; Kernel::exit 1 }
|
56
57
|
op.on('-i=VAL', '--interval=VAL', 'interval time(min)') {|v| @params[:interval] = v.to_i }
|
57
58
|
op.on('-l=VAL', '--log=VAL', 'showing flashlog.txt') {|v| @params[:flashlog] = v }
|
58
59
|
op.on('-m=VAL', '--mapping=VAL', 'server mapping path :example) -m "../assets=assets" -m "../images/=img"') {|v|
|
@@ -70,7 +71,10 @@ module Rascut
|
|
70
71
|
}
|
71
72
|
op.on('-t=VAL', '--template=VAL', 'server use template file') {|v| @params[:template] = v }
|
72
73
|
op.on('-v', '--verbose', 'detail messages') {|v| @params[:logger].level = Logger::DEBUG }
|
73
|
-
op.on('--
|
74
|
+
op.on('--version', 'show version') {|v|
|
75
|
+
puts "rascut #{Rascut::VERSION}"
|
76
|
+
exit 0
|
77
|
+
}
|
74
78
|
op.parse! argv
|
75
79
|
@params[:logger].debug 'config' + @params.inspect
|
76
80
|
end
|
data/lib/rascut/file_observer.rb
CHANGED
@@ -13,6 +13,8 @@ module Rascut
|
|
13
13
|
:ext => nil
|
14
14
|
}
|
15
15
|
|
16
|
+
MSWIN32 = !!RUBY_PLATFORM.include?('mswin32')
|
17
|
+
|
16
18
|
def initialize(files, options)
|
17
19
|
@files = {}
|
18
20
|
@dirs = {}
|
@@ -112,7 +114,14 @@ module Rascut
|
|
112
114
|
def check_dirs
|
113
115
|
dfiles = []
|
114
116
|
@dirs.each do |dir, mtime|
|
115
|
-
|
117
|
+
begin
|
118
|
+
rp = dir.realpath.to_s
|
119
|
+
rescue Errno::EINVAL
|
120
|
+
rp = dir.realpath(false).to_s
|
121
|
+
rp.sub!(/^\//, '') if mswin32? # XXX for mswin32 ruby 1.8.4
|
122
|
+
end
|
123
|
+
|
124
|
+
next if @options[:ignore_dirs].include?(rp)
|
116
125
|
|
117
126
|
if !dir.directory?
|
118
127
|
@dirs.delete dir
|
@@ -152,9 +161,14 @@ module Rascut
|
|
152
161
|
Find::find(dir.to_s) do |file|
|
153
162
|
if File.directory?(file)
|
154
163
|
dir = Pathname.new(file)
|
155
|
-
|
164
|
+
#@dirs[dir] ||= dir.mtie
|
165
|
+
@dirs[dir] ||= Time.at(0) # XXX for win32 ruby(filesystem?)?
|
156
166
|
end
|
157
167
|
end
|
158
168
|
end
|
169
|
+
|
170
|
+
def mswin32?
|
171
|
+
MSWIN32
|
172
|
+
end
|
159
173
|
end
|
160
174
|
end
|
data/lib/rascut/httpd.rb
CHANGED
@@ -206,10 +206,10 @@ module Rascut
|
|
206
206
|
end
|
207
207
|
|
208
208
|
def bg_parse(opt)
|
209
|
-
if m = opt.to_s.match(/-default-background-color=0x([a-fA-F0-9]{3,6})/)
|
209
|
+
if m = opt.to_s.match(/-default-background-color=(?:(?:0x)|#)([a-fA-F0-9]{3,6})/)
|
210
210
|
'#' + m[1]
|
211
211
|
else
|
212
|
-
'
|
212
|
+
''
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
@@ -246,14 +246,15 @@ module Rascut
|
|
246
246
|
<!--__RELOAD__-->
|
247
247
|
</head>
|
248
248
|
<body>
|
249
|
-
<div id="content">
|
250
|
-
</div>
|
249
|
+
<div id="content"></div>
|
251
250
|
|
252
251
|
<script type="text/javascript">
|
253
252
|
var so = __SWFOBJECT__;
|
254
|
-
|
255
|
-
|
256
|
-
|
253
|
+
window.onload = function() {
|
254
|
+
__SWF_VARS__
|
255
|
+
so.addVariable('rascut', 'true');
|
256
|
+
so.write("content");
|
257
|
+
}
|
257
258
|
</script>
|
258
259
|
</body>
|
259
260
|
</html>
|
@@ -297,6 +298,10 @@ module Rascut
|
|
297
298
|
x.send(null);
|
298
299
|
}
|
299
300
|
|
301
|
+
Rascut.swf = function() {
|
302
|
+
return document.getElementById('idswf');
|
303
|
+
}
|
304
|
+
|
300
305
|
Rascut.reloadObserver();
|
301
306
|
</script>
|
302
307
|
EOF
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.1
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rascut
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date: 2007-09-
|
6
|
+
version: 0.1.2
|
7
|
+
date: 2007-09-29 00:00:00 +09:00
|
8
8
|
summary: Ruby ActionSCript UTility
|
9
9
|
require_paths:
|
10
10
|
- lib
|