validates_overlap 0.0.1
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/Gemfile +13 -0
- data/Gemfile.lock +100 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +21 -0
- data/Rakefile +43 -0
- data/VERSION +1 -0
- data/lib/overlap_validator.rb +84 -0
- data/lib/validates_overlap.rb +1 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/meeting.rb +3 -0
- data/spec/dummy/app/models/user.rb +2 -0
- data/spec/dummy/app/models/user_meeting.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +26 -0
- data/spec/dummy/config/environments/production.rb +49 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/20110406082020_create_meetings.rb +13 -0
- data/spec/dummy/db/migrate/20110406082053_create_users.rb +13 -0
- data/spec/dummy/db/migrate/20110407060725_create_user_meetings.rb +15 -0
- data/spec/dummy/db/schema.rb +36 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/controls.js +965 -0
- data/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/spec/dummy/public/javascripts/effects.js +1123 -0
- data/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/spec/dummy/public/javascripts/rails.js +191 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/factories/meeting.rb +4 -0
- data/spec/dummy/spec/factories/user.rb +3 -0
- data/spec/dummy/spec/factories/user_meeting.rb +11 -0
- data/spec/dummy/spec/models/meeting_spec.rb +53 -0
- data/spec/dummy/spec/models/user_meeting_spec.rb +37 -0
- data/spec/dummy/spec/models/user_spec.rb +11 -0
- data/spec/spec_helper.rb +29 -0
- data/validates_overlap.gemspec +147 -0
- metadata +272 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
(function() {
|
2
|
+
// Technique from Juriy Zaytsev
|
3
|
+
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
|
4
|
+
function isEventSupported(eventName) {
|
5
|
+
var el = document.createElement('div');
|
6
|
+
eventName = 'on' + eventName;
|
7
|
+
var isSupported = (eventName in el);
|
8
|
+
if (!isSupported) {
|
9
|
+
el.setAttribute(eventName, 'return;');
|
10
|
+
isSupported = typeof el[eventName] == 'function';
|
11
|
+
}
|
12
|
+
el = null;
|
13
|
+
return isSupported;
|
14
|
+
}
|
15
|
+
|
16
|
+
function isForm(element) {
|
17
|
+
return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
|
18
|
+
}
|
19
|
+
|
20
|
+
function isInput(element) {
|
21
|
+
if (Object.isElement(element)) {
|
22
|
+
var name = element.nodeName.toUpperCase()
|
23
|
+
return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
|
24
|
+
}
|
25
|
+
else return false
|
26
|
+
}
|
27
|
+
|
28
|
+
var submitBubbles = isEventSupported('submit'),
|
29
|
+
changeBubbles = isEventSupported('change')
|
30
|
+
|
31
|
+
if (!submitBubbles || !changeBubbles) {
|
32
|
+
// augment the Event.Handler class to observe custom events when needed
|
33
|
+
Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
|
34
|
+
function(init, element, eventName, selector, callback) {
|
35
|
+
init(element, eventName, selector, callback)
|
36
|
+
// is the handler being attached to an element that doesn't support this event?
|
37
|
+
if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
|
38
|
+
(!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
|
39
|
+
// "submit" => "emulated:submit"
|
40
|
+
this.eventName = 'emulated:' + this.eventName
|
41
|
+
}
|
42
|
+
}
|
43
|
+
)
|
44
|
+
}
|
45
|
+
|
46
|
+
if (!submitBubbles) {
|
47
|
+
// discover forms on the page by observing focus events which always bubble
|
48
|
+
document.on('focusin', 'form', function(focusEvent, form) {
|
49
|
+
// special handler for the real "submit" event (one-time operation)
|
50
|
+
if (!form.retrieve('emulated:submit')) {
|
51
|
+
form.on('submit', function(submitEvent) {
|
52
|
+
var emulated = form.fire('emulated:submit', submitEvent, true)
|
53
|
+
// if custom event received preventDefault, cancel the real one too
|
54
|
+
if (emulated.returnValue === false) submitEvent.preventDefault()
|
55
|
+
})
|
56
|
+
form.store('emulated:submit', true)
|
57
|
+
}
|
58
|
+
})
|
59
|
+
}
|
60
|
+
|
61
|
+
if (!changeBubbles) {
|
62
|
+
// discover form inputs on the page
|
63
|
+
document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
|
64
|
+
// special handler for real "change" events
|
65
|
+
if (!input.retrieve('emulated:change')) {
|
66
|
+
input.on('change', function(changeEvent) {
|
67
|
+
input.fire('emulated:change', changeEvent, true)
|
68
|
+
})
|
69
|
+
input.store('emulated:change', true)
|
70
|
+
}
|
71
|
+
})
|
72
|
+
}
|
73
|
+
|
74
|
+
function handleRemote(element) {
|
75
|
+
var method, url, params;
|
76
|
+
|
77
|
+
var event = element.fire("ajax:before");
|
78
|
+
if (event.stopped) return false;
|
79
|
+
|
80
|
+
if (element.tagName.toLowerCase() === 'form') {
|
81
|
+
method = element.readAttribute('method') || 'post';
|
82
|
+
url = element.readAttribute('action');
|
83
|
+
params = element.serialize();
|
84
|
+
} else {
|
85
|
+
method = element.readAttribute('data-method') || 'get';
|
86
|
+
url = element.readAttribute('href');
|
87
|
+
params = {};
|
88
|
+
}
|
89
|
+
|
90
|
+
new Ajax.Request(url, {
|
91
|
+
method: method,
|
92
|
+
parameters: params,
|
93
|
+
evalScripts: true,
|
94
|
+
|
95
|
+
onComplete: function(request) { element.fire("ajax:complete", request); },
|
96
|
+
onSuccess: function(request) { element.fire("ajax:success", request); },
|
97
|
+
onFailure: function(request) { element.fire("ajax:failure", request); }
|
98
|
+
});
|
99
|
+
|
100
|
+
element.fire("ajax:after");
|
101
|
+
}
|
102
|
+
|
103
|
+
function handleMethod(element) {
|
104
|
+
var method = element.readAttribute('data-method'),
|
105
|
+
url = element.readAttribute('href'),
|
106
|
+
csrf_param = $$('meta[name=csrf-param]')[0],
|
107
|
+
csrf_token = $$('meta[name=csrf-token]')[0];
|
108
|
+
|
109
|
+
var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
|
110
|
+
element.parentNode.insert(form);
|
111
|
+
|
112
|
+
if (method !== 'post') {
|
113
|
+
var field = new Element('input', { type: 'hidden', name: '_method', value: method });
|
114
|
+
form.insert(field);
|
115
|
+
}
|
116
|
+
|
117
|
+
if (csrf_param) {
|
118
|
+
var param = csrf_param.readAttribute('content'),
|
119
|
+
token = csrf_token.readAttribute('content'),
|
120
|
+
field = new Element('input', { type: 'hidden', name: param, value: token });
|
121
|
+
form.insert(field);
|
122
|
+
}
|
123
|
+
|
124
|
+
form.submit();
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
document.on("click", "*[data-confirm]", function(event, element) {
|
129
|
+
var message = element.readAttribute('data-confirm');
|
130
|
+
if (!confirm(message)) event.stop();
|
131
|
+
});
|
132
|
+
|
133
|
+
document.on("click", "a[data-remote]", function(event, element) {
|
134
|
+
if (event.stopped) return;
|
135
|
+
handleRemote(element);
|
136
|
+
event.stop();
|
137
|
+
});
|
138
|
+
|
139
|
+
document.on("click", "a[data-method]", function(event, element) {
|
140
|
+
if (event.stopped) return;
|
141
|
+
handleMethod(element);
|
142
|
+
event.stop();
|
143
|
+
});
|
144
|
+
|
145
|
+
document.on("submit", function(event) {
|
146
|
+
var element = event.findElement(),
|
147
|
+
message = element.readAttribute('data-confirm');
|
148
|
+
if (message && !confirm(message)) {
|
149
|
+
event.stop();
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
|
153
|
+
var inputs = element.select("input[type=submit][data-disable-with]");
|
154
|
+
inputs.each(function(input) {
|
155
|
+
input.disabled = true;
|
156
|
+
input.writeAttribute('data-original-value', input.value);
|
157
|
+
input.value = input.readAttribute('data-disable-with');
|
158
|
+
});
|
159
|
+
|
160
|
+
var element = event.findElement("form[data-remote]");
|
161
|
+
if (element) {
|
162
|
+
handleRemote(element);
|
163
|
+
event.stop();
|
164
|
+
}
|
165
|
+
});
|
166
|
+
|
167
|
+
document.on("ajax:after", "form", function(event, element) {
|
168
|
+
var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
|
169
|
+
inputs.each(function(input) {
|
170
|
+
input.value = input.readAttribute('data-original-value');
|
171
|
+
input.removeAttribute('data-original-value');
|
172
|
+
input.disabled = false;
|
173
|
+
});
|
174
|
+
});
|
175
|
+
|
176
|
+
Ajax.Responders.register({
|
177
|
+
onCreate: function(request) {
|
178
|
+
var csrf_meta_tag = $$('meta[name=csrf-token]')[0];
|
179
|
+
|
180
|
+
if (csrf_meta_tag) {
|
181
|
+
var header = 'X-CSRF-Token',
|
182
|
+
token = csrf_meta_tag.readAttribute('content');
|
183
|
+
|
184
|
+
if (!request.options.requestHeaders) {
|
185
|
+
request.options.requestHeaders = {};
|
186
|
+
}
|
187
|
+
request.options.requestHeaders[header] = token;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
});
|
191
|
+
})();
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
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
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Factory.define :johns_meeting, :class => UserMeeting do |u|
|
2
|
+
u.starts_at '2011-01-05'.to_date
|
3
|
+
u.ends_at '2011-01-08'.to_date
|
4
|
+
u.user_id 1
|
5
|
+
end
|
6
|
+
|
7
|
+
Factory.define :peters_meeting, :class => UserMeeting do |u|
|
8
|
+
u.starts_at '2011-01-05'.to_date
|
9
|
+
u.ends_at '2011-01-08'.to_date
|
10
|
+
u.user_id 2
|
11
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Meeting do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
Meeting.delete_all
|
7
|
+
end
|
8
|
+
|
9
|
+
it "create meeting" do
|
10
|
+
lambda {
|
11
|
+
Factory(:meeting)
|
12
|
+
}.should change(Meeting, :count).by(1)
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
OVERLAP_TIME_RANGES = {
|
17
|
+
"has same starts_at and ends_at" => ['2011-01-05'.to_date, '2011-01-08'.to_date],
|
18
|
+
"starts before starts_at and ends after ends_at" => ['2011-01-04'.to_date, '2011-01-09'.to_date],
|
19
|
+
"starts before starts_at and ends inside" => ['2011-01-04'.to_date, '2011-01-06'.to_date],
|
20
|
+
"starts inside and ends after ends_at" => ['2011-01-06'.to_date, '2011-01-09'.to_date],
|
21
|
+
"starts inside and ends inside" => ['2011-01-06'.to_date, '2011-01-07'.to_date],
|
22
|
+
"starts at same time and ends inside" => ['2011-01-05'.to_date, '2011-01-07'.to_date],
|
23
|
+
"starts inside and ends at same time" => ['2011-01-06'.to_date, '2011-01-08'.to_date],
|
24
|
+
"starts before and ends at time of start" => ['2011-01-03'.to_date, '2011-01-05'.to_date],
|
25
|
+
"starts at time of end and ends after" => ['2011-01-08'.to_date, '2011-01-19'.to_date]
|
26
|
+
}
|
27
|
+
|
28
|
+
context "Validation" do
|
29
|
+
|
30
|
+
OVERLAP_TIME_RANGES.each do |description, time_range|
|
31
|
+
it "is not valid if exists meeting which #{description}" do
|
32
|
+
meeting = Factory.build(:meeting, :starts_at => time_range.first, :ends_at => time_range.last)
|
33
|
+
meeting.should_not be_valid
|
34
|
+
meeting.errors[:starts_at].should_not be_empty
|
35
|
+
meeting.errors[:ends_at].should be_empty
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it " validate object which has not got overlap" do
|
40
|
+
meeting = Factory.build(:meeting, :starts_at => "2011-01-09".to_date, :ends_at => "2011-01-11".to_date)
|
41
|
+
meeting.should be_valid
|
42
|
+
meeting.errors[:starts_at].should be_empty
|
43
|
+
meeting.errors[:ends_at].should be_empty
|
44
|
+
|
45
|
+
meeting = Factory.build(:meeting, :starts_at => "2011-01-01".to_date, :ends_at => "2011-01-02".to_date)
|
46
|
+
meeting.should be_valid
|
47
|
+
meeting.errors[:starts_at].should be_empty
|
48
|
+
meeting.errors[:ends_at].should be_empty
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe UserMeeting do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
UserMeeting.delete_all
|
7
|
+
end
|
8
|
+
|
9
|
+
it "create johns meeting" do
|
10
|
+
lambda {
|
11
|
+
Factory(:johns_meeting)
|
12
|
+
}.should change(UserMeeting, :count).by(1)
|
13
|
+
end
|
14
|
+
|
15
|
+
context "Validation with scope" do
|
16
|
+
|
17
|
+
OVERLAP_TIME_RANGES.each do |description, time_range|
|
18
|
+
it "is not valid if exists johns meeting which #{description}" do
|
19
|
+
meeting = Factory.build(:johns_meeting, :starts_at => time_range.first, :ends_at => time_range.last)
|
20
|
+
meeting.should_not be_valid
|
21
|
+
meeting.errors[:starts_at].should_not be_empty
|
22
|
+
meeting.errors[:ends_at].should be_empty
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
OVERLAP_TIME_RANGES.each do |description, time_range|
|
27
|
+
it "is valid if exists johns meeting which #{description}" do
|
28
|
+
meeting = Factory.build(:peters_meeting, :starts_at => time_range.first, :ends_at => time_range.last)
|
29
|
+
meeting.should be_valid
|
30
|
+
meeting.errors[:starts_at].should be_empty
|
31
|
+
meeting.errors[:ends_at].should be_empty
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Configure Rails Envinronment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
require "rspec/rails"
|
7
|
+
|
8
|
+
ActionMailer::Base.delivery_method = :test
|
9
|
+
ActionMailer::Base.perform_deliveries = false
|
10
|
+
ActionMailer::Base.default_url_options[:host] = "test.com"
|
11
|
+
|
12
|
+
Rails.backtrace_cleaner.remove_silencers!
|
13
|
+
|
14
|
+
|
15
|
+
# Run any available migration
|
16
|
+
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
17
|
+
|
18
|
+
# Load support files
|
19
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
20
|
+
|
21
|
+
RSpec.configure do |config|
|
22
|
+
# Remove this line if you don't want RSpec's should and should_not
|
23
|
+
# methods or matchers
|
24
|
+
require 'rspec/expectations'
|
25
|
+
config.include RSpec::Matchers
|
26
|
+
|
27
|
+
# == Mock Framework
|
28
|
+
config.mock_with :rspec
|
29
|
+
end
|
@@ -0,0 +1,147 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{validates_overlap}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Robin Bortlik"]
|
12
|
+
s.date = %q{2011-04-07}
|
13
|
+
s.description = %q{It can be useful when you you are developing some app where you will work with meetings, events etc.}
|
14
|
+
s.email = %q{robinbortlik@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.rdoc"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
"Gemfile",
|
20
|
+
"Gemfile.lock",
|
21
|
+
"MIT-LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"lib/overlap_validator.rb",
|
26
|
+
"lib/validates_overlap.rb",
|
27
|
+
"spec/dummy/Rakefile",
|
28
|
+
"spec/dummy/app/controllers/application_controller.rb",
|
29
|
+
"spec/dummy/app/helpers/application_helper.rb",
|
30
|
+
"spec/dummy/app/models/meeting.rb",
|
31
|
+
"spec/dummy/app/models/user.rb",
|
32
|
+
"spec/dummy/app/models/user_meeting.rb",
|
33
|
+
"spec/dummy/app/views/layouts/application.html.erb",
|
34
|
+
"spec/dummy/config.ru",
|
35
|
+
"spec/dummy/config/application.rb",
|
36
|
+
"spec/dummy/config/boot.rb",
|
37
|
+
"spec/dummy/config/database.yml",
|
38
|
+
"spec/dummy/config/environment.rb",
|
39
|
+
"spec/dummy/config/environments/development.rb",
|
40
|
+
"spec/dummy/config/environments/production.rb",
|
41
|
+
"spec/dummy/config/environments/test.rb",
|
42
|
+
"spec/dummy/config/initializers/backtrace_silencers.rb",
|
43
|
+
"spec/dummy/config/initializers/inflections.rb",
|
44
|
+
"spec/dummy/config/initializers/mime_types.rb",
|
45
|
+
"spec/dummy/config/initializers/secret_token.rb",
|
46
|
+
"spec/dummy/config/initializers/session_store.rb",
|
47
|
+
"spec/dummy/config/locales/en.yml",
|
48
|
+
"spec/dummy/config/routes.rb",
|
49
|
+
"spec/dummy/db/migrate/20110406082020_create_meetings.rb",
|
50
|
+
"spec/dummy/db/migrate/20110406082053_create_users.rb",
|
51
|
+
"spec/dummy/db/migrate/20110407060725_create_user_meetings.rb",
|
52
|
+
"spec/dummy/db/schema.rb",
|
53
|
+
"spec/dummy/public/404.html",
|
54
|
+
"spec/dummy/public/422.html",
|
55
|
+
"spec/dummy/public/500.html",
|
56
|
+
"spec/dummy/public/favicon.ico",
|
57
|
+
"spec/dummy/public/javascripts/application.js",
|
58
|
+
"spec/dummy/public/javascripts/controls.js",
|
59
|
+
"spec/dummy/public/javascripts/dragdrop.js",
|
60
|
+
"spec/dummy/public/javascripts/effects.js",
|
61
|
+
"spec/dummy/public/javascripts/prototype.js",
|
62
|
+
"spec/dummy/public/javascripts/rails.js",
|
63
|
+
"spec/dummy/public/stylesheets/.gitkeep",
|
64
|
+
"spec/dummy/script/rails",
|
65
|
+
"spec/dummy/spec/factories/meeting.rb",
|
66
|
+
"spec/dummy/spec/factories/user.rb",
|
67
|
+
"spec/dummy/spec/factories/user_meeting.rb",
|
68
|
+
"spec/dummy/spec/models/meeting_spec.rb",
|
69
|
+
"spec/dummy/spec/models/user_meeting_spec.rb",
|
70
|
+
"spec/dummy/spec/models/user_spec.rb",
|
71
|
+
"spec/spec_helper.rb",
|
72
|
+
"validates_overlap.gemspec"
|
73
|
+
]
|
74
|
+
s.homepage = %q{http://github.com/robinbortlik/validates_overlap}
|
75
|
+
s.licenses = ["MIT"]
|
76
|
+
s.require_paths = ["lib"]
|
77
|
+
s.rubygems_version = %q{1.3.7}
|
78
|
+
s.summary = %q{This gem helps validate records with time overlap.}
|
79
|
+
s.test_files = [
|
80
|
+
"spec/dummy/app/controllers/application_controller.rb",
|
81
|
+
"spec/dummy/app/helpers/application_helper.rb",
|
82
|
+
"spec/dummy/app/models/meeting.rb",
|
83
|
+
"spec/dummy/app/models/user.rb",
|
84
|
+
"spec/dummy/app/models/user_meeting.rb",
|
85
|
+
"spec/dummy/config/application.rb",
|
86
|
+
"spec/dummy/config/boot.rb",
|
87
|
+
"spec/dummy/config/environment.rb",
|
88
|
+
"spec/dummy/config/environments/development.rb",
|
89
|
+
"spec/dummy/config/environments/production.rb",
|
90
|
+
"spec/dummy/config/environments/test.rb",
|
91
|
+
"spec/dummy/config/initializers/backtrace_silencers.rb",
|
92
|
+
"spec/dummy/config/initializers/inflections.rb",
|
93
|
+
"spec/dummy/config/initializers/mime_types.rb",
|
94
|
+
"spec/dummy/config/initializers/secret_token.rb",
|
95
|
+
"spec/dummy/config/initializers/session_store.rb",
|
96
|
+
"spec/dummy/config/routes.rb",
|
97
|
+
"spec/dummy/db/migrate/20110406082020_create_meetings.rb",
|
98
|
+
"spec/dummy/db/migrate/20110406082053_create_users.rb",
|
99
|
+
"spec/dummy/db/migrate/20110407060725_create_user_meetings.rb",
|
100
|
+
"spec/dummy/db/schema.rb",
|
101
|
+
"spec/dummy/spec/factories/meeting.rb",
|
102
|
+
"spec/dummy/spec/factories/user.rb",
|
103
|
+
"spec/dummy/spec/factories/user_meeting.rb",
|
104
|
+
"spec/dummy/spec/models/meeting_spec.rb",
|
105
|
+
"spec/dummy/spec/models/user_meeting_spec.rb",
|
106
|
+
"spec/dummy/spec/models/user_spec.rb",
|
107
|
+
"spec/spec_helper.rb"
|
108
|
+
]
|
109
|
+
|
110
|
+
if s.respond_to? :specification_version then
|
111
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
112
|
+
s.specification_version = 3
|
113
|
+
|
114
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
115
|
+
s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
|
116
|
+
s.add_runtime_dependency(%q<mysql2>, [">= 0"])
|
117
|
+
s.add_runtime_dependency(%q<rspec-rails>, [">= 2.0.0.beta"])
|
118
|
+
s.add_runtime_dependency(%q<factory_girl_rails>, [">= 0"])
|
119
|
+
s.add_runtime_dependency(%q<bundler>, ["~> 1.0.0"])
|
120
|
+
s.add_runtime_dependency(%q<jeweler>, ["~> 1.5.2"])
|
121
|
+
s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
|
122
|
+
s.add_development_dependency(%q<rspec-rails>, [">= 0"])
|
123
|
+
s.add_development_dependency(%q<factory_girl_rails>, [">= 0"])
|
124
|
+
else
|
125
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
126
|
+
s.add_dependency(%q<mysql2>, [">= 0"])
|
127
|
+
s.add_dependency(%q<rspec-rails>, [">= 2.0.0.beta"])
|
128
|
+
s.add_dependency(%q<factory_girl_rails>, [">= 0"])
|
129
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
130
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
131
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
132
|
+
s.add_dependency(%q<rspec-rails>, [">= 0"])
|
133
|
+
s.add_dependency(%q<factory_girl_rails>, [">= 0"])
|
134
|
+
end
|
135
|
+
else
|
136
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
137
|
+
s.add_dependency(%q<mysql2>, [">= 0"])
|
138
|
+
s.add_dependency(%q<rspec-rails>, [">= 2.0.0.beta"])
|
139
|
+
s.add_dependency(%q<factory_girl_rails>, [">= 0"])
|
140
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
141
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
142
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
143
|
+
s.add_dependency(%q<rspec-rails>, [">= 0"])
|
144
|
+
s.add_dependency(%q<factory_girl_rails>, [">= 0"])
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|