advertnet 1.0.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.
- data/LICENSE +674 -0
- data/README +257 -0
- data/Rakefile +10 -0
- data/app/controllers/application.rb +40 -0
- data/app/controllers/container_controller.rb +83 -0
- data/app/controllers/content_controller.rb +61 -0
- data/app/controllers/furnitures_controller.rb +87 -0
- data/app/controllers/networks_controller.rb +269 -0
- data/app/controllers/objects_in_world_controller.rb +27 -0
- data/app/controllers/panels_controller.rb +186 -0
- data/app/helpers/application_helper.rb +31 -0
- data/app/helpers/container_helper.rb +2 -0
- data/app/helpers/content_helper.rb +2 -0
- data/app/helpers/furnitures_helper.rb +2 -0
- data/app/helpers/network_helper.rb +2 -0
- data/app/helpers/networks_helper.rb +2 -0
- data/app/helpers/objects_in_world_helper.rb +2 -0
- data/app/helpers/panels_helper.rb +2 -0
- data/app/models/container.rb +51 -0
- data/app/models/furniture.rb +60 -0
- data/app/models/mailer.rb +22 -0
- data/app/models/network.rb +38 -0
- data/app/models/object_in_world.rb +60 -0
- data/app/models/object_off_world.rb +77 -0
- data/app/models/panel.rb +136 -0
- data/app/models/panel_revision.rb +108 -0
- data/app/views/container/list.rhtml +27 -0
- data/app/views/container/show.rhtml +8 -0
- data/app/views/content/_form.rhtml +12 -0
- data/app/views/content/edit.rhtml +8 -0
- data/app/views/content/list.rhtml +26 -0
- data/app/views/content/new.rhtml +8 -0
- data/app/views/furnitures/list.rhtml +51 -0
- data/app/views/furnitures/show.rhtml +7 -0
- data/app/views/layouts/default.rhtml +30 -0
- data/app/views/mailer/avtouch.rhtml +1 -0
- data/app/views/networks/_form.rhtml +11 -0
- data/app/views/networks/_parameters_form.rhtml +8 -0
- data/app/views/networks/edit.rhtml +9 -0
- data/app/views/networks/list.rhtml +25 -0
- data/app/views/networks/new.rhtml +8 -0
- data/app/views/networks/show.rhtml +72 -0
- data/app/views/networks/show_parameters_form.rjs +5 -0
- data/app/views/objects_in_world/list.rhtml +30 -0
- data/app/views/objects_in_world/show.rhtml +8 -0
- data/app/views/panels/list.rhtml +48 -0
- data/app/views/panels/show.rhtml +8 -0
- data/bin/advertnet-install +144 -0
- data/config/boot.rb +45 -0
- data/config/database.yml.default +43 -0
- data/config/environment.rb +67 -0
- data/config/environments/development.rb +21 -0
- data/config/environments/production.rb +21 -0
- data/config/environments/test.rb +19 -0
- data/config/routes.rb +23 -0
- data/db/migrate/001_create_networks.rb +14 -0
- data/db/migrate/002_create_furnitures.rb +17 -0
- data/db/migrate/003_create_containers.rb +16 -0
- data/db/migrate/004_create_objects_in_world.rb +16 -0
- data/db/migrate/005_create_objects_off_world.rb +16 -0
- data/db/migrate/006_create_panels.rb +17 -0
- data/db/migrate/007_join_objects_in_world_panels.rb +17 -0
- data/db/migrate/008_join_objects_off_world_panels.rb +17 -0
- data/db/migrate/009_add_sessions.rb +19 -0
- data/db/migrate/010_add_or_rename_fields.rb +25 -0
- data/db/migrate/011_move_texture_to_object_in_world.rb +25 -0
- data/db/migrate/012_add_permanent_furniture_id.rb +18 -0
- data/db/migrate/013_create_panel_revisions.rb +42 -0
- data/db/schema.rb +102 -0
- data/doc/README_FOR_APP +108 -0
- data/lib/advertnet.rb +13 -0
- data/lib/second_life_validators.rb +89 -0
- data/lib/tasks/documentation.rake +16 -0
- data/lib/tasks/extract_fixtures.rake +23 -0
- data/lib/tasks/load_exported_fixtures.rake +14 -0
- data/public/404.html +30 -0
- data/public/500.html +30 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/favicon.ico +0 -0
- data/public/images/rails.png +0 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +833 -0
- data/public/javascripts/dragdrop.js +942 -0
- data/public/javascripts/effects.js +1088 -0
- data/public/javascripts/prototype.js +2515 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/application.css +25 -0
- data/public/stylesheets/scaffold.css +74 -0
- data/script/about +3 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/process/inspector +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/containers.yml +44 -0
- data/test/fixtures/furnitures.yml +47 -0
- data/test/fixtures/mailer/avtouch +1 -0
- data/test/fixtures/networks.yml +31 -0
- data/test/fixtures/objects_in_world.yml +71 -0
- data/test/fixtures/objects_in_world_panels.yml +43 -0
- data/test/fixtures/objects_off_world.yml +55 -0
- data/test/fixtures/objects_off_world_panels.yml +20 -0
- data/test/fixtures/panel_revisions.yml +28 -0
- data/test/fixtures/panels.yml +79 -0
- data/test/functional/container_controller_test.rb +167 -0
- data/test/functional/content_controller_test.rb +91 -0
- data/test/functional/furnitures_controller_test.rb +134 -0
- data/test/functional/networks_controller_test.rb +248 -0
- data/test/functional/objects_in_world_controller_test.rb +42 -0
- data/test/functional/panels_controller_test.rb +173 -0
- data/test/test_helper.rb +53 -0
- data/test/unit/container_test.rb +53 -0
- data/test/unit/furniture_test.rb +68 -0
- data/test/unit/mailer_test.rb +40 -0
- data/test/unit/network_test.rb +42 -0
- data/test/unit/object_in_world_test.rb +33 -0
- data/test/unit/object_off_world_test.rb +26 -0
- data/test/unit/panel_revision_test.rb +148 -0
- data/test/unit/panel_test.rb +63 -0
- data/vendor/plugins/annotate_models/ChangeLog +46 -0
- data/vendor/plugins/annotate_models/README +31 -0
- data/vendor/plugins/annotate_models/lib/annotate_models.rb +132 -0
- data/vendor/plugins/annotate_models/tasks/annotate_models_tasks.rake +7 -0
- data/vendor/plugins/foreign_key_migrations/CHANGELOG +99 -0
- data/vendor/plugins/foreign_key_migrations/MIT-LICENSE +20 -0
- data/vendor/plugins/foreign_key_migrations/README +87 -0
- data/vendor/plugins/foreign_key_migrations/about.yml +5 -0
- data/vendor/plugins/foreign_key_migrations/init.rb +3 -0
- data/vendor/plugins/foreign_key_migrations/install.rb +1 -0
- data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/base.rb +22 -0
- data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/abstract_adapter.rb +22 -0
- data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/table_definition.rb +28 -0
- data/vendor/plugins/redhillonrails_core/CHANGELOG +154 -0
- data/vendor/plugins/redhillonrails_core/MIT-LICENSE +20 -0
- data/vendor/plugins/redhillonrails_core/README +139 -0
- data/vendor/plugins/redhillonrails_core/init.rb +19 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/base.rb +54 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/abstract_adapter.rb +31 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/column.rb +21 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/foreign_key_definition.rb +26 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/index_definition.rb +11 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/mysql_adapter.rb +82 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/mysql_column.rb +8 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/postgresql_adapter.rb +107 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/schema_statements.rb +23 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/sqlite3_adapter.rb +9 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/table_definition.rb +27 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/schema.rb +27 -0
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/schema_dumper.rb +47 -0
- metadata +290 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<h1>Listing des Objets In World</h1>
|
|
2
|
+
|
|
3
|
+
<table border="1">
|
|
4
|
+
<tr>
|
|
5
|
+
<th>Nom</th>
|
|
6
|
+
<th>Object key</th>
|
|
7
|
+
<th>Type</th>
|
|
8
|
+
<th>Conteneur</th>
|
|
9
|
+
</tr>
|
|
10
|
+
|
|
11
|
+
<% for object_in_world in @objects_in_world %>
|
|
12
|
+
<tr>
|
|
13
|
+
<td><%=h object_in_world.name %></td>
|
|
14
|
+
<td><%=h object_in_world.object_key %></td>
|
|
15
|
+
<td><%=h object_in_world.otype %></td>
|
|
16
|
+
<td><%= link_to h(object_in_world.container.name), :controller => 'container', :action => 'show', :id => object_in_world.container.id %></td>
|
|
17
|
+
<!-- <td><%= link_to 'Show', :action => 'show', :id => object_in_world %></td>
|
|
18
|
+
<td><%= link_to 'Edit', :action => 'edit', :id => object_in_world %></td>
|
|
19
|
+
<td><%= link_to 'Destroy', { :action => 'destroy', :id => object_in_world }, :confirm => 'Are you sure?', :method => :post %></td>
|
|
20
|
+
-->
|
|
21
|
+
</tr>
|
|
22
|
+
<% end %>
|
|
23
|
+
</table>
|
|
24
|
+
|
|
25
|
+
<%= link_to 'Previous page', { :page => @object_in_world_pages.current.previous } if @object_in_world_pages.current.previous %>
|
|
26
|
+
<%= link_to 'Next page', { :page => @object_in_world_pages.current.next } if @object_in_world_pages.current.next %>
|
|
27
|
+
|
|
28
|
+
<br />
|
|
29
|
+
|
|
30
|
+
<!-- <%= link_to 'New object_in_world', :action => 'new' %> -->
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<% for column in ObjectInWorld.content_columns %>
|
|
2
|
+
<p>
|
|
3
|
+
<b><%= column.human_name %>:</b> <%=h @object_in_world.send(column.name) %>
|
|
4
|
+
</p>
|
|
5
|
+
<% end %>
|
|
6
|
+
|
|
7
|
+
<%= link_to 'Edit', :action => 'edit', :id => @object_in_world %> |
|
|
8
|
+
<%= link_to 'Back', :action => 'list' %>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<h1>Listing panels</h1>
|
|
2
|
+
|
|
3
|
+
<table>
|
|
4
|
+
<tr>
|
|
5
|
+
<% for column in Panel.content_columns %>
|
|
6
|
+
<th><%= column.human_name %></th>
|
|
7
|
+
<% end %>
|
|
8
|
+
</tr>
|
|
9
|
+
|
|
10
|
+
<% for panel in @panels %>
|
|
11
|
+
<tr>
|
|
12
|
+
<% for column in Panel.content_columns %>
|
|
13
|
+
<td><%=h panel.send(column.name) %></td>
|
|
14
|
+
<% end %>
|
|
15
|
+
<td><%= link_to 'Show', :action => 'show', :id => panel %></td>
|
|
16
|
+
<td><%= link_to 'Edit', :action => 'edit', :id => panel %></td>
|
|
17
|
+
<td><%= delay = Furniture.find(panel.furniture.id).delay
|
|
18
|
+
updated_time = panel.updated_at + 5 * delay * 60
|
|
19
|
+
if updated_time < Time::now
|
|
20
|
+
@todestroy=1
|
|
21
|
+
end
|
|
22
|
+
if @todestroy == 1
|
|
23
|
+
link_to 'Destroy', { :action => 'destroy', :id => panel }, :confirm => 'Are you sure?', :method => :post
|
|
24
|
+
end %></td>
|
|
25
|
+
</tr>
|
|
26
|
+
<% end %>
|
|
27
|
+
</table>
|
|
28
|
+
<h1>Obsolete panels</h1>
|
|
29
|
+
|
|
30
|
+
<table>
|
|
31
|
+
|
|
32
|
+
<% for panel in @panels %>
|
|
33
|
+
<tr>
|
|
34
|
+
<% for column in Panel.content_columns
|
|
35
|
+
if (panel.updated_at + 5 * Furniture.find(panel.furniture.id).delay * 60) < Time.now %>
|
|
36
|
+
<td><%=h panel.send(column.name) %></td>
|
|
37
|
+
<%end%>
|
|
38
|
+
<% end %>
|
|
39
|
+
</tr>
|
|
40
|
+
<% end %>
|
|
41
|
+
</table>
|
|
42
|
+
<%= link_to 'Delete All', { :action => 'destroydead' }, :confirm => 'Are you sure?', :method => :post %>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
<%= link_to 'Previous page', { :page => @panel_pages.current.previous } if @panel_pages.current.previous %>
|
|
46
|
+
<%= link_to 'Next page', { :page => @panel_pages.current.next } if @panel_pages.current.next %>
|
|
47
|
+
|
|
48
|
+
<br />
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Advertnet installer: deploy the gem as a fully functional Rails application
|
|
4
|
+
#
|
|
5
|
+
# Copyright (C) 2007 Farzad FARID / Pragmatic Source
|
|
6
|
+
# Author: Farzad FARID <ffarid@pragmatic-source.com>
|
|
7
|
+
# Date: 2007/10/15
|
|
8
|
+
# Licence: GPLv3
|
|
9
|
+
#
|
|
10
|
+
# This program is free software: you can redistribute it and/or modify
|
|
11
|
+
# it under the terms of the GNU General Public License as published by
|
|
12
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
13
|
+
# (at your option) any later version.
|
|
14
|
+
#
|
|
15
|
+
# This program is distributed in the hope that it will be useful,
|
|
16
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
# GNU General Public License for more details.
|
|
19
|
+
#
|
|
20
|
+
# You should have received a copy of the GNU General Public License
|
|
21
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
22
|
+
|
|
23
|
+
require 'optparse'
|
|
24
|
+
# We use Rake::FileList, mkdir_p, etc.
|
|
25
|
+
require 'rubygems'
|
|
26
|
+
require 'rake'
|
|
27
|
+
|
|
28
|
+
prog_name = File.basename($0)
|
|
29
|
+
options = { :install_dir => nil, :verbose => false }
|
|
30
|
+
adv_gem = Gem.cache.search('advertnet').sort_by { |g| g.version }.last
|
|
31
|
+
# We'll use the most recent Rails Gem anyways.
|
|
32
|
+
rails_gem = Gem.cache.search('rails').sort_by { |g| g.version }.last
|
|
33
|
+
|
|
34
|
+
parser = OptionParser.new do |parser|
|
|
35
|
+
parser.banner = "Usage: #{prog_name} [options]"
|
|
36
|
+
parser.separator ""
|
|
37
|
+
parser.separator "#{prog_name} deploys the Advertnet Rails application in the directory"
|
|
38
|
+
parser.separator "provided on the command line."
|
|
39
|
+
parser.separator "NOTE: The directory must not exist otherwise its content would be overriden."
|
|
40
|
+
parser.separator "Please read the README file after deploying the application for more"
|
|
41
|
+
parser.separator "information on the configuration and the usage of Advertnet."
|
|
42
|
+
parser.separator ""
|
|
43
|
+
parser.separator "Options:"
|
|
44
|
+
|
|
45
|
+
parser.on(:REQUIRED, '-dDIR', '--directory DIR', String,
|
|
46
|
+
'Installation directory for the Advertnet Rails application') do |dir|
|
|
47
|
+
options[:install_dir] = File.expand_path(dir)
|
|
48
|
+
if File.directory? dir
|
|
49
|
+
$stderr.puts "Error: Directory '#{dir}' already exists."
|
|
50
|
+
$stderr.puts parser
|
|
51
|
+
exit 2
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
parser.on('-v', '--verbose', 'Verbose installation') do
|
|
55
|
+
options[:verbose] = true
|
|
56
|
+
end
|
|
57
|
+
parser.on_tail('-h', '--help', 'Show this message') do
|
|
58
|
+
$stderr.puts parser
|
|
59
|
+
exit 1
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
begin
|
|
64
|
+
parser.parse!
|
|
65
|
+
if options[:install_dir].nil?
|
|
66
|
+
raise OptionParser::ParseError, 'Missing installation directory.'
|
|
67
|
+
end
|
|
68
|
+
rescue OptionParser::ParseError => e
|
|
69
|
+
$stderr.puts "Error: #{e}\n"
|
|
70
|
+
$stderr.puts parser
|
|
71
|
+
exit 1
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
begin
|
|
75
|
+
$stderr.puts "Creating directories..."
|
|
76
|
+
mkdir_p options[:install_dir], :verbose => options[:verbose]
|
|
77
|
+
# This script is in the "./bin" directory of the Advertnet Gem, we use the relative
|
|
78
|
+
# path to find all files, excluding those that do not belong to the Rails app.
|
|
79
|
+
$stderr.puts "Copying files..."
|
|
80
|
+
Dir.chdir(File.join(File.dirname(__FILE__), '..')) do |newdir|
|
|
81
|
+
# List files to be copied
|
|
82
|
+
files = FileList.new('**/*') do |fl|
|
|
83
|
+
fl.exclude /.gemspec$/,
|
|
84
|
+
/^bin.*/,
|
|
85
|
+
/\.svn/,
|
|
86
|
+
/\.log$/
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Now copy files. We cannot use "FileUtils.cp_r", which may recursively
|
|
90
|
+
# copy undesired files. Moreover, we need to manually edit or rename
|
|
91
|
+
# some files.
|
|
92
|
+
files.each do |f|
|
|
93
|
+
if f =~ /database\.yml\.default$/
|
|
94
|
+
# Deploy the default "database.yml" config file in production
|
|
95
|
+
cp f, File.join(options[:install_dir], f.sub(/\.default/, '')), :verbose => options[:verbose]
|
|
96
|
+
elsif f =~ /environment\.rb$/
|
|
97
|
+
# Modify environment.rb to make it use the latest available Rails Gem.
|
|
98
|
+
open(f, 'r') { |src_f|
|
|
99
|
+
open(File.join(options[:install_dir], f), 'w') { |dst_f|
|
|
100
|
+
dst_f.write(src_f.read.sub(/RAILS_GEM_VERSION = '.*'/,
|
|
101
|
+
"RAILS_GEM_VERSION = '#{rails_gem.version.version}'"))
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
elsif File.directory?(f)
|
|
105
|
+
mkdir_p File.join(options[:install_dir], f), :verbose => options[:verbose]
|
|
106
|
+
else
|
|
107
|
+
cp f, File.join(options[:install_dir], f), :verbose => options[:verbose]
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Rubygems excluded empty directories from the gem package! We have to create the following
|
|
112
|
+
# directories manually. The following command line was used to find empty directories:
|
|
113
|
+
# find . -type d | while read d ; do echo -n "$d " ; ls $d | wc -l ; done | sed -n 's/ 0$//p'
|
|
114
|
+
%w{ log components test/integration test/mocks/test test/mocks/development tmp/sockets
|
|
115
|
+
tmp/pids tmp/cache tmp/sessions db/exported_fixtures }.each do |empty_dir|
|
|
116
|
+
mkdir_p File.join(options[:install_dir], empty_dir), :verbose => options[:verbose]
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
$stderr.puts "Done.\n\n"
|
|
120
|
+
|
|
121
|
+
# OK, app instance was successfully created.
|
|
122
|
+
puts <<-EOT
|
|
123
|
+
Advertnet version #{adv_gem.version.version} has been successfully installed!
|
|
124
|
+
|
|
125
|
+
Please read the README file in the newly created « #{options[:install_dir]} »
|
|
126
|
+
directory in order to configure the MySQL 5 database, run the tests
|
|
127
|
+
and get the application in running order.
|
|
128
|
+
|
|
129
|
+
You can also consult this README file in Rubygems' rdoc directory,
|
|
130
|
+
by lauching 'gem_server' and browsing the following URL:
|
|
131
|
+
http://localhost:8808/doc_root/advertnet-#{adv_gem.version.version}/rdoc/index.html
|
|
132
|
+
EOT
|
|
133
|
+
rescue Exception => e
|
|
134
|
+
# An error occured, maybe an unwriteable path
|
|
135
|
+
$stderr.puts <<-EOM
|
|
136
|
+
An error occured when created the Advertnet application!
|
|
137
|
+
|
|
138
|
+
##################
|
|
139
|
+
#{e}
|
|
140
|
+
##################
|
|
141
|
+
|
|
142
|
+
Please correct the problem and try again.
|
|
143
|
+
EOM
|
|
144
|
+
end
|
data/config/boot.rb
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
|
|
2
|
+
|
|
3
|
+
unless defined?(RAILS_ROOT)
|
|
4
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
|
5
|
+
|
|
6
|
+
unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
|
|
7
|
+
require 'pathname'
|
|
8
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
RAILS_ROOT = root_path
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
unless defined?(Rails::Initializer)
|
|
15
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
|
16
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
|
17
|
+
else
|
|
18
|
+
require 'rubygems'
|
|
19
|
+
|
|
20
|
+
environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
|
|
21
|
+
environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
|
|
22
|
+
rails_gem_version = $1
|
|
23
|
+
|
|
24
|
+
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
|
|
25
|
+
# Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
|
|
26
|
+
rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
|
|
27
|
+
|
|
28
|
+
if rails_gem
|
|
29
|
+
gem "rails", "=#{rails_gem.version.version}"
|
|
30
|
+
require rails_gem.full_gem_path + '/lib/initializer'
|
|
31
|
+
else
|
|
32
|
+
STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
|
|
33
|
+
Install the missing gem with 'gem install -v=#{version} rails', or
|
|
34
|
+
change environment.rb to define RAILS_GEM_VERSION with your desired version.
|
|
35
|
+
)
|
|
36
|
+
exit 1
|
|
37
|
+
end
|
|
38
|
+
else
|
|
39
|
+
gem "rails"
|
|
40
|
+
require 'initializer'
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Rails::Initializer.run(:set_load_path)
|
|
45
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Modèle de fichier de configuration de base de données.
|
|
2
|
+
# Recopiez ce fichier en 'database.yml' lors de la mise en production.
|
|
3
|
+
# Le fichier 'database.yml' ne sera pas écrasé par Subversion.
|
|
4
|
+
|
|
5
|
+
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
|
|
6
|
+
#
|
|
7
|
+
# Install the MySQL driver:
|
|
8
|
+
# gem install mysql
|
|
9
|
+
# On MacOS X:
|
|
10
|
+
# gem install mysql -- --include=/usr/local/lib
|
|
11
|
+
# On Windows:
|
|
12
|
+
# gem install mysql
|
|
13
|
+
# Choose the win32 build.
|
|
14
|
+
# Install MySQL and put its /bin directory on your path.
|
|
15
|
+
#
|
|
16
|
+
# And be sure to use new-style password hashing:
|
|
17
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
|
18
|
+
development:
|
|
19
|
+
adapter: mysql
|
|
20
|
+
database: advertnet_development
|
|
21
|
+
username: root
|
|
22
|
+
password:
|
|
23
|
+
socket: /var/run/mysqld/mysqld.sock
|
|
24
|
+
encoding: utf8
|
|
25
|
+
|
|
26
|
+
# Warning: The database defined as 'test' will be erased and
|
|
27
|
+
# re-generated from your development database when you run 'rake'.
|
|
28
|
+
# Do not set this db to the same as development or production.
|
|
29
|
+
test:
|
|
30
|
+
adapter: mysql
|
|
31
|
+
database: advertnet_test
|
|
32
|
+
username: root
|
|
33
|
+
password:
|
|
34
|
+
socket: /var/run/mysqld/mysqld.sock
|
|
35
|
+
encoding: utf8
|
|
36
|
+
|
|
37
|
+
production:
|
|
38
|
+
adapter: mysql
|
|
39
|
+
database: advertnet_production
|
|
40
|
+
username: root
|
|
41
|
+
password:
|
|
42
|
+
socket: /var/run/mysqld/mysqld.sock
|
|
43
|
+
encoding: utf8
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Be sure to restart your web server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Uncomment below to force Rails into production mode when
|
|
4
|
+
# you don't control web/app server and can't set it the proper way
|
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
|
6
|
+
|
|
7
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
|
8
|
+
RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
|
|
9
|
+
|
|
10
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
|
11
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
|
12
|
+
|
|
13
|
+
Rails::Initializer.run do |config|
|
|
14
|
+
# Settings in config/environments/* take precedence over those specified here
|
|
15
|
+
|
|
16
|
+
# Skip frameworks you're not going to use (only works if using vendor/rails)
|
|
17
|
+
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
|
18
|
+
|
|
19
|
+
# Only load the plugins named here, by default all plugins in vendor/plugins are loaded
|
|
20
|
+
# config.plugins = %W( exception_notification ssl_requirement )
|
|
21
|
+
|
|
22
|
+
# Add additional load paths for your own custom dirs
|
|
23
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
|
24
|
+
|
|
25
|
+
# Force all environments to use the same logger level
|
|
26
|
+
# (by default production uses :info, the others :debug)
|
|
27
|
+
# config.log_level = :debug
|
|
28
|
+
|
|
29
|
+
# Use the database for sessions instead of the file system
|
|
30
|
+
# (create the session table with 'rake db:sessions:create')
|
|
31
|
+
config.action_controller.session_store = :active_record_store
|
|
32
|
+
|
|
33
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
34
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
35
|
+
# like if you have constraints or database-specific column types
|
|
36
|
+
config.active_record.schema_format = :sql
|
|
37
|
+
|
|
38
|
+
# Activate observers that should always be running
|
|
39
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
|
40
|
+
|
|
41
|
+
# Make Active Record use UTC-base instead of local time
|
|
42
|
+
# config.active_record.default_timezone = :utc
|
|
43
|
+
|
|
44
|
+
# See Rails::Configuration for more options
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Add new inflection rules using the following format
|
|
48
|
+
# (all these examples are active by default):
|
|
49
|
+
Inflector.inflections do |inflect|
|
|
50
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
|
51
|
+
# inflect.singular /^(ox)en/i, '\1'
|
|
52
|
+
# inflect.irregular 'person', 'people'
|
|
53
|
+
# inflect.uncountable %w( fish sheep )
|
|
54
|
+
# Il est nécessaire de spécifiers les pluriels irréguliers de OIW et OOW
|
|
55
|
+
# sous les 2 formes (avec majuscules et avec '_'), afin d'éviter de devoir
|
|
56
|
+
# gérer plein d'exceptions dans les modèles de données.
|
|
57
|
+
inflect.irregular 'object_in_world', 'objects_in_world'
|
|
58
|
+
inflect.irregular 'ObjectInWorld', 'ObjectsInWorld'
|
|
59
|
+
inflect.irregular 'object_off_world', 'objects_off_world'
|
|
60
|
+
inflect.irregular 'ObjectOffWorld', 'ObjectsOffWorld'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Add new mime types for use in respond_to blocks:
|
|
64
|
+
# Mime::Type.register "text/richtext", :rtf
|
|
65
|
+
# Mime::Type.register "application/x-mobile", :mobile
|
|
66
|
+
|
|
67
|
+
# Include your application configuration below
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
2
|
+
|
|
3
|
+
# In the development environment your application's code is reloaded on
|
|
4
|
+
# every request. This slows down response time but is perfect for development
|
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
|
6
|
+
config.cache_classes = false
|
|
7
|
+
|
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
|
9
|
+
config.whiny_nils = true
|
|
10
|
+
|
|
11
|
+
# Enable the breakpoint server that script/breakpointer connects to
|
|
12
|
+
config.breakpoint_server = true
|
|
13
|
+
|
|
14
|
+
# Show full error reports and disable caching
|
|
15
|
+
config.action_controller.consider_all_requests_local = true
|
|
16
|
+
config.action_controller.perform_caching = false
|
|
17
|
+
config.action_view.cache_template_extensions = false
|
|
18
|
+
config.action_view.debug_rjs = true
|
|
19
|
+
|
|
20
|
+
# Don't care if the mailer can't send
|
|
21
|
+
config.action_mailer.raise_delivery_errors = false
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
2
|
+
|
|
3
|
+
# The production environment is meant for finished, "live" apps.
|
|
4
|
+
# Code is not reloaded between requests
|
|
5
|
+
config.cache_classes = true
|
|
6
|
+
|
|
7
|
+
# Use a different logger for distributed setups
|
|
8
|
+
# config.logger = SyslogLogger.new
|
|
9
|
+
|
|
10
|
+
# Full error reports are disabled and caching is turned on
|
|
11
|
+
config.action_controller.consider_all_requests_local = false
|
|
12
|
+
config.action_controller.perform_caching = true
|
|
13
|
+
|
|
14
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
|
15
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
|
16
|
+
|
|
17
|
+
# Disable delivery errors, bad email addresses will be ignored
|
|
18
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
19
|
+
|
|
20
|
+
# En production, les mails doivent être envoyés réellement. On délègue à sendmail/postfix.
|
|
21
|
+
config.action_mailer.delivery_method = :sendmail
|