rateable 0.0.7 → 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.
- data/.gitignore +3 -0
- data/Gemfile +5 -0
- data/README.rdoc +1 -1
- data/Rakefile +14 -0
- data/lib/rateable/helper.rb +3 -2
- data/lib/rateable/is_rateable.rb +18 -3
- data/lib/rateable/rate.rb +7 -1
- data/lib/rateable/rater.rb +1 -1
- data/lib/rateable/version.rb +1 -1
- data/rateable.gemspec +6 -0
- data/spec/controllers/application_controller_spec.rb +48 -0
- data/spec/controllers/pictures_controller_spec.rb +57 -0
- data/spec/factories.rb +8 -0
- data/spec/models/rateable_spec.rb +70 -0
- data/spec/models/rater_spec.rb +32 -0
- data/spec/requests/pictures_spec.rb +66 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/test_app/.gitignore +4 -0
- data/spec/test_app/.rspec +1 -0
- data/spec/test_app/Gemfile +37 -0
- data/spec/test_app/README +256 -0
- data/spec/test_app/Rakefile +7 -0
- data/spec/test_app/app/controllers/application_controller.rb +20 -0
- data/spec/test_app/app/controllers/pictures_controller.rb +19 -0
- data/spec/test_app/app/helpers/application_helper.rb +2 -0
- data/spec/test_app/app/helpers/pictures_helper.rb +2 -0
- data/spec/test_app/app/models/picture.rb +3 -0
- data/spec/test_app/app/models/user.rb +3 -0
- data/spec/test_app/app/views/layouts/application.html.erb +14 -0
- data/spec/test_app/app/views/pictures/show.html.erb +3 -0
- data/spec/test_app/config.ru +4 -0
- data/spec/test_app/config/app_config.yml +2 -0
- data/spec/test_app/config/application.rb +42 -0
- data/spec/test_app/config/boot.rb +6 -0
- data/spec/test_app/config/database.yml +22 -0
- data/spec/test_app/config/environment.rb +5 -0
- data/spec/test_app/config/environments/development.rb +26 -0
- data/spec/test_app/config/environments/production.rb +49 -0
- data/spec/test_app/config/environments/test.rb +35 -0
- data/spec/test_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/test_app/config/initializers/inflections.rb +10 -0
- data/spec/test_app/config/initializers/mime_types.rb +5 -0
- data/spec/test_app/config/initializers/secret_token.rb +7 -0
- data/spec/test_app/config/initializers/session_store.rb +8 -0
- data/spec/test_app/config/locales/en.yml +5 -0
- data/spec/test_app/config/routes.rb +69 -0
- data/spec/test_app/db/migrate/20110806140922_create_users.rb +13 -0
- data/spec/test_app/db/migrate/20110806140953_create_pictures.rb +13 -0
- data/spec/test_app/db/migrate/20110806141552_rateable_migration.rb +15 -0
- data/spec/test_app/db/schema.rb +35 -0
- data/spec/test_app/db/seeds.rb +7 -0
- data/spec/test_app/doc/README_FOR_APP +2 -0
- data/spec/test_app/public/404.html +26 -0
- data/spec/test_app/public/422.html +26 -0
- data/spec/test_app/public/500.html +26 -0
- data/spec/test_app/public/favicon.ico +0 -0
- data/spec/test_app/public/images/rails.png +0 -0
- data/spec/test_app/public/images/rateable/star_filled.png +0 -0
- data/spec/test_app/public/images/rateable/star_unfilled.png +0 -0
- data/spec/test_app/public/javascripts/application.js +2 -0
- data/spec/test_app/public/javascripts/controls.js +965 -0
- data/spec/test_app/public/javascripts/dragdrop.js +974 -0
- data/spec/test_app/public/javascripts/effects.js +1123 -0
- data/spec/test_app/public/javascripts/jquery.js +8374 -0
- data/spec/test_app/public/javascripts/prototype.js +6001 -0
- data/spec/test_app/public/javascripts/rails.js +196 -0
- data/spec/test_app/public/javascripts/rateable.js +29 -0
- data/spec/test_app/public/robots.txt +5 -0
- data/spec/test_app/public/stylesheets/rateable.css +22 -0
- data/spec/test_app/script/rails +6 -0
- data/spec/test_app/spec/helpers/application_spec.rb +48 -0
- data/spec/test_app/spec/spec_helper.rb +42 -0
- metadata +154 -4
@@ -0,0 +1,196 @@
|
|
1
|
+
/**
|
2
|
+
* Unobtrusive scripting adapter for jQuery
|
3
|
+
*
|
4
|
+
* Requires jQuery 1.4.3 or later.
|
5
|
+
* https://github.com/rails/jquery-ujs
|
6
|
+
|
7
|
+
* Uploading file using rails.js
|
8
|
+
*
|
9
|
+
* By default, browsers do not allow files to be uploaded via AJAX. As a result, when this rails.js adapter submits remote forms,
|
10
|
+
* any file input fields are excluded from the request parameters sent to the server. You may cancel the whole form submission by
|
11
|
+
* binding a handler function that returns false to the `ajax:aborted:file` hook.
|
12
|
+
*
|
13
|
+
* Ex:
|
14
|
+
* $('form').live('ajax:aborted:file', function(){
|
15
|
+
* alert("File detected. Form submission canceled.");
|
16
|
+
* return false;
|
17
|
+
* });
|
18
|
+
*
|
19
|
+
* The `ajax:aborted:file` event is fired when a form is submitted and both conditions are met:
|
20
|
+
* a) file-type input field is detected, and
|
21
|
+
* b) the value of the input:file field is not blank.
|
22
|
+
*
|
23
|
+
* Third party tools can use this hook to detect when an AJAX file upload is attempted, and then use techniques like the iframe method to upload the file instead.
|
24
|
+
*
|
25
|
+
* Similarly, rails.js aborts AJAX form submissions if any non-blank input[required] fields are detected, providing the `ajax:aborted:required` hook.
|
26
|
+
* Unlike file uploads, however, blank required input fields cancel the whole form submission by default.
|
27
|
+
*/
|
28
|
+
|
29
|
+
(function($) {
|
30
|
+
// Make sure that every Ajax request sends the CSRF token
|
31
|
+
function CSRFProtection(xhr) {
|
32
|
+
var token = $('meta[name="csrf-token"]').attr('content');
|
33
|
+
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
34
|
+
}
|
35
|
+
if ('ajaxPrefilter' in $) $.ajaxPrefilter(function(options, originalOptions, xhr){ CSRFProtection(xhr) });
|
36
|
+
else $(document).ajaxSend(function(e, xhr){ CSRFProtection(xhr) });
|
37
|
+
|
38
|
+
// Triggers an event on an element and returns the event result
|
39
|
+
function fire(obj, name, data) {
|
40
|
+
var event = $.Event(name);
|
41
|
+
obj.trigger(event, data);
|
42
|
+
return event.result !== false;
|
43
|
+
}
|
44
|
+
|
45
|
+
// Submits "remote" forms and links with ajax
|
46
|
+
function handleRemote(element) {
|
47
|
+
var method, url, data,
|
48
|
+
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
49
|
+
|
50
|
+
if (fire(element, 'ajax:before')) {
|
51
|
+
if (element.is('form')) {
|
52
|
+
method = element.attr('method');
|
53
|
+
url = element.attr('action');
|
54
|
+
data = element.serializeArray();
|
55
|
+
// memoized value from clicked submit button
|
56
|
+
var button = element.data('ujs:submit-button');
|
57
|
+
if (button) {
|
58
|
+
data.push(button);
|
59
|
+
element.data('ujs:submit-button', null);
|
60
|
+
}
|
61
|
+
} else {
|
62
|
+
method = element.data('method');
|
63
|
+
url = element.attr('href');
|
64
|
+
data = null;
|
65
|
+
}
|
66
|
+
$.ajax({
|
67
|
+
url: url, type: method || 'GET', data: data, dataType: dataType,
|
68
|
+
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
69
|
+
beforeSend: function(xhr, settings) {
|
70
|
+
if (settings.dataType === undefined) {
|
71
|
+
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
72
|
+
}
|
73
|
+
return fire(element, 'ajax:beforeSend', [xhr, settings]);
|
74
|
+
},
|
75
|
+
success: function(data, status, xhr) {
|
76
|
+
element.trigger('ajax:success', [data, status, xhr]);
|
77
|
+
},
|
78
|
+
complete: function(xhr, status) {
|
79
|
+
element.trigger('ajax:complete', [xhr, status]);
|
80
|
+
},
|
81
|
+
error: function(xhr, status, error) {
|
82
|
+
element.trigger('ajax:error', [xhr, status, error]);
|
83
|
+
}
|
84
|
+
});
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
// Handles "data-method" on links such as:
|
89
|
+
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
90
|
+
function handleMethod(link) {
|
91
|
+
var href = link.attr('href'),
|
92
|
+
method = link.data('method'),
|
93
|
+
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
94
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
95
|
+
form = $('<form method="post" action="' + href + '"></form>'),
|
96
|
+
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
97
|
+
|
98
|
+
if (csrf_param !== undefined && csrf_token !== undefined) {
|
99
|
+
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
100
|
+
}
|
101
|
+
|
102
|
+
form.hide().append(metadata_input).appendTo('body');
|
103
|
+
form.submit();
|
104
|
+
}
|
105
|
+
|
106
|
+
function disableFormElements(form) {
|
107
|
+
form.find('input[data-disable-with], button[data-disable-with]').each(function() {
|
108
|
+
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
109
|
+
element.data('ujs:enable-with', element[method]());
|
110
|
+
element[method](element.data('disable-with'));
|
111
|
+
element.attr('disabled', 'disabled');
|
112
|
+
});
|
113
|
+
}
|
114
|
+
|
115
|
+
function enableFormElements(form) {
|
116
|
+
form.find('input[data-disable-with]:disabled, button[data-disable-with]:disabled').each(function() {
|
117
|
+
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
118
|
+
if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
|
119
|
+
element.removeAttr('disabled');
|
120
|
+
});
|
121
|
+
}
|
122
|
+
|
123
|
+
function allowAction(element) {
|
124
|
+
var message = element.data('confirm');
|
125
|
+
return !message || (fire(element, 'confirm') && confirm(message));
|
126
|
+
}
|
127
|
+
|
128
|
+
function blankInputs(form, specifiedSelector) {
|
129
|
+
var blankExists = false,
|
130
|
+
selector = specifiedSelector || 'input';
|
131
|
+
form.find(selector).each(function() {
|
132
|
+
if (!$(this).val()) blankExists = true;
|
133
|
+
});
|
134
|
+
return blankExists;
|
135
|
+
}
|
136
|
+
|
137
|
+
function nonBlankInputs(form, specifiedSelector) {
|
138
|
+
var nonBlankExists = false,
|
139
|
+
selector = specifiedSelector || 'input';
|
140
|
+
form.find(selector).each(function() {
|
141
|
+
if ($(this).val()) nonBlankExists = true;
|
142
|
+
});
|
143
|
+
return nonBlankExists;
|
144
|
+
}
|
145
|
+
|
146
|
+
$('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) {
|
147
|
+
var link = $(this);
|
148
|
+
if (!allowAction(link)) return false;
|
149
|
+
|
150
|
+
if (link.data('remote') != undefined) {
|
151
|
+
handleRemote(link);
|
152
|
+
return false;
|
153
|
+
} else if (link.data('method')) {
|
154
|
+
handleMethod(link);
|
155
|
+
return false;
|
156
|
+
}
|
157
|
+
});
|
158
|
+
|
159
|
+
$('form').live('submit.rails', function(e) {
|
160
|
+
var form = $(this), remote = form.data('remote') != undefined;
|
161
|
+
if (!allowAction(form)) return false;
|
162
|
+
|
163
|
+
// skip other logic when required values are missing or file upload is present
|
164
|
+
if (blankInputs(form, 'input[name][required]')) {
|
165
|
+
form.trigger('ajax:aborted:required');
|
166
|
+
return !remote;
|
167
|
+
}
|
168
|
+
if (nonBlankInputs(form, 'input:file')) {
|
169
|
+
return fire(form, 'ajax:aborted:file');
|
170
|
+
}
|
171
|
+
|
172
|
+
if (remote) {
|
173
|
+
handleRemote(form);
|
174
|
+
return false;
|
175
|
+
} else {
|
176
|
+
// slight timeout so that the submit button gets properly serialized
|
177
|
+
setTimeout(function(){ disableFormElements(form) }, 13);
|
178
|
+
}
|
179
|
+
});
|
180
|
+
|
181
|
+
$('form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])').live('click.rails', function() {
|
182
|
+
var button = $(this);
|
183
|
+
if (!allowAction(button)) return false;
|
184
|
+
// register the pressed submit button
|
185
|
+
var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null;
|
186
|
+
button.closest('form').data('ujs:submit-button', data);
|
187
|
+
});
|
188
|
+
|
189
|
+
$('form').live('ajax:beforeSend.rails', function(event) {
|
190
|
+
if (this == event.target) disableFormElements($(this));
|
191
|
+
});
|
192
|
+
|
193
|
+
$('form').live('ajax:complete.rails', function(event) {
|
194
|
+
if (this == event.target) enableFormElements($(this));
|
195
|
+
});
|
196
|
+
})( jQuery );
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/* DO NOT MODIFY. This file was compiled Fri, 05 Aug 2011 22:17:18 GMT from
|
2
|
+
* /home/andre/Dokumente/yvi/comics/app/coffeescripts/rateable.coffee
|
3
|
+
*/
|
4
|
+
|
5
|
+
var rate;
|
6
|
+
rate = function(star) {
|
7
|
+
var stars, url;
|
8
|
+
url = star.data()["url"];
|
9
|
+
stars = star.data()["stars"];
|
10
|
+
return $.ajax(url, {
|
11
|
+
type: "POST",
|
12
|
+
data: {
|
13
|
+
stars: stars
|
14
|
+
},
|
15
|
+
dataType: "html",
|
16
|
+
error: function(resp) {
|
17
|
+
return window.reload();
|
18
|
+
},
|
19
|
+
success: function(resp) {
|
20
|
+
return star.parent().replaceWith(resp);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
};
|
24
|
+
jQuery(function() {
|
25
|
+
return $(".rating a").bind("click", function(e) {
|
26
|
+
rate($(this));
|
27
|
+
return e.preventDefault();
|
28
|
+
});
|
29
|
+
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.rating {
|
2
|
+
position: relative;
|
3
|
+
height: 32px;
|
4
|
+
background: url(/images/rateable/star_unfilled.png) top left repeat-x;
|
5
|
+
}
|
6
|
+
|
7
|
+
.rating a {
|
8
|
+
position: absolute;
|
9
|
+
height: 32px;
|
10
|
+
text-decoration: none;
|
11
|
+
}
|
12
|
+
|
13
|
+
.rating img {
|
14
|
+
position: absolute;
|
15
|
+
width: 32px;
|
16
|
+
text-decoration: none;
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
.rating .rate:hover {
|
21
|
+
background: url(/images/rateable/star_filled.png) bottom left repeat-x;
|
22
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby1.8
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,48 @@
|
|
1
|
+
describe ApplicationHelper do
|
2
|
+
include Rateable::Helper
|
3
|
+
|
4
|
+
describe :rating_for do
|
5
|
+
before(:each) do
|
6
|
+
@picture = Factory(:picture)
|
7
|
+
@user = Factory(:user)
|
8
|
+
end
|
9
|
+
|
10
|
+
def current_user
|
11
|
+
@user
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should render the rate partial if logged in and not rated yet" do
|
15
|
+
rating_for @picture
|
16
|
+
assert_template :partial => "rateable/_rate"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should render the ratings partial if logged in and already rated" do
|
20
|
+
@user.rate @picture, 1
|
21
|
+
rating_for @picture
|
22
|
+
assert_template :partial => "rateable/_rating"
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should raise an error if the object given is not rateable" do
|
26
|
+
lambda{rating_for(@user)}.should raise_error
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should show ratings if not logged_in" do
|
30
|
+
@user = nil
|
31
|
+
rating_for(@picture)
|
32
|
+
assert_template :partial => "rateable/_rating"
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should show the rate partial if user is given as parameter" do
|
36
|
+
@user = nil
|
37
|
+
rating_for @picture, :user => Factory(:user)
|
38
|
+
assert_template :partial => "rateable/_rate"
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should use given url if user allowed to rate" do
|
42
|
+
url = "test123"
|
43
|
+
rating_for @picture, :url => url
|
44
|
+
rendered.should include(url)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
require 'capybara/rspec'
|
6
|
+
require 'capybara/rails'
|
7
|
+
|
8
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
9
|
+
# in spec/support/ and its subdirectories.
|
10
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
# == Mock Framework
|
14
|
+
#
|
15
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
16
|
+
#
|
17
|
+
# config.mock_with :mocha
|
18
|
+
# config.mock_with :flexmock
|
19
|
+
# config.mock_with :rr
|
20
|
+
config.mock_with :rspec
|
21
|
+
|
22
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
23
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
24
|
+
|
25
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
26
|
+
# examples within a transaction, remove the following line or assign false
|
27
|
+
# instead of true.
|
28
|
+
config.use_transactional_fixtures = false
|
29
|
+
|
30
|
+
config.before(:suite) do
|
31
|
+
DatabaseCleaner.strategy = :truncation
|
32
|
+
end
|
33
|
+
|
34
|
+
config.before(:each) do
|
35
|
+
DatabaseCleaner.start
|
36
|
+
end
|
37
|
+
|
38
|
+
config.after(:each) do
|
39
|
+
DatabaseCleaner.clean
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rateable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.7
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Andr\xC3\xA9 Domnick"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-07 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|
@@ -49,6 +49,90 @@ dependencies:
|
|
49
49
|
version: 3.0.0
|
50
50
|
type: :runtime
|
51
51
|
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: meta_where
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
version: "0"
|
64
|
+
type: :runtime
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: rspec
|
68
|
+
prerelease: false
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: capybara
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 3
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
92
|
+
type: :development
|
93
|
+
version_requirements: *id005
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rspec-rails
|
96
|
+
prerelease: false
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
hash: 3
|
103
|
+
segments:
|
104
|
+
- 0
|
105
|
+
version: "0"
|
106
|
+
type: :development
|
107
|
+
version_requirements: *id006
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
name: factory_girl_rails
|
110
|
+
prerelease: false
|
111
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
hash: 3
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
version: "0"
|
120
|
+
type: :development
|
121
|
+
version_requirements: *id007
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
name: factory_girl
|
124
|
+
prerelease: false
|
125
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
126
|
+
none: false
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
hash: 3
|
131
|
+
segments:
|
132
|
+
- 0
|
133
|
+
version: "0"
|
134
|
+
type: :development
|
135
|
+
version_requirements: *id008
|
52
136
|
description: A way for simply adding an ajax rating to any of your models
|
53
137
|
email:
|
54
138
|
- andre@paniccrew.de
|
@@ -80,6 +164,72 @@ files:
|
|
80
164
|
- lib/rateable/rater.rb
|
81
165
|
- lib/rateable/version.rb
|
82
166
|
- rateable.gemspec
|
167
|
+
- spec/controllers/application_controller_spec.rb
|
168
|
+
- spec/controllers/pictures_controller_spec.rb
|
169
|
+
- spec/factories.rb
|
170
|
+
- spec/models/rateable_spec.rb
|
171
|
+
- spec/models/rater_spec.rb
|
172
|
+
- spec/requests/pictures_spec.rb
|
173
|
+
- spec/spec.opts
|
174
|
+
- spec/spec_helper.rb
|
175
|
+
- spec/test_app/.gitignore
|
176
|
+
- spec/test_app/.rspec
|
177
|
+
- spec/test_app/Gemfile
|
178
|
+
- spec/test_app/README
|
179
|
+
- spec/test_app/Rakefile
|
180
|
+
- spec/test_app/app/controllers/application_controller.rb
|
181
|
+
- spec/test_app/app/controllers/pictures_controller.rb
|
182
|
+
- spec/test_app/app/helpers/application_helper.rb
|
183
|
+
- spec/test_app/app/helpers/pictures_helper.rb
|
184
|
+
- spec/test_app/app/models/picture.rb
|
185
|
+
- spec/test_app/app/models/user.rb
|
186
|
+
- spec/test_app/app/views/layouts/application.html.erb
|
187
|
+
- spec/test_app/app/views/pictures/show.html.erb
|
188
|
+
- spec/test_app/config.ru
|
189
|
+
- spec/test_app/config/app_config.yml
|
190
|
+
- spec/test_app/config/application.rb
|
191
|
+
- spec/test_app/config/boot.rb
|
192
|
+
- spec/test_app/config/database.yml
|
193
|
+
- spec/test_app/config/environment.rb
|
194
|
+
- spec/test_app/config/environments/development.rb
|
195
|
+
- spec/test_app/config/environments/production.rb
|
196
|
+
- spec/test_app/config/environments/test.rb
|
197
|
+
- spec/test_app/config/initializers/backtrace_silencers.rb
|
198
|
+
- spec/test_app/config/initializers/inflections.rb
|
199
|
+
- spec/test_app/config/initializers/mime_types.rb
|
200
|
+
- spec/test_app/config/initializers/secret_token.rb
|
201
|
+
- spec/test_app/config/initializers/session_store.rb
|
202
|
+
- spec/test_app/config/locales/en.yml
|
203
|
+
- spec/test_app/config/routes.rb
|
204
|
+
- spec/test_app/db/migrate/20110806140922_create_users.rb
|
205
|
+
- spec/test_app/db/migrate/20110806140953_create_pictures.rb
|
206
|
+
- spec/test_app/db/migrate/20110806141552_rateable_migration.rb
|
207
|
+
- spec/test_app/db/schema.rb
|
208
|
+
- spec/test_app/db/seeds.rb
|
209
|
+
- spec/test_app/doc/README_FOR_APP
|
210
|
+
- spec/test_app/lib/tasks/.gitkeep
|
211
|
+
- spec/test_app/public/404.html
|
212
|
+
- spec/test_app/public/422.html
|
213
|
+
- spec/test_app/public/500.html
|
214
|
+
- spec/test_app/public/favicon.ico
|
215
|
+
- spec/test_app/public/images/rails.png
|
216
|
+
- spec/test_app/public/images/rateable/star_filled.png
|
217
|
+
- spec/test_app/public/images/rateable/star_unfilled.png
|
218
|
+
- spec/test_app/public/javascripts/application.js
|
219
|
+
- spec/test_app/public/javascripts/controls.js
|
220
|
+
- spec/test_app/public/javascripts/dragdrop.js
|
221
|
+
- spec/test_app/public/javascripts/effects.js
|
222
|
+
- spec/test_app/public/javascripts/jquery.js
|
223
|
+
- spec/test_app/public/javascripts/prototype.js
|
224
|
+
- spec/test_app/public/javascripts/rails.js
|
225
|
+
- spec/test_app/public/javascripts/rateable.js
|
226
|
+
- spec/test_app/public/robots.txt
|
227
|
+
- spec/test_app/public/stylesheets/.gitkeep
|
228
|
+
- spec/test_app/public/stylesheets/rateable.css
|
229
|
+
- spec/test_app/script/rails
|
230
|
+
- spec/test_app/spec/helpers/application_spec.rb
|
231
|
+
- spec/test_app/spec/spec_helper.rb
|
232
|
+
- spec/test_app/vendor/plugins/.gitkeep
|
83
233
|
homepage: ""
|
84
234
|
licenses: []
|
85
235
|
|