misha-ar-octopus 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.rubocop.yml +46 -0
- data/.rubocop_todo.yml +56 -0
- data/.ruby-version +1 -0
- data/.travis.yml +18 -0
- data/Appraisals +16 -0
- data/Gemfile +4 -0
- data/README.mkdn +242 -0
- data/Rakefile +172 -0
- data/TODO.txt +7 -0
- data/ar-octopus.gemspec +42 -0
- data/gemfiles/rails32.gemfile +7 -0
- data/gemfiles/rails4.gemfile +7 -0
- data/gemfiles/rails41.gemfile +7 -0
- data/gemfiles/rails42.gemfile +7 -0
- data/init.rb +1 -0
- data/lib/ar-octopus.rb +1 -0
- data/lib/octopus.rb +181 -0
- data/lib/octopus/abstract_adapter.rb +35 -0
- data/lib/octopus/association.rb +13 -0
- data/lib/octopus/association_shard_tracking.rb +114 -0
- data/lib/octopus/collection_association.rb +11 -0
- data/lib/octopus/collection_proxy.rb +16 -0
- data/lib/octopus/exception.rb +4 -0
- data/lib/octopus/has_and_belongs_to_many_association.rb +9 -0
- data/lib/octopus/load_balancing.rb +4 -0
- data/lib/octopus/load_balancing/round_robin.rb +20 -0
- data/lib/octopus/log_subscriber.rb +22 -0
- data/lib/octopus/migration.rb +168 -0
- data/lib/octopus/model.rb +210 -0
- data/lib/octopus/persistence.rb +39 -0
- data/lib/octopus/proxy.rb +534 -0
- data/lib/octopus/railtie.rb +11 -0
- data/lib/octopus/relation_proxy.rb +35 -0
- data/lib/octopus/scope_proxy.rb +61 -0
- data/lib/octopus/shard_tracking.rb +41 -0
- data/lib/octopus/shard_tracking/attribute.rb +22 -0
- data/lib/octopus/shard_tracking/dynamic.rb +11 -0
- data/lib/octopus/singular_association.rb +9 -0
- data/lib/octopus/slave_group.rb +13 -0
- data/lib/octopus/version.rb +3 -0
- data/lib/tasks/octopus.rake +16 -0
- data/rails/init.rb +1 -0
- data/sample_app/.gitignore +4 -0
- data/sample_app/.rspec +1 -0
- data/sample_app/Gemfile +20 -0
- data/sample_app/README +3 -0
- data/sample_app/README.rdoc +261 -0
- data/sample_app/Rakefile +7 -0
- data/sample_app/app/assets/images/rails.png +0 -0
- data/sample_app/app/assets/javascripts/application.js +15 -0
- data/sample_app/app/assets/stylesheets/application.css +13 -0
- data/sample_app/app/controllers/application_controller.rb +4 -0
- data/sample_app/app/helpers/application_helper.rb +2 -0
- data/sample_app/app/mailers/.gitkeep +0 -0
- data/sample_app/app/models/.gitkeep +0 -0
- data/sample_app/app/models/item.rb +3 -0
- data/sample_app/app/models/user.rb +3 -0
- data/sample_app/app/views/layouts/application.html.erb +14 -0
- data/sample_app/autotest/discover.rb +2 -0
- data/sample_app/config.ru +4 -0
- data/sample_app/config/application.rb +62 -0
- data/sample_app/config/boot.rb +6 -0
- data/sample_app/config/cucumber.yml +8 -0
- data/sample_app/config/database.yml +28 -0
- data/sample_app/config/environment.rb +5 -0
- data/sample_app/config/environments/development.rb +37 -0
- data/sample_app/config/environments/production.rb +67 -0
- data/sample_app/config/environments/test.rb +37 -0
- data/sample_app/config/initializers/backtrace_silencers.rb +7 -0
- data/sample_app/config/initializers/inflections.rb +15 -0
- data/sample_app/config/initializers/mime_types.rb +5 -0
- data/sample_app/config/initializers/secret_token.rb +7 -0
- data/sample_app/config/initializers/session_store.rb +8 -0
- data/sample_app/config/initializers/wrap_parameters.rb +14 -0
- data/sample_app/config/locales/en.yml +5 -0
- data/sample_app/config/routes.rb +58 -0
- data/sample_app/config/shards.yml +28 -0
- data/sample_app/db/migrate/20100720172715_create_users.rb +15 -0
- data/sample_app/db/migrate/20100720172730_create_items.rb +16 -0
- data/sample_app/db/migrate/20100720210335_create_sample_users.rb +11 -0
- data/sample_app/db/schema.rb +29 -0
- data/sample_app/db/seeds.rb +16 -0
- data/sample_app/doc/README_FOR_APP +2 -0
- data/sample_app/features/migrate.feature +45 -0
- data/sample_app/features/seed.feature +15 -0
- data/sample_app/features/step_definitions/seeds_steps.rb +13 -0
- data/sample_app/features/step_definitions/web_steps.rb +218 -0
- data/sample_app/features/support/database.rb +13 -0
- data/sample_app/features/support/env.rb +57 -0
- data/sample_app/features/support/paths.rb +33 -0
- data/sample_app/lib/assets/.gitkeep +0 -0
- data/sample_app/lib/tasks/.gitkeep +0 -0
- data/sample_app/lib/tasks/cucumber.rake +64 -0
- data/sample_app/log/.gitkeep +0 -0
- data/sample_app/public/404.html +26 -0
- data/sample_app/public/422.html +26 -0
- data/sample_app/public/500.html +26 -0
- data/sample_app/public/favicon.ico +0 -0
- data/sample_app/public/images/rails.png +0 -0
- data/sample_app/public/index.html +279 -0
- data/sample_app/public/javascripts/application.js +2 -0
- data/sample_app/public/javascripts/controls.js +965 -0
- data/sample_app/public/javascripts/dragdrop.js +974 -0
- data/sample_app/public/javascripts/effects.js +1123 -0
- data/sample_app/public/javascripts/prototype.js +4874 -0
- data/sample_app/public/javascripts/rails.js +118 -0
- data/sample_app/public/robots.txt +5 -0
- data/sample_app/public/stylesheets/.gitkeep +0 -0
- data/sample_app/script/cucumber +10 -0
- data/sample_app/script/rails +6 -0
- data/sample_app/spec/models/item_spec.rb +5 -0
- data/sample_app/spec/models/user_spec.rb +5 -0
- data/sample_app/spec/spec_helper.rb +27 -0
- data/sample_app/vendor/assets/javascripts/.gitkeep +0 -0
- data/sample_app/vendor/assets/stylesheets/.gitkeep +0 -0
- data/sample_app/vendor/plugins/.gitkeep +0 -0
- data/spec/config/shards.yml +217 -0
- data/spec/migrations/10_create_users_using_replication.rb +9 -0
- data/spec/migrations/11_add_field_in_all_slaves.rb +11 -0
- data/spec/migrations/12_create_users_using_block.rb +23 -0
- data/spec/migrations/13_create_users_using_block_and_using.rb +15 -0
- data/spec/migrations/14_create_users_on_shards_of_a_group_with_versions.rb +11 -0
- data/spec/migrations/15_create_user_on_shards_of_default_group_with_versions.rb +9 -0
- data/spec/migrations/1_create_users_on_master.rb +9 -0
- data/spec/migrations/2_create_users_on_canada.rb +11 -0
- data/spec/migrations/3_create_users_on_both_shards.rb +11 -0
- data/spec/migrations/4_create_users_on_shards_of_a_group.rb +11 -0
- data/spec/migrations/5_create_users_on_multiples_groups.rb +11 -0
- data/spec/migrations/6_raise_exception_with_invalid_shard_name.rb +11 -0
- data/spec/migrations/7_raise_exception_with_invalid_multiple_shard_names.rb +11 -0
- data/spec/migrations/8_raise_exception_with_invalid_group_name.rb +11 -0
- data/spec/migrations/9_raise_exception_with_multiple_invalid_group_names.rb +11 -0
- data/spec/octopus/association_shard_tracking_spec.rb +714 -0
- data/spec/octopus/collection_proxy_spec.rb +16 -0
- data/spec/octopus/log_subscriber_spec.rb +19 -0
- data/spec/octopus/migration_spec.rb +115 -0
- data/spec/octopus/model_spec.rb +693 -0
- data/spec/octopus/octopus_spec.rb +123 -0
- data/spec/octopus/proxy_spec.rb +307 -0
- data/spec/octopus/relation_proxy_spec.rb +93 -0
- data/spec/octopus/replicated_slave_grouped_spec.rb +91 -0
- data/spec/octopus/replication_spec.rb +137 -0
- data/spec/octopus/scope_proxy_spec.rb +63 -0
- data/spec/octopus/sharded_replicated_slave_grouped_spec.rb +55 -0
- data/spec/octopus/sharded_spec.rb +33 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/support/active_record/connection_adapters/modify_config_adapter.rb +15 -0
- data/spec/support/database_connection.rb +4 -0
- data/spec/support/database_models.rb +118 -0
- data/spec/support/octopus_helper.rb +55 -0
- data/spec/support/query_count.rb +17 -0
- data/spec/support/shared_contexts.rb +18 -0
- data/spec/tasks/octopus.rake_spec.rb +32 -0
- metadata +388 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
# Maps a name to a path. Used by the
|
3
|
+
#
|
4
|
+
# When /^I go to (.+)$/ do |page_name|
|
5
|
+
#
|
6
|
+
# step definition in web_steps.rb
|
7
|
+
#
|
8
|
+
def path_to(page_name)
|
9
|
+
case page_name
|
10
|
+
|
11
|
+
when /the home\s?page/
|
12
|
+
'/'
|
13
|
+
|
14
|
+
# Add more mappings here.
|
15
|
+
# Here is an example that pulls values out of the Regexp:
|
16
|
+
#
|
17
|
+
# when /^(.*)'s profile page$/i
|
18
|
+
# user_profile_path(User.find_by_login($1))
|
19
|
+
|
20
|
+
else
|
21
|
+
begin
|
22
|
+
page_name =~ /the (.*) page/
|
23
|
+
path_components = Regexp.last_match[1].split(/\s+/)
|
24
|
+
send(path_components.push('path').join('_').to_sym)
|
25
|
+
rescue
|
26
|
+
raise "Can't find mapping from \"#{page_name}\" to a path.\n" \
|
27
|
+
"Now, go and add a mapping in #{__FILE__}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
World(NavigationHelpers)
|
File without changes
|
File without changes
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
|
+
# files.
|
6
|
+
|
7
|
+
unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gems:* tasks
|
8
|
+
|
9
|
+
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
10
|
+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
11
|
+
|
12
|
+
begin
|
13
|
+
require 'cucumber/rake/task'
|
14
|
+
|
15
|
+
namespace :cucumber do
|
16
|
+
Cucumber::Rake::Task.new({ :ok => 'test:prepare' }, 'Run features that should pass') do |t|
|
17
|
+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
18
|
+
t.fork = true # You may get faster startup if you set this to false
|
19
|
+
t.profile = 'default'
|
20
|
+
end
|
21
|
+
|
22
|
+
Cucumber::Rake::Task.new({ :wip => 'test:prepare' }, 'Run features that are being worked on') do |t|
|
23
|
+
t.binary = vendored_cucumber_bin
|
24
|
+
t.fork = true # You may get faster startup if you set this to false
|
25
|
+
t.profile = 'wip'
|
26
|
+
end
|
27
|
+
|
28
|
+
Cucumber::Rake::Task.new({ :rerun => 'test:prepare' }, 'Record failing features and run only them if any exist') do |t|
|
29
|
+
t.binary = vendored_cucumber_bin
|
30
|
+
t.fork = true # You may get faster startup if you set this to false
|
31
|
+
t.profile = 'rerun'
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Run all features'
|
35
|
+
task :all => [:ok, :wip]
|
36
|
+
|
37
|
+
task :statsetup do
|
38
|
+
require 'rails/code_statistics'
|
39
|
+
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
|
40
|
+
::CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
desc 'Alias for cucumber:ok'
|
44
|
+
task :cucumber => 'cucumber:ok'
|
45
|
+
|
46
|
+
task :default => :cucumber
|
47
|
+
|
48
|
+
task :features => :cucumber do
|
49
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
50
|
+
end
|
51
|
+
|
52
|
+
# In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
|
53
|
+
task 'test:prepare' do
|
54
|
+
end
|
55
|
+
|
56
|
+
task :stats => 'cucumber:statsetup'
|
57
|
+
rescue LoadError
|
58
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
59
|
+
task :cucumber do
|
60
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|
Binary file
|
@@ -0,0 +1,279 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Ruby on Rails: Welcome aboard</title>
|
5
|
+
<style type="text/css" media="screen">
|
6
|
+
body {
|
7
|
+
margin: 0;
|
8
|
+
margin-bottom: 25px;
|
9
|
+
padding: 0;
|
10
|
+
background-color: #f0f0f0;
|
11
|
+
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
|
12
|
+
font-size: 13px;
|
13
|
+
color: #333;
|
14
|
+
}
|
15
|
+
|
16
|
+
h1 {
|
17
|
+
font-size: 28px;
|
18
|
+
color: #000;
|
19
|
+
}
|
20
|
+
|
21
|
+
a {color: #03c}
|
22
|
+
a:hover {
|
23
|
+
background-color: #03c;
|
24
|
+
color: white;
|
25
|
+
text-decoration: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
#page {
|
30
|
+
background-color: #f0f0f0;
|
31
|
+
width: 750px;
|
32
|
+
margin: 0;
|
33
|
+
margin-left: auto;
|
34
|
+
margin-right: auto;
|
35
|
+
}
|
36
|
+
|
37
|
+
#content {
|
38
|
+
float: left;
|
39
|
+
background-color: white;
|
40
|
+
border: 3px solid #aaa;
|
41
|
+
border-top: none;
|
42
|
+
padding: 25px;
|
43
|
+
width: 500px;
|
44
|
+
}
|
45
|
+
|
46
|
+
#sidebar {
|
47
|
+
float: right;
|
48
|
+
width: 175px;
|
49
|
+
}
|
50
|
+
|
51
|
+
#footer {
|
52
|
+
clear: both;
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
#header, #about, #getting-started {
|
57
|
+
padding-left: 75px;
|
58
|
+
padding-right: 30px;
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
#header {
|
63
|
+
background-image: url("images/rails.png");
|
64
|
+
background-repeat: no-repeat;
|
65
|
+
background-position: top left;
|
66
|
+
height: 64px;
|
67
|
+
}
|
68
|
+
#header h1, #header h2 {margin: 0}
|
69
|
+
#header h2 {
|
70
|
+
color: #888;
|
71
|
+
font-weight: normal;
|
72
|
+
font-size: 16px;
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
#about h3 {
|
77
|
+
margin: 0;
|
78
|
+
margin-bottom: 10px;
|
79
|
+
font-size: 14px;
|
80
|
+
}
|
81
|
+
|
82
|
+
#about-content {
|
83
|
+
background-color: #ffd;
|
84
|
+
border: 1px solid #fc0;
|
85
|
+
margin-left: -55px;
|
86
|
+
margin-right: -10px;
|
87
|
+
}
|
88
|
+
#about-content table {
|
89
|
+
margin-top: 10px;
|
90
|
+
margin-bottom: 10px;
|
91
|
+
font-size: 11px;
|
92
|
+
border-collapse: collapse;
|
93
|
+
}
|
94
|
+
#about-content td {
|
95
|
+
padding: 10px;
|
96
|
+
padding-top: 3px;
|
97
|
+
padding-bottom: 3px;
|
98
|
+
}
|
99
|
+
#about-content td.name {color: #555}
|
100
|
+
#about-content td.value {color: #000}
|
101
|
+
|
102
|
+
#about-content ul {
|
103
|
+
padding: 0;
|
104
|
+
list-style-type: none;
|
105
|
+
}
|
106
|
+
|
107
|
+
#about-content.failure {
|
108
|
+
background-color: #fcc;
|
109
|
+
border: 1px solid #f00;
|
110
|
+
}
|
111
|
+
#about-content.failure p {
|
112
|
+
margin: 0;
|
113
|
+
padding: 10px;
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
#getting-started {
|
118
|
+
border-top: 1px solid #ccc;
|
119
|
+
margin-top: 25px;
|
120
|
+
padding-top: 15px;
|
121
|
+
}
|
122
|
+
#getting-started h1 {
|
123
|
+
margin: 0;
|
124
|
+
font-size: 20px;
|
125
|
+
}
|
126
|
+
#getting-started h2 {
|
127
|
+
margin: 0;
|
128
|
+
font-size: 14px;
|
129
|
+
font-weight: normal;
|
130
|
+
color: #333;
|
131
|
+
margin-bottom: 25px;
|
132
|
+
}
|
133
|
+
#getting-started ol {
|
134
|
+
margin-left: 0;
|
135
|
+
padding-left: 0;
|
136
|
+
}
|
137
|
+
#getting-started li {
|
138
|
+
font-size: 18px;
|
139
|
+
color: #888;
|
140
|
+
margin-bottom: 25px;
|
141
|
+
}
|
142
|
+
#getting-started li h2 {
|
143
|
+
margin: 0;
|
144
|
+
font-weight: normal;
|
145
|
+
font-size: 18px;
|
146
|
+
color: #333;
|
147
|
+
}
|
148
|
+
#getting-started li p {
|
149
|
+
color: #555;
|
150
|
+
font-size: 13px;
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
#search {
|
155
|
+
margin: 0;
|
156
|
+
padding-top: 10px;
|
157
|
+
padding-bottom: 10px;
|
158
|
+
font-size: 11px;
|
159
|
+
}
|
160
|
+
#search input {
|
161
|
+
font-size: 11px;
|
162
|
+
margin: 2px;
|
163
|
+
}
|
164
|
+
#search-text {width: 170px}
|
165
|
+
|
166
|
+
|
167
|
+
#sidebar ul {
|
168
|
+
margin-left: 0;
|
169
|
+
padding-left: 0;
|
170
|
+
}
|
171
|
+
#sidebar ul h3 {
|
172
|
+
margin-top: 25px;
|
173
|
+
font-size: 16px;
|
174
|
+
padding-bottom: 10px;
|
175
|
+
border-bottom: 1px solid #ccc;
|
176
|
+
}
|
177
|
+
#sidebar li {
|
178
|
+
list-style-type: none;
|
179
|
+
}
|
180
|
+
#sidebar ul.links li {
|
181
|
+
margin-bottom: 5px;
|
182
|
+
}
|
183
|
+
|
184
|
+
</style>
|
185
|
+
<script type="text/javascript">
|
186
|
+
function about() {
|
187
|
+
info = document.getElementById('about-content');
|
188
|
+
if (window.XMLHttpRequest)
|
189
|
+
{ xhr = new XMLHttpRequest(); }
|
190
|
+
else
|
191
|
+
{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
|
192
|
+
xhr.open("GET","rails/info/properties",false);
|
193
|
+
xhr.send("");
|
194
|
+
info.innerHTML = xhr.responseText;
|
195
|
+
info.style.display = 'block'
|
196
|
+
}
|
197
|
+
|
198
|
+
function prepend() {
|
199
|
+
search = document.getElementById('search-text');
|
200
|
+
text = search.value;
|
201
|
+
search.value = 'site:rubyonrails.org ' + text;
|
202
|
+
}
|
203
|
+
|
204
|
+
window.onload = function() {
|
205
|
+
document.getElementById('search-text').value = '';
|
206
|
+
}
|
207
|
+
</script>
|
208
|
+
</head>
|
209
|
+
<body>
|
210
|
+
<div id="page">
|
211
|
+
<div id="sidebar">
|
212
|
+
<ul id="sidebar-items">
|
213
|
+
<li>
|
214
|
+
<form id="search" action="http://www.google.com/search" method="get" onSubmit="prepend();">
|
215
|
+
<input type="hidden" name="hl" value="en" />
|
216
|
+
<input type="text" id="search-text" name="q" value="site:rubyonrails.org " />
|
217
|
+
<input type="submit" value="Search" /> the Rails site
|
218
|
+
</form>
|
219
|
+
</li>
|
220
|
+
|
221
|
+
<li>
|
222
|
+
<h3>Join the community</h3>
|
223
|
+
<ul class="links">
|
224
|
+
<li><a href="http://www.rubyonrails.org/">Ruby on Rails</a></li>
|
225
|
+
<li><a href="http://weblog.rubyonrails.org/">Official weblog</a></li>
|
226
|
+
<li><a href="http://wiki.rubyonrails.org/">Wiki</a></li>
|
227
|
+
</ul>
|
228
|
+
</li>
|
229
|
+
|
230
|
+
<li>
|
231
|
+
<h3>Browse the documentation</h3>
|
232
|
+
<ul class="links">
|
233
|
+
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
|
234
|
+
<li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
|
235
|
+
<li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
|
236
|
+
<li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
|
237
|
+
</ul>
|
238
|
+
</li>
|
239
|
+
</ul>
|
240
|
+
</div>
|
241
|
+
|
242
|
+
<div id="content">
|
243
|
+
<div id="header">
|
244
|
+
<h1>Welcome aboard</h1>
|
245
|
+
<h2>You’re riding Ruby on Rails!</h2>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
<div id="about">
|
249
|
+
<h3><a href="rails/info/properties" onclick="about(); return false">About your application’s environment</a></h3>
|
250
|
+
<div id="about-content" style="display: none"></div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div id="getting-started">
|
254
|
+
<h1>Getting started</h1>
|
255
|
+
<h2>Here’s how to get rolling:</h2>
|
256
|
+
|
257
|
+
<ol>
|
258
|
+
<li>
|
259
|
+
<h2>Use <code>rails generate</code> to create your models and controllers</h2>
|
260
|
+
<p>To see all available options, run it without parameters.</p>
|
261
|
+
</li>
|
262
|
+
|
263
|
+
<li>
|
264
|
+
<h2>Set up a default route and remove or rename this file</h2>
|
265
|
+
<p>Routes are set up in config/routes.rb.</p>
|
266
|
+
</li>
|
267
|
+
|
268
|
+
<li>
|
269
|
+
<h2>Create your database</h2>
|
270
|
+
<p>Run <code>rake db:migrate</code> to create your database. If you're not using SQLite (the default), edit <code>config/database.yml</code> with your username and password.</p>
|
271
|
+
</li>
|
272
|
+
</ol>
|
273
|
+
</div>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
<div id="footer"> </div>
|
277
|
+
</div>
|
278
|
+
</body>
|
279
|
+
</html>
|