gimme_a_break 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/README.rdoc +5 -3
- data/Rakefile +1 -1
- data/gimme_a_break.gemspec +15 -23
- data/lib/gimme_a_break.rb +1 -1
- metadata +5 -5
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
@@ -34,11 +34,13 @@ Your model needs to have a created_at column for this to work. An index on it is
|
|
34
34
|
|
35
35
|
== Installation
|
36
36
|
|
37
|
-
|
37
|
+
Rails 2:
|
38
38
|
|
39
|
-
|
39
|
+
gem 'gimme_a_break', :version => "~> 0.2.0"
|
40
40
|
|
41
|
-
|
41
|
+
Rails 3:
|
42
|
+
|
43
|
+
gem 'gimme_a_break', '>= 1.0.0'
|
42
44
|
|
43
45
|
|
44
46
|
== Examples
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
require 'rake'
|
4
4
|
require 'echoe'
|
5
5
|
|
6
|
-
Echoe.new('gimme_a_break', '0.
|
6
|
+
Echoe.new('gimme_a_break', '1.0.0') do |p|
|
7
7
|
p.summary = "Throttle ActiveRecord creation"
|
8
8
|
p.url = "http://github.com/tilsammans/gimme_a_break"
|
9
9
|
p.author = "Joost Baaij"
|
data/gimme_a_break.gemspec
CHANGED
@@ -1,31 +1,23 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "0.
|
4
|
+
s.name = "gimme_a_break"
|
5
|
+
s.version = "1.0.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
s.email =
|
12
|
-
s.extra_rdoc_files = [
|
13
|
-
s.files = [
|
14
|
-
s.homepage =
|
15
|
-
s.post_install_message =
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
*****************************************************
|
22
|
-
|
23
|
-
}
|
24
|
-
s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Gimme_a_break}, %q{--main}, %q{README.rdoc}]
|
25
|
-
s.require_paths = [%q{lib}]
|
26
|
-
s.rubyforge_project = %q{gimme_a_break}
|
27
|
-
s.rubygems_version = %q{1.8.6}
|
28
|
-
s.summary = %q{Throttle ActiveRecord creation}
|
8
|
+
s.authors = ["Joost Baaij"]
|
9
|
+
s.date = "2011-12-08"
|
10
|
+
s.description = "Throttle ActiveRecord creation"
|
11
|
+
s.email = "joost@spacebabies.nl"
|
12
|
+
s.extra_rdoc_files = ["CHANGELOG", "README.rdoc", "lib/gimme_a_break.rb"]
|
13
|
+
s.files = ["CHANGELOG", "MIT-LICENSE", "README.rdoc", "Rakefile", "init.rb", "lib/gimme_a_break.rb", "Manifest", "gimme_a_break.gemspec"]
|
14
|
+
s.homepage = "http://github.com/tilsammans/gimme_a_break"
|
15
|
+
s.post_install_message = " \n *****************************************************\n gimme_a_break installed.\n\n Make sure your models have a created_at column.\n Adding an index to this column is highly recommended.\n *****************************************************\n\n"
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Gimme_a_break", "--main", "README.rdoc"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.rubyforge_project = "gimme_a_break"
|
19
|
+
s.rubygems_version = "1.8.10"
|
20
|
+
s.summary = "Throttle ActiveRecord creation"
|
29
21
|
|
30
22
|
if s.respond_to? :specification_version then
|
31
23
|
s.specification_version = 3
|
data/lib/gimme_a_break.rb
CHANGED
@@ -7,7 +7,7 @@ module GimmeABreak
|
|
7
7
|
protected
|
8
8
|
def gimme_a_break
|
9
9
|
if last_created && last_created.created_at > self.class.gimme_a_break_timeout.seconds.ago
|
10
|
-
errors.
|
10
|
+
errors.add :base, I18n.t("gimme_a_break.notice", :default => "Temporarily disabled due to a safety measure. Please try again in %{count} seconds", :count => self.class.gimme_a_break_timeout)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gimme_a_break
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-08 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &70313742314660 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70313742314660
|
25
25
|
description: Throttle ActiveRecord creation
|
26
26
|
email: joost@spacebabies.nl
|
27
27
|
executables: []
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '1.2'
|
68
68
|
requirements: []
|
69
69
|
rubyforge_project: gimme_a_break
|
70
|
-
rubygems_version: 1.8.
|
70
|
+
rubygems_version: 1.8.10
|
71
71
|
signing_key:
|
72
72
|
specification_version: 3
|
73
73
|
summary: Throttle ActiveRecord creation
|