redisk 0.1.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.
@@ -0,0 +1,36 @@
1
+ # Redisk::Log is a wrapper around logger, that uses Redisk::IO internally and provides some extra options
2
+ module Redisk
3
+ class Logger
4
+ extend Helper
5
+ include Helper
6
+
7
+ attr_reader :name, :logger, :io
8
+
9
+ def initialize(name, options = {})
10
+ @name = name
11
+ @io = Redisk::IO.new(name)
12
+ @truncate = options.delete(:truncate) || false
13
+ @logger = ::Logger.new(@io, options)
14
+ end
15
+
16
+ def length
17
+ @io.length
18
+ end
19
+
20
+ def truncate!
21
+ @io.truncate(@truncate) if @truncate && length > @truncate
22
+ end
23
+
24
+ # delegate to logger
25
+ def method_missing(meth, *args)
26
+ if @logger.respond_to?(meth)
27
+ returned = @logger.send(meth, *args)
28
+ truncate!
29
+ returned
30
+ else
31
+ super
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,382 @@
1
+ # Redisk::Stat mimics File::Stat
2
+ # mostly accessed through Redisk::IO#stat
3
+ require 'time'
4
+
5
+ module Redisk
6
+ class Stat
7
+ extend Helper
8
+ include Helper
9
+ include Comparable
10
+
11
+ attr_reader :name
12
+
13
+ def initialize(name)
14
+ @name = name
15
+ write_default('atime', Time.now)
16
+ write_default('ctime', Time.now)
17
+ write_default('mtime', Time.now)
18
+ write_default('size', 0)
19
+ end
20
+
21
+ # stat <=> other_stat => -1, 0, 1
22
+ # Compares File::Stat objects by comparing their respective modification times.
23
+ #
24
+ # f1 = File.new("f1", "w")
25
+ # sleep 1
26
+ # f2 = File.new("f2", "w")
27
+ # f1.stat <=> f2.stat #=> -1
28
+ def <=>(other_stat)
29
+ self.mtime <=> other_stat.mtime
30
+ end
31
+
32
+ # stat.atime => time
33
+ # Returns the last access time for this file as an object of class Time.
34
+ #
35
+ # File.stat("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969
36
+ def atime
37
+ Time.parse(read_attribute('atime'))
38
+ end
39
+
40
+ # stat.blksize => integer or nil
41
+ # Returns the native file system‘s block size. Will return nil on platforms that don‘t support this information.
42
+ #
43
+ # File.stat("testfile").blksize #=> 4096
44
+ def blksize
45
+ 0
46
+ end
47
+
48
+ # stat.blockdev? => true or false
49
+ # Returns true if the file is a block device, false if it isn‘t or if the operating system doesn‘t support this feature.
50
+ #
51
+ # File.stat("testfile").blockdev? #=> false
52
+ # File.stat("/dev/hda1").blockdev? #=> true
53
+ def blockdev?
54
+ false
55
+ end
56
+
57
+ # stat.blocks => integer or nil
58
+ # Returns the number of native file system blocks allocated for this file, or nil if the operating system doesn‘t support this feature.
59
+ #
60
+ # File.stat("testfile").blocks #=> 2
61
+ def blocks
62
+ 0
63
+ end
64
+
65
+ # stat.chardev? => true or false
66
+ # Returns true if the file is a character device, false if it isn‘t or if the operating system doesn‘t support this feature.
67
+ #
68
+ # File.stat("/dev/tty").chardev? #=> true
69
+ def chardev?
70
+ false
71
+ end
72
+
73
+ # stat.ctime → aTime
74
+ # Returns the change time for stat (that is, the time directory information about the file was changed, not the file itself).
75
+ #
76
+ # File.stat("testfile").ctime #=> Wed Apr 09 08:53:14 CDT 2003
77
+ def ctime
78
+ Time.parse(read_attribute('ctime'))
79
+ end
80
+
81
+ # stat.dev => fixnum
82
+ # Returns an integer representing the device on which stat resides.
83
+ #
84
+ # File.stat("testfile").dev #=> 774
85
+ def dev
86
+ nil
87
+ end
88
+
89
+ # stat.dev_major => fixnum
90
+ # Returns the major part of File_Stat#dev or nil.
91
+ #
92
+ # File.stat("/dev/fd1").dev_major #=> 2
93
+ # File.stat("/dev/tty").dev_major #=> 5
94
+ def dev_major
95
+ 0
96
+ end
97
+
98
+ # stat.dev_minor => fixnum
99
+ # Returns the minor part of File_Stat#dev or nil.
100
+ #
101
+ # File.stat("/dev/fd1").dev_minor #=> 1
102
+ # File.stat("/dev/tty").dev_minor #=> 0
103
+ def dev_minor
104
+ 0
105
+ end
106
+
107
+ # stat.directory? => true or false
108
+ # Returns true if stat is a directory, false otherwise.
109
+ #
110
+ # File.stat("testfile").directory? #=> false
111
+ # File.stat(".").directory? #=> true
112
+ def directory?
113
+ false
114
+ end
115
+
116
+ # stat.executable? => true or false
117
+ # Returns true if stat is executable or if the operating system doesn‘t distinguish executable files from nonexecutable files. The tests are made using the effective owner of the process.
118
+ #
119
+ # File.stat("testfile").executable? #=> false
120
+ def executable?
121
+ false
122
+ end
123
+
124
+ # stat.executable_real? => true or false
125
+ # Same as executable?, but tests using the real owner of the process.
126
+ def executable_real?
127
+ false
128
+ end
129
+
130
+ # stat.file? => true or false
131
+ # Returns true if stat is a regular file (not a device file, pipe, socket, etc.).
132
+ #
133
+ # File.stat("testfile").file? #=> true
134
+ def file?
135
+ false
136
+ end
137
+
138
+ # stat.ftype => string
139
+ # Identifies the type of stat. The return string is one of: ``file’’, ``directory’’, ``characterSpecial’’, ``blockSpecial’’, ``fifo’’, ``link’’, ``socket’’, or ``unknown’’.
140
+ #
141
+ # File.stat("/dev/tty").ftype #=> "characterSpecial"
142
+ def ftype
143
+ 'unknown'
144
+ end
145
+
146
+ # stat.gid => fixnum
147
+ # Returns the numeric group id of the owner of stat.
148
+ #
149
+ # File.stat("testfile").gid #=> 500
150
+ def gid
151
+ Process.gid
152
+ end
153
+
154
+ # stat.grpowned? => true or false
155
+ # Returns true if the effective group id of the process is the same as the group id of stat. On Windows NT, returns false.
156
+ #
157
+ # File.stat("testfile").grpowned? #=> true
158
+ # File.stat("/etc/passwd").grpowned? #=> false
159
+ def grpowned?
160
+ Process.grpowned?
161
+ end
162
+
163
+ # stat.ino => fixnum
164
+ # Returns the inode number for stat.
165
+ #
166
+ # File.stat("testfile").ino #=> 1083669
167
+ def ino
168
+ Process.ino
169
+ end
170
+
171
+ # stat.inspect => string
172
+ # Produce a nicely formatted description of stat.
173
+ #
174
+ # File.stat("/etc/passwd").inspect
175
+ # #=> "#<File::Stat dev=0xe000005, ino=1078078, mode=0100644,
176
+ # nlink=1, uid=0, gid=0, rdev=0x0, size=1374, blksize=4096,
177
+ # blocks=8, atime=Wed Dec 10 10:16:12 CST 2003,
178
+ # mtime=Fri Sep 12 15:41:41 CDT 2003,
179
+ # ctime=Mon Oct 27 11:20:27 CST 2003>"
180
+ def inspect
181
+ "#<Redis::Stat (#{name}) atime=#{atime}, ctime=#{ctime}, mtime=#{mtime}, size=#{size}"
182
+ end
183
+ alias :to_s :inspect
184
+
185
+ # stat.mode => fixnum
186
+ # Returns an integer representing the permission bits of stat. The meaning of the bits is platform dependent; on Unix systems, see stat(2).
187
+ #
188
+ # File.chmod(0644, "testfile") #=> 1
189
+ # s = File.stat("testfile")
190
+ # sprintf("%o", s.mode) #=> "100644"
191
+ def mode
192
+ Process.mode
193
+ end
194
+
195
+ # stat.mtime → aTime
196
+ # Returns the modification time of stat.
197
+ #
198
+ # File.stat("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003
199
+ def mtime
200
+ Time.parse(read_attribute('mtime'))
201
+ end
202
+
203
+ # stat.nlink => fixnum
204
+ # Returns the number of hard links to stat.
205
+ #
206
+ # File.stat("testfile").nlink #=> 1
207
+ # File.link("testfile", "testfile.bak") #=> 0
208
+ # File.stat("testfile").nlink #=> 2
209
+ def nlink
210
+ 0
211
+ end
212
+
213
+ # stat.owned? => true or false
214
+ # Returns true if the effective user id of the process is the same as the owner of stat.
215
+ #
216
+ # File.stat("testfile").owned? #=> true
217
+ # File.stat("/etc/passwd").owned? #=> false
218
+ def owned?
219
+ true
220
+ end
221
+
222
+ # stat.pipe? => true or false
223
+ # Returns true if the operating system supports pipes and stat is a pipe; false otherwise.
224
+ def pipe
225
+ false
226
+ end
227
+
228
+ # stat.rdev => fixnum or nil
229
+ # Returns an integer representing the device type on which stat resides. Returns nil if the operating system doesn‘t support this feature.
230
+ #
231
+ # File.stat("/dev/fd1").rdev #=> 513
232
+ # File.stat("/dev/tty").rdev #=> 1280
233
+ def rdev
234
+ 0
235
+ end
236
+
237
+ # stat.rdev_major => fixnum
238
+ # Returns the major part of File_Stat#rdev or nil.
239
+ #
240
+ # File.stat("/dev/fd1").rdev_major #=> 2
241
+ # File.stat("/dev/tty").rdev_major #=> 5
242
+ def rdev_major
243
+ 0
244
+ end
245
+
246
+ # stat.rdev_minor => fixnum
247
+ # Returns the minor part of File_Stat#rdev or nil.
248
+ #
249
+ # File.stat("/dev/fd1").rdev_minor #=> 1
250
+ # File.stat("/dev/tty").rdev_minor #=> 0
251
+ def rdev_minor
252
+ 0
253
+ end
254
+
255
+ # stat.readable? => true or false
256
+ # Returns true if stat is readable by the effective user id of this process.
257
+ #
258
+ # File.stat("testfile").readable? #=> true
259
+ def readable?
260
+ true
261
+ end
262
+
263
+ # stat.readable_real? → true or false
264
+ # Returns true if stat is readable by the real user id of this process.
265
+ #
266
+ # File.stat("testfile").readable_real? #=> true
267
+ def readable_real?
268
+ true
269
+ end
270
+
271
+ # stat.setgid? => true or false
272
+ # Returns true if stat has the set-group-id permission bit set, false if it doesn‘t or if the operating system doesn‘t support this feature.
273
+ #
274
+ # File.stat("/usr/sbin/lpc").setgid? #=> true
275
+ def setgid?
276
+ Process.setgid?
277
+ end
278
+
279
+ # stat.setuid? => true or false
280
+ # Returns true if stat has the set-user-id permission bit set, false if it doesn‘t or if the operating system doesn‘t support this feature.
281
+ #
282
+ # File.stat("/bin/su").setuid? #=> true
283
+ def setuid?
284
+ Process.setuid?
285
+ end
286
+
287
+ # stat.size => fixnum
288
+ # Returns the size of stat in bytes.
289
+ #
290
+ # File.stat("testfile").size #=> 66
291
+ def size
292
+ read_attribute('size').to_i
293
+ end
294
+
295
+ # stat.socket? => true or false
296
+ # Returns true if stat is a socket, false if it isn‘t or if the operating system doesn‘t support this feature.
297
+ #
298
+ # File.stat("testfile").socket? #=> false
299
+ def socket
300
+ false
301
+ end
302
+
303
+ # stat.sticky? => true or false
304
+ # Returns true if stat has its sticky bit set, false if it doesn‘t or if the operating system doesn‘t support this feature.
305
+ #
306
+ # File.stat("testfile").sticky? #=> false
307
+ def sticky
308
+ false
309
+ end
310
+
311
+ # stat.symlink? => true or false
312
+ # Returns true if stat is a symbolic link, false if it isn‘t or if the operating system doesn‘t support this feature. As File::stat automatically follows symbolic links, symlink? will always be false for an object returned by File::stat.
313
+ #
314
+ # File.symlink("testfile", "alink") #=> 0
315
+ # File.stat("alink").symlink? #=> false
316
+ # File.lstat("alink").symlink? #=> true
317
+ def symlink?
318
+ false
319
+ end
320
+
321
+
322
+ # stat.uid => fixnum
323
+ # Returns the numeric user id of the owner of stat.
324
+ #
325
+ # File.stat("testfile").uid #=> 501
326
+ def uid
327
+ Process.uid
328
+ end
329
+
330
+ # stat.writable? → true or false
331
+ # Returns true if stat is writable by the effective user id of this process.
332
+ #
333
+ # File.stat("testfile").writable? #=> true
334
+ def writable?
335
+ true
336
+ end
337
+
338
+ # stat.writable_real? → true or false
339
+ # Returns true if stat is writable by the real user id of this process.
340
+ #
341
+ # File.stat("testfile").writable_real? #=> true
342
+ def writable_real?
343
+ true
344
+ end
345
+
346
+ # stat.zero? => true or false
347
+ # Returns true if stat is a zero-length file; false otherwise.
348
+ #
349
+ # File.stat("testfile").zero? #=> false
350
+ def zero?
351
+ size == 0
352
+ end
353
+
354
+ # redis specific
355
+
356
+ # reads the attribute from Redis or returns nil
357
+ def read_attribute(key)
358
+ write_attribute('atime', Time.now)
359
+ redis.get key_for_attribute(key)
360
+ end
361
+
362
+ # writes the attribute to redis as a string
363
+ def write_attribute(key, value)
364
+ redis.set key_for_attribute(key), value.to_s
365
+ redis.set key_for_attribute('ctime'), Time.now
366
+ value.to_s
367
+ end
368
+
369
+ # writes the default if this is the first time for this file
370
+ def write_default(key, value)
371
+ redis.setnx key_for_attribute(key), value.to_s
372
+ end
373
+
374
+ private
375
+ def key_for_attribute(key)
376
+ "#{name}:_stat:#{key}"
377
+ end
378
+
379
+ end
380
+ end
381
+
382
+
data/lib/redisk.rb ADDED
@@ -0,0 +1,37 @@
1
+ require 'logger'
2
+ require 'redis/namespace'
3
+ require 'redisk/helper'
4
+ require 'redisk/stat'
5
+ require 'redisk/io'
6
+ require 'redisk/logger'
7
+
8
+ module Redisk
9
+ VERSION = '0.1.0'
10
+
11
+ extend self
12
+
13
+ # straight up lifted from from @defunkt's resque
14
+ # Accepts a 'hostname:port' string or a Redis server.
15
+ def redis=(server)
16
+ case server
17
+ when String
18
+ host, port = server.split(':')
19
+ redis = Redis.new(:host => host, :port => port, :thread_safe => true)
20
+ @redis = Redis::Namespace.new(:redisk, :redis => redis)
21
+ when Redis
22
+ @redis = Redis::Namespace.new(:redisk, :redis => server)
23
+ else
24
+ raise "I don't know what to do with #{server.inspect}"
25
+ end
26
+ end
27
+
28
+ # Returns the current Redis connection. If none has been created, will
29
+ # create a new one.
30
+ def redis
31
+ return @redis if @redis
32
+ self.redis = 'localhost:6379'
33
+ self.redis
34
+ end
35
+
36
+ end
37
+
data/redisk.gemspec ADDED
@@ -0,0 +1,70 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{redisk}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Aaron Quint"]
12
+ s.date = %q{2009-12-17}
13
+ s.description = %q{Redisk includes Redisk::IO which is ~ Ruby's stdlib IO. It can be used with stdlib's Logger to log directly to redis}
14
+ s.email = %q{aaron@quirkey.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "lib/redisk.rb",
26
+ "lib/redisk/helper.rb",
27
+ "lib/redisk/io.rb",
28
+ "lib/redisk/logger.rb",
29
+ "lib/redisk/stat.rb",
30
+ "redisk.gemspec",
31
+ "spec/fixtures/rails.log",
32
+ "spec/redis-test.conf",
33
+ "spec/redisk_io_spec.rb",
34
+ "spec/redisk_logger_spec.rb",
35
+ "spec/redisk_stat_spec.rb",
36
+ "spec/spec.opts",
37
+ "spec/spec_helper.rb"
38
+ ]
39
+ s.homepage = %q{http://github.com/quirkey/redis_log}
40
+ s.rdoc_options = ["--charset=UTF-8"]
41
+ s.require_paths = ["lib"]
42
+ s.rubygems_version = %q{1.3.5}
43
+ s.summary = %q{An interface to Redis that mimic's Ruby's IO classes}
44
+ s.test_files = [
45
+ "spec/redisk_io_spec.rb",
46
+ "spec/redisk_logger_spec.rb",
47
+ "spec/redisk_stat_spec.rb",
48
+ "spec/spec_helper.rb"
49
+ ]
50
+
51
+ if s.respond_to? :specification_version then
52
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
53
+ s.specification_version = 3
54
+
55
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
56
+ s.add_runtime_dependency(%q<redis>, [">= 0.1.1"])
57
+ s.add_runtime_dependency(%q<redis-namespace>, [">= 0.1.0"])
58
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
59
+ else
60
+ s.add_dependency(%q<redis>, [">= 0.1.1"])
61
+ s.add_dependency(%q<redis-namespace>, [">= 0.1.0"])
62
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
63
+ end
64
+ else
65
+ s.add_dependency(%q<redis>, [">= 0.1.1"])
66
+ s.add_dependency(%q<redis-namespace>, [">= 0.1.0"])
67
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
68
+ end
69
+ end
70
+
@@ -0,0 +1,100 @@
1
+ Processing ArticlesController#new (for 0.0.0.0 at 2009-08-26 00:07:30) [GET]
2
+ Parameters: {"action"=>"new", "controller"=>"admin/articles"}
3
+ User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) LIMIT 1
4
+ Role Load (0.4ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
5
+ Role Load (0.3ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
6
+ Role Load (0.2ms) SELECT * FROM `roles` WHERE (`roles`.`title` = 'author') LIMIT 1
7
+ Rendering template within layouts/admin
8
+ Rendering admin/articles/new
9
+ Rendered admin/contents/_category_select_form (0.3ms)
10
+ Rendered admin/contents/_category_select (1.1ms)
11
+ User Load (0.5ms) SELECT * FROM `users` INNER JOIN `roles_users` ON (`users`.`id`=`roles_users`.`user_id`) WHERE ((`roles_users`.`role_id` = 1034934473)) 
12
+ Rendered admin/stored_files/_file_selector (0.3ms)
13
+ Rendered admin/stored_files/_file_selector (0.3ms)
14
+ Rendered admin/articles/_form (153.2ms)
15
+ Role Load (0.5ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
16
+ Completed in 171ms (View: 165, DB: 3) | 200 OK [http://test.host/admin/articles/new]
17
+ SQL (0.2ms) ROLLBACK
18
+ SQL (0.1ms) BEGIN
19
+ Article Load (0.3ms) SELECT * FROM `articles` WHERE (`articles`.`id` = 1910336964) 
20
+ User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) 
21
+
22
+
23
+ Processing ArticlesController#new (for 0.0.0.0 at 2009-08-26 00:07:30) [GET]
24
+ Parameters: {"action"=>"new", "controller"=>"admin/articles"}
25
+ User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) LIMIT 1
26
+ Role Load (0.4ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
27
+ Role Load (0.2ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
28
+ Role Load (0.2ms) SELECT * FROM `roles` WHERE (`roles`.`title` = 'author') LIMIT 1
29
+ Rendering template within layouts/admin
30
+ Rendering admin/articles/new
31
+ Rendered admin/contents/_category_select_form (0.3ms)
32
+ Rendered admin/contents/_category_select (1.1ms)
33
+ User Load (0.4ms) SELECT * FROM `users` INNER JOIN `roles_users` ON (`users`.`id`=`roles_users`.`user_id`) WHERE ((`roles_users`.`role_id` = 1034934473)) 
34
+ Rendered admin/stored_files/_file_selector (0.4ms)
35
+ Rendered admin/stored_files/_file_selector (0.2ms)
36
+ Rendered admin/articles/_form (18.4ms)
37
+ Role Load (0.5ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
38
+ Completed in 36ms (View: 30, DB: 3) | 200 OK [http://test.host/admin/articles/new]
39
+ SQL (0.2ms) ROLLBACK
40
+ SQL (0.1ms) BEGIN
41
+ Article Load (0.3ms) SELECT * FROM `articles` WHERE (`articles`.`id` = 1910336964) 
42
+ User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) 
43
+
44
+
45
+ Processing ArticlesController#new (for 0.0.0.0 at 2009-08-26 00:07:30) [GET]
46
+ Parameters: {"action"=>"new", "controller"=>"admin/articles"}
47
+ User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) LIMIT 1
48
+ Role Load (0.4ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
49
+ Role Load (0.4ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
50
+ Role Load (0.2ms) SELECT * FROM `roles` WHERE (`roles`.`title` = 'author') LIMIT 1
51
+ Rendering template within layouts/admin
52
+ Rendering admin/articles/new
53
+ Rendered admin/contents/_category_select_form (0.4ms)
54
+ Rendered admin/contents/_category_select (1.0ms)
55
+ User Load (0.4ms) SELECT * FROM `users` INNER JOIN `roles_users` ON (`users`.`id`=`roles_users`.`user_id`) WHERE ((`roles_users`.`role_id` = 1034934473)) 
56
+ Rendered admin/stored_files/_file_selector (0.4ms)
57
+ Rendered admin/stored_files/_file_selector (0.4ms)
58
+ Rendered admin/articles/_form (21.1ms)
59
+ Role Load (0.5ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
60
+ Completed in 40ms (View: 32, DB: 3) | 200 OK [http://test.host/admin/articles/new]
61
+ SQL (0.2ms) ROLLBACK
62
+ SQL (0.1ms) BEGIN
63
+ Article Load (0.3ms) SELECT * FROM `articles` WHERE (`articles`.`id` = 1910336964) 
64
+ User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) 
65
+
66
+
67
+ Processing ArticlesController#new (for 0.0.0.0 at 2009-08-26 00:07:30) [GET]
68
+ Parameters: {"action"=>"new", "controller"=>"admin/articles"}
69
+ User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) LIMIT 1
70
+ Role Load (0.3ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
71
+ Role Load (0.2ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
72
+ Role Load (0.1ms) SELECT * FROM `roles` WHERE (`roles`.`title` = 'author') LIMIT 1
73
+ Rendering template within layouts/admin
74
+ Rendering admin/articles/new
75
+ Rendered admin/contents/_category_select_form (0.4ms)
76
+ Rendered admin/contents/_category_select (1.1ms)
77
+ User Load (0.4ms) SELECT * FROM `users` INNER JOIN `roles_users` ON (`users`.`id`=`roles_users`.`user_id`) WHERE ((`roles_users`.`role_id` = 1034934473)) 
78
+ Rendered admin/stored_files/_file_selector (0.3ms)
79
+ Rendered admin/stored_files/_file_selector (0.3ms)
80
+ Rendered admin/articles/_form (16.9ms)
81
+ Role Load (0.5ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
82
+ Completed in 35ms (View: 29, DB: 3) | 200 OK [http://test.host/admin/articles/new]
83
+ SQL (0.1ms) ROLLBACK
84
+ SQL (0.1ms) BEGIN
85
+ Article Load (0.3ms) SELECT * FROM `articles` WHERE (`articles`.`id` = 1910336964) 
86
+ User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) 
87
+
88
+
89
+ Processing ArticlesController#show (for 0.0.0.0 at 2009-08-26 00:07:30) [GET]
90
+ Parameters: {"action"=>"show", "id"=>"1910336964", "controller"=>"admin/articles"}
91
+ User Load (0.4ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640) LIMIT 1
92
+ Role Load (0.4ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
93
+ Role Load (0.4ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON (`roles`.`id`=`roles_users`.`role_id`) WHERE (`roles`.`title` = 'admin') AND ((`roles_users`.`user_id` = 2129706640)) LIMIT 1
94
+ Role Load (0.2ms) SELECT * FROM `roles` WHERE (`roles`.`title` = 'author') LIMIT 1
95
+ Article Load (0.3ms) SELECT * FROM `articles` WHERE (`articles`.`id` = 1910336964) 
96
+ Completed in 9ms (View: 2, DB: 2) | 200 OK [http://test.host/admin/articles/show/1910336964]
97
+ SQL (0.1ms) ROLLBACK
98
+ SQL (0.1ms) BEGIN
99
+ Article Load (0.3ms) SELECT * FROM `articles` WHERE (`articles`.`id` = 1910336964) 
100
+ User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`id` = 2129706640)