trivia 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,27 @@
2
2
 
3
3
  Models for simple quiz
4
4
 
5
+ == Installation
6
+
7
+ Add to your Gemfile
8
+
9
+ gem 'trivia'
10
+
11
+ Run generator
12
+
13
+ rails generate trivia:install
14
+
15
+ Run migrations
16
+
17
+ rake db:migrate
18
+
19
+ Finally add 'acts_as_trivia_user' to your model:
20
+
21
+ class User < ActiveRecord:Base
22
+ acts_as_trivia_user
23
+ # ...
24
+ end
25
+
5
26
  == Contributing to trivia
6
27
 
7
28
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Jeweler::Tasks.new do |gem|
20
20
  gem.summary = %Q{Models for simple quiz}
21
21
  gem.description = %Q{Add simple quiz to your app and let users earn points}
22
22
  gem.email = "dupal.j@gmail.com"
23
- gem.authors = ["Jan Dupal"]
23
+ gem.authors = ["Jan Dupal", 'Vít Krchov']
24
24
  # dependencies defined in Gemfile
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -9,10 +9,10 @@ module Trivia
9
9
  validate :validate_published_to
10
10
 
11
11
  t = self.arel_table
12
- scope :active, where(t[:published_from].lt(Time.now.to_s(:db)).or(t[:published_from].eq(nil)))
13
- .where(t[:published_to].gt(Time.now.to_s(:db)).or(t[:published_to].eq(nil)))
12
+ scope :active, lambda {where(t[:published_from].lt(Time.now.to_s(:db)).or(t[:published_from].eq(nil)))
13
+ .where(t[:published_to].gt(Time.now.to_s(:db)).or(t[:published_to].eq(nil)))}
14
14
 
15
- scope :inactive, where('published_to < ?', Time.now.to_s(:db))
15
+ scope :inactive, lambda{where('published_to < ?', Time.now.to_s(:db))}
16
16
  end
17
17
 
18
18
  module ClassMethods
@@ -0,0 +1,97 @@
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{trivia}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{Jan Dupal}, %q{Vít Krchov}]
12
+ s.date = %q{2012-03-10}
13
+ s.description = %q{Add simple quiz to your app and let users earn points}
14
+ s.email = %q{dupal.j@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rspec",
22
+ ".rvmrc",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "Guardfile",
26
+ "LICENSE.txt",
27
+ "README.rdoc",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "lib/generators/trivia/install/install_generator.rb",
31
+ "lib/generators/trivia/install/templates/app/models/answer.rb",
32
+ "lib/generators/trivia/install/templates/app/models/chosen_answer.rb",
33
+ "lib/generators/trivia/install/templates/app/models/question.rb",
34
+ "lib/generators/trivia/install/templates/db/migrate/create_trivia_tables.rb",
35
+ "lib/trivia.rb",
36
+ "lib/trivia/answer.rb",
37
+ "lib/trivia/chosen_answer.rb",
38
+ "lib/trivia/question.rb",
39
+ "lib/trivia/trivia_user.rb",
40
+ "spec/generators/trivia/install/install_generator_spec.rb",
41
+ "spec/spec_helper.rb",
42
+ "spec/support/active_record.rb",
43
+ "spec/trivia/answer_spec.rb",
44
+ "spec/trivia/chosen_answer_spec.rb",
45
+ "spec/trivia/question_spec.rb",
46
+ "spec/trivia/trivia_user_spec.rb",
47
+ "trivia.gemspec"
48
+ ]
49
+ s.homepage = %q{http://github.com/SmartMedia/trivia}
50
+ s.licenses = [%q{MIT}]
51
+ s.require_paths = [%q{lib}]
52
+ s.rubygems_version = %q{1.8.6}
53
+ s.summary = %q{Models for simple quiz}
54
+
55
+ if s.respond_to? :specification_version then
56
+ s.specification_version = 3
57
+
58
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
59
+ s.add_runtime_dependency(%q<activerecord>, [">= 0"])
60
+ s.add_development_dependency(%q<guard>, [">= 0"])
61
+ s.add_development_dependency(%q<guard-rspec>, [">= 0"])
62
+ s.add_development_dependency(%q<rb-inotify>, [">= 0"])
63
+ s.add_development_dependency(%q<libnotify>, [">= 0"])
64
+ s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
65
+ s.add_development_dependency(%q<generator_spec>, [">= 0"])
66
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
67
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
68
+ s.add_development_dependency(%q<rcov>, [">= 0"])
69
+ s.add_development_dependency(%q<sqlite3>, [">= 0"])
70
+ else
71
+ s.add_dependency(%q<activerecord>, [">= 0"])
72
+ s.add_dependency(%q<guard>, [">= 0"])
73
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
74
+ s.add_dependency(%q<rb-inotify>, [">= 0"])
75
+ s.add_dependency(%q<libnotify>, [">= 0"])
76
+ s.add_dependency(%q<rspec>, ["~> 2.5.0"])
77
+ s.add_dependency(%q<generator_spec>, [">= 0"])
78
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
79
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
80
+ s.add_dependency(%q<rcov>, [">= 0"])
81
+ s.add_dependency(%q<sqlite3>, [">= 0"])
82
+ end
83
+ else
84
+ s.add_dependency(%q<activerecord>, [">= 0"])
85
+ s.add_dependency(%q<guard>, [">= 0"])
86
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
87
+ s.add_dependency(%q<rb-inotify>, [">= 0"])
88
+ s.add_dependency(%q<libnotify>, [">= 0"])
89
+ s.add_dependency(%q<rspec>, ["~> 2.5.0"])
90
+ s.add_dependency(%q<generator_spec>, [">= 0"])
91
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
92
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
93
+ s.add_dependency(%q<rcov>, [">= 0"])
94
+ s.add_dependency(%q<sqlite3>, [">= 0"])
95
+ end
96
+ end
97
+
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trivia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jan Dupal
9
+ - Vít Krchov
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2011-10-24 00:00:00.000000000Z
13
+ date: 2012-03-10 00:00:00.000000000Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: activerecord
16
- requirement: &87160720 !ruby/object:Gem::Requirement
17
+ requirement: &82273360 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ! '>='
@@ -21,10 +22,10 @@ dependencies:
21
22
  version: '0'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *87160720
25
+ version_requirements: *82273360
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: guard
27
- requirement: &87160410 !ruby/object:Gem::Requirement
28
+ requirement: &82272990 !ruby/object:Gem::Requirement
28
29
  none: false
29
30
  requirements:
30
31
  - - ! '>='
@@ -32,10 +33,10 @@ dependencies:
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *87160410
36
+ version_requirements: *82272990
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: guard-rspec
38
- requirement: &87159710 !ruby/object:Gem::Requirement
39
+ requirement: &82272630 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
41
42
  - - ! '>='
@@ -43,10 +44,10 @@ dependencies:
43
44
  version: '0'
44
45
  type: :development
45
46
  prerelease: false
46
- version_requirements: *87159710
47
+ version_requirements: *82272630
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: rb-inotify
49
- requirement: &87158770 !ruby/object:Gem::Requirement
50
+ requirement: &82272260 !ruby/object:Gem::Requirement
50
51
  none: false
51
52
  requirements:
52
53
  - - ! '>='
@@ -54,10 +55,10 @@ dependencies:
54
55
  version: '0'
55
56
  type: :development
56
57
  prerelease: false
57
- version_requirements: *87158770
58
+ version_requirements: *82272260
58
59
  - !ruby/object:Gem::Dependency
59
60
  name: libnotify
60
- requirement: &87158190 !ruby/object:Gem::Requirement
61
+ requirement: &82271840 !ruby/object:Gem::Requirement
61
62
  none: false
62
63
  requirements:
63
64
  - - ! '>='
@@ -65,10 +66,10 @@ dependencies:
65
66
  version: '0'
66
67
  type: :development
67
68
  prerelease: false
68
- version_requirements: *87158190
69
+ version_requirements: *82271840
69
70
  - !ruby/object:Gem::Dependency
70
71
  name: rspec
71
- requirement: &87157820 !ruby/object:Gem::Requirement
72
+ requirement: &82271450 !ruby/object:Gem::Requirement
72
73
  none: false
73
74
  requirements:
74
75
  - - ~>
@@ -76,10 +77,10 @@ dependencies:
76
77
  version: 2.5.0
77
78
  type: :development
78
79
  prerelease: false
79
- version_requirements: *87157820
80
+ version_requirements: *82271450
80
81
  - !ruby/object:Gem::Dependency
81
82
  name: generator_spec
82
- requirement: &87157470 !ruby/object:Gem::Requirement
83
+ requirement: &82174940 !ruby/object:Gem::Requirement
83
84
  none: false
84
85
  requirements:
85
86
  - - ! '>='
@@ -87,10 +88,10 @@ dependencies:
87
88
  version: '0'
88
89
  type: :development
89
90
  prerelease: false
90
- version_requirements: *87157470
91
+ version_requirements: *82174940
91
92
  - !ruby/object:Gem::Dependency
92
93
  name: bundler
93
- requirement: &87157040 !ruby/object:Gem::Requirement
94
+ requirement: &82174480 !ruby/object:Gem::Requirement
94
95
  none: false
95
96
  requirements:
96
97
  - - ~>
@@ -98,10 +99,10 @@ dependencies:
98
99
  version: 1.0.0
99
100
  type: :development
100
101
  prerelease: false
101
- version_requirements: *87157040
102
+ version_requirements: *82174480
102
103
  - !ruby/object:Gem::Dependency
103
104
  name: jeweler
104
- requirement: &87156650 !ruby/object:Gem::Requirement
105
+ requirement: &82174060 !ruby/object:Gem::Requirement
105
106
  none: false
106
107
  requirements:
107
108
  - - ~>
@@ -109,10 +110,10 @@ dependencies:
109
110
  version: 1.6.4
110
111
  type: :development
111
112
  prerelease: false
112
- version_requirements: *87156650
113
+ version_requirements: *82174060
113
114
  - !ruby/object:Gem::Dependency
114
115
  name: rcov
115
- requirement: &87156310 !ruby/object:Gem::Requirement
116
+ requirement: &82173700 !ruby/object:Gem::Requirement
116
117
  none: false
117
118
  requirements:
118
119
  - - ! '>='
@@ -120,10 +121,10 @@ dependencies:
120
121
  version: '0'
121
122
  type: :development
122
123
  prerelease: false
123
- version_requirements: *87156310
124
+ version_requirements: *82173700
124
125
  - !ruby/object:Gem::Dependency
125
126
  name: sqlite3
126
- requirement: &87156010 !ruby/object:Gem::Requirement
127
+ requirement: &82173300 !ruby/object:Gem::Requirement
127
128
  none: false
128
129
  requirements:
129
130
  - - ! '>='
@@ -131,7 +132,7 @@ dependencies:
131
132
  version: '0'
132
133
  type: :development
133
134
  prerelease: false
134
- version_requirements: *87156010
135
+ version_requirements: *82173300
135
136
  description: Add simple quiz to your app and let users earn points
136
137
  email: dupal.j@gmail.com
137
138
  executables: []
@@ -167,6 +168,7 @@ files:
167
168
  - spec/trivia/chosen_answer_spec.rb
168
169
  - spec/trivia/question_spec.rb
169
170
  - spec/trivia/trivia_user_spec.rb
171
+ - trivia.gemspec
170
172
  homepage: http://github.com/SmartMedia/trivia
171
173
  licenses:
172
174
  - MIT
@@ -182,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
184
  version: '0'
183
185
  segments:
184
186
  - 0
185
- hash: 892929181
187
+ hash: 382602867
186
188
  required_rubygems_version: !ruby/object:Gem::Requirement
187
189
  none: false
188
190
  requirements: