This file is indexed.

/usr/share/doc/ruby-ramaze/examples/app/wikore/src/model.rb is in ruby-ramaze 2012.12.08-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require 'sequel'

if $wikore_db == :memory
  DB = Sequel.sqlite
else
  DB_FILE = __DIR__('wikore.db')
  DB = Sequel.connect("sqlite://#{DB_FILE}")
end

Sequel::Model.plugin :schema

module Model
  PAGE_SCHEMA = lambda{|db|
    primary_key :id
    boolean :active, :default => true
    text    :text
    integer :version
  }

  class Page < Sequel::Model(:page)
    set_schema do
      instance_eval(&PAGE_SCHEMA)
      text :title, :unique => true, :null => false
    end

    def backup
      hash = @values.dup
      hash.delete :id
      OldPage.create(hash)
    end

    def revert
      backup = OldPage[:title => title].values.dup
      backup.delete :id
      delete
      self.class.create(backup)
    end
  end

  class OldPage < Sequel::Model(:old_page)
    set_schema do
      instance_eval(&PAGE_SCHEMA)
      text :title, :unique => false, :null => false
    end
  end

  [Page, OldPage].each do |klass|
    klass.create_table?
  end
end