reflexive 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -1
- data/reflexive.gemspec +3 -1
- data/views/dashboard.erb +6 -6
- metadata +2 -125
- data/spec/test_apps/rails2_test_app/README +0 -243
- data/spec/test_apps/rails2_test_app/Rakefile +0 -10
- data/spec/test_apps/rails2_test_app/app/controllers/application_controller.rb +0 -10
- data/spec/test_apps/rails2_test_app/app/controllers/posts_controller.rb +0 -85
- data/spec/test_apps/rails2_test_app/app/helpers/application_helper.rb +0 -3
- data/spec/test_apps/rails2_test_app/app/helpers/posts_helper.rb +0 -2
- data/spec/test_apps/rails2_test_app/app/models/post.rb +0 -5
- data/spec/test_apps/rails2_test_app/app/views/layouts/posts.html.erb +0 -17
- data/spec/test_apps/rails2_test_app/app/views/posts/edit.html.erb +0 -12
- data/spec/test_apps/rails2_test_app/app/views/posts/index.html.erb +0 -18
- data/spec/test_apps/rails2_test_app/app/views/posts/new.html.erb +0 -11
- data/spec/test_apps/rails2_test_app/app/views/posts/show.html.erb +0 -3
- data/spec/test_apps/rails2_test_app/config/boot.rb +0 -110
- data/spec/test_apps/rails2_test_app/config/database.yml +0 -22
- data/spec/test_apps/rails2_test_app/config/environment.rb +0 -43
- data/spec/test_apps/rails2_test_app/config/environments/development.rb +0 -17
- data/spec/test_apps/rails2_test_app/config/environments/production.rb +0 -28
- data/spec/test_apps/rails2_test_app/config/environments/test.rb +0 -28
- data/spec/test_apps/rails2_test_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/test_apps/rails2_test_app/config/initializers/inflections.rb +0 -10
- data/spec/test_apps/rails2_test_app/config/initializers/mime_types.rb +0 -5
- data/spec/test_apps/rails2_test_app/config/initializers/new_rails_defaults.rb +0 -21
- data/spec/test_apps/rails2_test_app/config/initializers/session_store.rb +0 -15
- data/spec/test_apps/rails2_test_app/config/locales/en.yml +0 -5
- data/spec/test_apps/rails2_test_app/config/routes.rb +0 -45
- data/spec/test_apps/rails2_test_app/db/development.sqlite3 +0 -0
- data/spec/test_apps/rails2_test_app/db/migrate/20100512073155_create_posts.rb +0 -12
- data/spec/test_apps/rails2_test_app/db/schema.rb +0 -19
- data/spec/test_apps/rails2_test_app/db/seeds.rb +0 -7
- data/spec/test_apps/rails2_test_app/doc/README_FOR_APP +0 -2
- data/spec/test_apps/rails2_test_app/log/development.log +0 -251
- data/spec/test_apps/rails2_test_app/log/production.log +0 -0
- data/spec/test_apps/rails2_test_app/log/server.log +0 -0
- data/spec/test_apps/rails2_test_app/log/test.log +0 -0
- data/spec/test_apps/rails2_test_app/public/404.html +0 -30
- data/spec/test_apps/rails2_test_app/public/422.html +0 -30
- data/spec/test_apps/rails2_test_app/public/500.html +0 -30
- data/spec/test_apps/rails2_test_app/public/favicon.ico +0 -0
- data/spec/test_apps/rails2_test_app/public/images/rails.png +0 -0
- data/spec/test_apps/rails2_test_app/public/index.html +0 -275
- data/spec/test_apps/rails2_test_app/public/javascripts/application.js +0 -2
- data/spec/test_apps/rails2_test_app/public/javascripts/controls.js +0 -963
- data/spec/test_apps/rails2_test_app/public/javascripts/dragdrop.js +0 -973
- data/spec/test_apps/rails2_test_app/public/javascripts/effects.js +0 -1128
- data/spec/test_apps/rails2_test_app/public/javascripts/prototype.js +0 -4320
- data/spec/test_apps/rails2_test_app/public/robots.txt +0 -5
- data/spec/test_apps/rails2_test_app/public/stylesheets/1.css +0 -0
- data/spec/test_apps/rails2_test_app/public/stylesheets/scaffold.css +0 -54
- data/spec/test_apps/rails2_test_app/script/about +0 -4
- data/spec/test_apps/rails2_test_app/script/console +0 -3
- data/spec/test_apps/rails2_test_app/script/dbconsole +0 -3
- data/spec/test_apps/rails2_test_app/script/destroy +0 -3
- data/spec/test_apps/rails2_test_app/script/generate +0 -3
- data/spec/test_apps/rails2_test_app/script/performance/benchmarker +0 -3
- data/spec/test_apps/rails2_test_app/script/performance/profiler +0 -3
- data/spec/test_apps/rails2_test_app/script/plugin +0 -3
- data/spec/test_apps/rails2_test_app/script/runner +0 -3
- data/spec/test_apps/rails2_test_app/script/server +0 -3
- data/spec/test_apps/rails2_test_app/test/fixtures/posts.yml +0 -7
- data/spec/test_apps/rails2_test_app/test/functional/posts_controller_test.rb +0 -45
- data/spec/test_apps/rails2_test_app/test/performance/browsing_test.rb +0 -9
- data/spec/test_apps/rails2_test_app/test/test_helper.rb +0 -38
- data/spec/test_apps/rails2_test_app/test/unit/helpers/posts_helper_test.rb +0 -4
- data/spec/test_apps/rails2_test_app/test/unit/post_test.rb +0 -8
- data/spec/test_apps/rails3_test_app/Gemfile +0 -28
- data/spec/test_apps/rails3_test_app/README +0 -244
- data/spec/test_apps/rails3_test_app/Rakefile +0 -10
- data/spec/test_apps/rails3_test_app/app/controllers/application_controller.rb +0 -4
- data/spec/test_apps/rails3_test_app/app/controllers/posts_controller.rb +0 -83
- data/spec/test_apps/rails3_test_app/app/helpers/application_helper.rb +0 -2
- data/spec/test_apps/rails3_test_app/app/helpers/posts_helper.rb +0 -2
- data/spec/test_apps/rails3_test_app/app/models/post.rb +0 -2
- data/spec/test_apps/rails3_test_app/app/views/layouts/application.html.erb +0 -14
- data/spec/test_apps/rails3_test_app/app/views/posts/_form.html.erb +0 -16
- data/spec/test_apps/rails3_test_app/app/views/posts/edit.html.erb +0 -6
- data/spec/test_apps/rails3_test_app/app/views/posts/index.html.erb +0 -21
- data/spec/test_apps/rails3_test_app/app/views/posts/new.html.erb +0 -5
- data/spec/test_apps/rails3_test_app/app/views/posts/show.html.erb +0 -5
- data/spec/test_apps/rails3_test_app/config/application.rb +0 -49
- data/spec/test_apps/rails3_test_app/config/boot.rb +0 -6
- data/spec/test_apps/rails3_test_app/config/database.yml +0 -22
- data/spec/test_apps/rails3_test_app/config/environment.rb +0 -5
- data/spec/test_apps/rails3_test_app/config/environments/development.rb +0 -19
- data/spec/test_apps/rails3_test_app/config/environments/production.rb +0 -42
- data/spec/test_apps/rails3_test_app/config/environments/test.rb +0 -32
- data/spec/test_apps/rails3_test_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/test_apps/rails3_test_app/config/initializers/inflections.rb +0 -10
- data/spec/test_apps/rails3_test_app/config/initializers/mime_types.rb +0 -5
- data/spec/test_apps/rails3_test_app/config/initializers/secret_token.rb +0 -7
- data/spec/test_apps/rails3_test_app/config/initializers/session_store.rb +0 -8
- data/spec/test_apps/rails3_test_app/config/locales/en.yml +0 -5
- data/spec/test_apps/rails3_test_app/config/routes.rb +0 -60
- data/spec/test_apps/rails3_test_app/config.ru +0 -4
- data/spec/test_apps/rails3_test_app/db/development.sqlite3 +0 -0
- data/spec/test_apps/rails3_test_app/db/migrate/20100512075428_create_posts.rb +0 -12
- data/spec/test_apps/rails3_test_app/db/schema.rb +0 -19
- data/spec/test_apps/rails3_test_app/db/seeds.rb +0 -7
- data/spec/test_apps/rails3_test_app/doc/README_FOR_APP +0 -2
- data/spec/test_apps/rails3_test_app/log/development.log +0 -349
- data/spec/test_apps/rails3_test_app/log/production.log +0 -0
- data/spec/test_apps/rails3_test_app/log/server.log +0 -0
- data/spec/test_apps/rails3_test_app/log/test.log +0 -0
- data/spec/test_apps/rails3_test_app/public/404.html +0 -26
- data/spec/test_apps/rails3_test_app/public/422.html +0 -26
- data/spec/test_apps/rails3_test_app/public/500.html +0 -26
- data/spec/test_apps/rails3_test_app/public/favicon.ico +0 -0
- data/spec/test_apps/rails3_test_app/public/images/rails.png +0 -0
- data/spec/test_apps/rails3_test_app/public/index.html +0 -279
- data/spec/test_apps/rails3_test_app/public/javascripts/application.js +0 -2
- data/spec/test_apps/rails3_test_app/public/javascripts/controls.js +0 -965
- data/spec/test_apps/rails3_test_app/public/javascripts/dragdrop.js +0 -974
- data/spec/test_apps/rails3_test_app/public/javascripts/effects.js +0 -1123
- data/spec/test_apps/rails3_test_app/public/javascripts/prototype.js +0 -4874
- data/spec/test_apps/rails3_test_app/public/javascripts/rails.js +0 -118
- data/spec/test_apps/rails3_test_app/public/robots.txt +0 -5
- data/spec/test_apps/rails3_test_app/public/stylesheets/scaffold.css +0 -60
- data/spec/test_apps/rails3_test_app/script/rails +0 -9
- data/spec/test_apps/rails3_test_app/test/fixtures/posts.yml +0 -11
- data/spec/test_apps/rails3_test_app/test/functional/posts_controller_test.rb +0 -49
- data/spec/test_apps/rails3_test_app/test/performance/browsing_test.rb +0 -9
- data/spec/test_apps/rails3_test_app/test/test_helper.rb +0 -13
- data/spec/test_apps/rails3_test_app/test/unit/helpers/posts_helper_test.rb +0 -4
- data/spec/test_apps/rails3_test_app/test/unit/post_test.rb +0 -8
@@ -1,118 +0,0 @@
|
|
1
|
-
document.observe("dom:loaded", function() {
|
2
|
-
function handleRemote(element) {
|
3
|
-
var method, url, params;
|
4
|
-
|
5
|
-
if (element.tagName.toLowerCase() === 'form') {
|
6
|
-
method = element.readAttribute('method') || 'post';
|
7
|
-
url = element.readAttribute('action');
|
8
|
-
params = element.serialize(true);
|
9
|
-
} else {
|
10
|
-
method = element.readAttribute('data-method') || 'get';
|
11
|
-
url = element.readAttribute('href');
|
12
|
-
params = {};
|
13
|
-
}
|
14
|
-
|
15
|
-
var event = element.fire("ajax:before");
|
16
|
-
if (event.stopped) return false;
|
17
|
-
|
18
|
-
new Ajax.Request(url, {
|
19
|
-
method: method,
|
20
|
-
parameters: params,
|
21
|
-
asynchronous: true,
|
22
|
-
evalScripts: true,
|
23
|
-
|
24
|
-
onLoading: function(request) { element.fire("ajax:loading", {request: request}); },
|
25
|
-
onLoaded: function(request) { element.fire("ajax:loaded", {request: request}); },
|
26
|
-
onInteractive: function(request) { element.fire("ajax:interactive", {request: request}); },
|
27
|
-
onComplete: function(request) { element.fire("ajax:complete", {request: request}); },
|
28
|
-
onSuccess: function(request) { element.fire("ajax:success", {request: request}); },
|
29
|
-
onFailure: function(request) { element.fire("ajax:failure", {request: request}); }
|
30
|
-
});
|
31
|
-
|
32
|
-
element.fire("ajax:after");
|
33
|
-
}
|
34
|
-
|
35
|
-
function handleMethod(element) {
|
36
|
-
var method, url, token_name, token;
|
37
|
-
|
38
|
-
method = element.readAttribute('data-method');
|
39
|
-
url = element.readAttribute('href');
|
40
|
-
csrf_param = $$('meta[name=csrf-param]').first();
|
41
|
-
csrf_token = $$('meta[name=csrf-token]').first();
|
42
|
-
|
43
|
-
var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
|
44
|
-
element.parentNode.appendChild(form);
|
45
|
-
|
46
|
-
if (method != 'post') {
|
47
|
-
var field = new Element('input', { type: 'hidden', name: '_method', value: method });
|
48
|
-
form.appendChild(field);
|
49
|
-
}
|
50
|
-
|
51
|
-
if (csrf_param) {
|
52
|
-
var param = csrf_param.readAttribute('content');
|
53
|
-
var token = csrf_token.readAttribute('content');
|
54
|
-
var field = new Element('input', { type: 'hidden', name: param, value: token });
|
55
|
-
form.appendChild(field);
|
56
|
-
}
|
57
|
-
|
58
|
-
form.submit();
|
59
|
-
}
|
60
|
-
|
61
|
-
$(document.body).observe("click", function(event) {
|
62
|
-
var message = event.findElement().readAttribute('data-confirm');
|
63
|
-
if (message && !confirm(message)) {
|
64
|
-
event.stop();
|
65
|
-
return false;
|
66
|
-
}
|
67
|
-
|
68
|
-
var element = event.findElement("a[data-remote]");
|
69
|
-
if (element) {
|
70
|
-
handleRemote(element);
|
71
|
-
event.stop();
|
72
|
-
return true;
|
73
|
-
}
|
74
|
-
|
75
|
-
var element = event.findElement("a[data-method]");
|
76
|
-
if (element) {
|
77
|
-
handleMethod(element);
|
78
|
-
event.stop();
|
79
|
-
return true;
|
80
|
-
}
|
81
|
-
});
|
82
|
-
|
83
|
-
// TODO: I don't think submit bubbles in IE
|
84
|
-
$(document.body).observe("submit", function(event) {
|
85
|
-
var element = event.findElement(),
|
86
|
-
message = element.readAttribute('data-confirm');
|
87
|
-
if (message && !confirm(message)) {
|
88
|
-
event.stop();
|
89
|
-
return false;
|
90
|
-
}
|
91
|
-
|
92
|
-
var inputs = element.select("input[type=submit][data-disable-with]");
|
93
|
-
inputs.each(function(input) {
|
94
|
-
input.disabled = true;
|
95
|
-
input.writeAttribute('data-original-value', input.value);
|
96
|
-
input.value = input.readAttribute('data-disable-with');
|
97
|
-
});
|
98
|
-
|
99
|
-
var element = event.findElement("form[data-remote]");
|
100
|
-
if (element) {
|
101
|
-
handleRemote(element);
|
102
|
-
event.stop();
|
103
|
-
}
|
104
|
-
});
|
105
|
-
|
106
|
-
$(document.body).observe("ajax:after", function(event) {
|
107
|
-
var element = event.findElement();
|
108
|
-
|
109
|
-
if (element.tagName.toLowerCase() === 'form') {
|
110
|
-
var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
|
111
|
-
inputs.each(function(input) {
|
112
|
-
input.value = input.readAttribute('data-original-value');
|
113
|
-
input.writeAttribute('data-original-value', null);
|
114
|
-
input.disabled = false;
|
115
|
-
});
|
116
|
-
}
|
117
|
-
});
|
118
|
-
});
|
@@ -1,60 +0,0 @@
|
|
1
|
-
body { background-color: #fff; color: #333; }
|
2
|
-
|
3
|
-
body, p, ol, ul, td {
|
4
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
-
font-size: 13px;
|
6
|
-
line-height: 18px;
|
7
|
-
}
|
8
|
-
|
9
|
-
pre {
|
10
|
-
background-color: #eee;
|
11
|
-
padding: 10px;
|
12
|
-
font-size: 11px;
|
13
|
-
}
|
14
|
-
|
15
|
-
a { color: #000; }
|
16
|
-
a:visited { color: #666; }
|
17
|
-
a:hover { color: #fff; background-color:#000; }
|
18
|
-
|
19
|
-
div.field, div.actions {
|
20
|
-
margin-bottom: 10px;
|
21
|
-
}
|
22
|
-
|
23
|
-
.notice {
|
24
|
-
color: green;
|
25
|
-
}
|
26
|
-
|
27
|
-
.alert {
|
28
|
-
color: red;
|
29
|
-
}
|
30
|
-
|
31
|
-
.fieldWithErrors {
|
32
|
-
padding: 2px;
|
33
|
-
background-color: red;
|
34
|
-
display: table;
|
35
|
-
}
|
36
|
-
|
37
|
-
#errorExplanation {
|
38
|
-
width: 450px;
|
39
|
-
border: 2px solid red;
|
40
|
-
padding: 7px;
|
41
|
-
padding-bottom: 0;
|
42
|
-
margin-bottom: 20px;
|
43
|
-
background-color: #f0f0f0;
|
44
|
-
}
|
45
|
-
|
46
|
-
#errorExplanation h2 {
|
47
|
-
text-align: left;
|
48
|
-
font-weight: bold;
|
49
|
-
padding: 5px 5px 5px 15px;
|
50
|
-
font-size: 12px;
|
51
|
-
margin: -7px;
|
52
|
-
margin-bottom: 0px;
|
53
|
-
background-color: #c00;
|
54
|
-
color: #fff;
|
55
|
-
}
|
56
|
-
|
57
|
-
#errorExplanation ul li {
|
58
|
-
font-size: 12px;
|
59
|
-
list-style: square;
|
60
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
ENV_PATH = File.expand_path('../../config/environment', __FILE__)
|
5
|
-
BOOT_PATH = File.expand_path('../../config/boot', __FILE__)
|
6
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
7
|
-
|
8
|
-
require BOOT_PATH
|
9
|
-
require 'rails/commands'
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
-
|
3
|
-
# This model initially had no columns defined. If you add columns to the
|
4
|
-
# model remove the '{}' from the fixture names and add the columns immediately
|
5
|
-
# below each fixture, per the syntax in the comments below
|
6
|
-
#
|
7
|
-
one: {}
|
8
|
-
# column: value
|
9
|
-
#
|
10
|
-
two: {}
|
11
|
-
# column: value
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class PostsControllerTest < ActionController::TestCase
|
4
|
-
setup do
|
5
|
-
@post = posts(:one)
|
6
|
-
end
|
7
|
-
|
8
|
-
test "should get index" do
|
9
|
-
get :index
|
10
|
-
assert_response :success
|
11
|
-
assert_not_nil assigns(:posts)
|
12
|
-
end
|
13
|
-
|
14
|
-
test "should get new" do
|
15
|
-
get :new
|
16
|
-
assert_response :success
|
17
|
-
end
|
18
|
-
|
19
|
-
test "should create post" do
|
20
|
-
assert_difference('Post.count') do
|
21
|
-
post :create, :post => @post.attributes
|
22
|
-
end
|
23
|
-
|
24
|
-
assert_redirected_to post_path(assigns(:post))
|
25
|
-
end
|
26
|
-
|
27
|
-
test "should show post" do
|
28
|
-
get :show, :id => @post.to_param
|
29
|
-
assert_response :success
|
30
|
-
end
|
31
|
-
|
32
|
-
test "should get edit" do
|
33
|
-
get :edit, :id => @post.to_param
|
34
|
-
assert_response :success
|
35
|
-
end
|
36
|
-
|
37
|
-
test "should update post" do
|
38
|
-
put :update, :id => @post.to_param, :post => @post.attributes
|
39
|
-
assert_redirected_to post_path(assigns(:post))
|
40
|
-
end
|
41
|
-
|
42
|
-
test "should destroy post" do
|
43
|
-
assert_difference('Post.count', -1) do
|
44
|
-
delete :destroy, :id => @post.to_param
|
45
|
-
end
|
46
|
-
|
47
|
-
assert_redirected_to posts_path
|
48
|
-
end
|
49
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
ENV["RAILS_ENV"] = "test"
|
2
|
-
require File.expand_path('../../config/environment', __FILE__)
|
3
|
-
require 'rails/test_help'
|
4
|
-
|
5
|
-
class ActiveSupport::TestCase
|
6
|
-
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
7
|
-
#
|
8
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
-
# -- they do not yet inherit this setting
|
10
|
-
fixtures :all
|
11
|
-
|
12
|
-
# Add more helper methods to be used by all tests here...
|
13
|
-
end
|