scoreable 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +45 -0
- data/LICENSE.txt +20 -0
- data/README.md +4 -0
- data/README.rdoc +19 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/generators/scoreable/config_generator.rb +17 -0
- data/lib/generators/scoreable/install_generator.rb +30 -0
- data/lib/generators/scoreable/templates/README +7 -0
- data/lib/generators/scoreable/templates/README2 +0 -0
- data/lib/generators/scoreable/templates/initializer.rb +6 -0
- data/lib/generators/scoreable/templates/migration.rb +27 -0
- data/lib/generators/scoreable/templates/score_model.rb +5 -0
- data/lib/scoreable.rb +31 -0
- data/lib/scoreable/generator/active_record.rb +63 -0
- data/lib/scoreable/receiver/active_record.rb +19 -0
- data/lib/scoreable/scoreable.rb +11 -0
- data/scoreable.gemspec +77 -0
- data/spec/scoreable_spec.rb +12 -0
- data/spec/spec_helper.rb +12 -0
- metadata +139 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "rspec", "~> 2.8.0"
|
10
|
+
gem "rdoc", "~> 3.12"
|
11
|
+
gem "bundler", "1.2.0"
|
12
|
+
gem "jeweler", "~> 1.8.4"
|
13
|
+
gem "simplecov", ">= 0"
|
14
|
+
gem "pry"
|
15
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
coderay (1.0.7)
|
5
|
+
diff-lcs (1.1.3)
|
6
|
+
git (1.2.5)
|
7
|
+
jeweler (1.8.4)
|
8
|
+
bundler (~> 1.0)
|
9
|
+
git (>= 1.2.5)
|
10
|
+
rake
|
11
|
+
rdoc
|
12
|
+
json (1.7.5)
|
13
|
+
method_source (0.8)
|
14
|
+
multi_json (1.3.6)
|
15
|
+
pry (0.9.10)
|
16
|
+
coderay (~> 1.0.5)
|
17
|
+
method_source (~> 0.8)
|
18
|
+
slop (~> 3.3.1)
|
19
|
+
rake (0.9.2.2)
|
20
|
+
rdoc (3.12)
|
21
|
+
json (~> 1.4)
|
22
|
+
rspec (2.8.0)
|
23
|
+
rspec-core (~> 2.8.0)
|
24
|
+
rspec-expectations (~> 2.8.0)
|
25
|
+
rspec-mocks (~> 2.8.0)
|
26
|
+
rspec-core (2.8.0)
|
27
|
+
rspec-expectations (2.8.0)
|
28
|
+
diff-lcs (~> 1.1.2)
|
29
|
+
rspec-mocks (2.8.0)
|
30
|
+
simplecov (0.6.4)
|
31
|
+
multi_json (~> 1.0)
|
32
|
+
simplecov-html (~> 0.5.3)
|
33
|
+
simplecov-html (0.5.3)
|
34
|
+
slop (3.3.3)
|
35
|
+
|
36
|
+
PLATFORMS
|
37
|
+
ruby
|
38
|
+
|
39
|
+
DEPENDENCIES
|
40
|
+
bundler (= 1.2.0)
|
41
|
+
jeweler (~> 1.8.4)
|
42
|
+
pry
|
43
|
+
rdoc (~> 3.12)
|
44
|
+
rspec (~> 2.8.0)
|
45
|
+
simplecov
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Naveed Ahmad
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= scoreable
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to scoreable
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
* Fork the project.
|
10
|
+
* Start a feature/bugfix branch.
|
11
|
+
* Commit and push until you are happy with your contribution.
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2012 Naveed Ahmad. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "scoreable"
|
18
|
+
gem.homepage = "http://github.com/naveed-ahmad/scoreable"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{one-line summary of your gem}
|
21
|
+
gem.description = %Q{longer description of your gem}
|
22
|
+
gem.email = "naveedahmada036@gmail.com"
|
23
|
+
gem.authors = ["Naveed Ahmad"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rdoc/task'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "scoreable #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.2
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Scoreable
|
4
|
+
class ConfigGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path("../templates", __FILE__)
|
6
|
+
|
7
|
+
desc "This generator creates an initializer file at config/initializers, " +
|
8
|
+
"with the default configuration options for Scoreable."
|
9
|
+
def add_initializer
|
10
|
+
template "initializer.rb", "config/initializers/scoreable.rb"
|
11
|
+
end
|
12
|
+
|
13
|
+
def show_readme
|
14
|
+
readme "README"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Scoreable
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
include Rails::Generators::Migration
|
5
|
+
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
desc "copy #{Scoreable.score_term}'s migration and model files to your application."
|
8
|
+
|
9
|
+
def self.next_migration_number(dirname)
|
10
|
+
Time.now.strftime("%Y%m%d%H%M%S")
|
11
|
+
end
|
12
|
+
|
13
|
+
def copy_model
|
14
|
+
template "score_model.rb", File.join("app", "models", "#{Scoreable.score_term}.rb")
|
15
|
+
end
|
16
|
+
|
17
|
+
def copy_migration
|
18
|
+
migration_template "migration.rb", File.join("db", "migrate", "create_#{table_name}.rb")
|
19
|
+
end
|
20
|
+
|
21
|
+
def show
|
22
|
+
readme "README2"
|
23
|
+
end
|
24
|
+
|
25
|
+
def table_name
|
26
|
+
Scoreable.table_name
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
==========================================================
|
2
|
+
Great now next steps are:
|
3
|
+
* Change configuration in config/initialize/scoreable.rb to configure your core term name what about 'point' or 'karma'?
|
4
|
+
* run rails g scoreable:install
|
5
|
+
* rake db:migrate
|
6
|
+
* read readme to learn how to generate scores for your users
|
7
|
+
==========================================================
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class Create<%= table_name.camelize %> < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table(:<%= Scoreable.table_name %>) do |t|
|
4
|
+
# earned <%= Scoreable.score_term %>
|
5
|
+
t.decimal :<%= Scoreable.score_term %>
|
6
|
+
|
7
|
+
# <%= Scoreable.score_term%> receiver(polymorphic)
|
8
|
+
t.integer :<%= Scoreable.score_receiver_name.foreign_key %>
|
9
|
+
t.string :<%= Scoreable.score_receiver_name%>_type
|
10
|
+
|
11
|
+
# <%= Scoreable.score_term%> generator(polymorphic)
|
12
|
+
t.integer :<%= Scoreable.score_generator_name.foreign_key %>
|
13
|
+
t.string :<%= Scoreable.score_generator_name%>_type
|
14
|
+
|
15
|
+
#which action has generated this score
|
16
|
+
t.string :action
|
17
|
+
|
18
|
+
t.timestamps
|
19
|
+
end
|
20
|
+
|
21
|
+
add_index :<%= Scoreable.table_name %>, [<%= ":#{Scoreable.score_receiver_name.foreign_key}, :#{Scoreable.score_receiver_name}_type" %>], name: '<%= "index_#{Scoreable.table_name}_on_#{Scoreable.score_receiver_name}"%>'
|
22
|
+
add_index :<%= Scoreable.table_name %>, [:<%= ":#{Scoreable.score_generator_name.foreign_key} , :#{Scoreable.score_generator_name}_type"%>], name: '<%= "index_#{Scoreable.table_name}_on_#{Scoreable.score_generator_name}"%>'
|
23
|
+
|
24
|
+
# remove comment if you want to use this index too
|
25
|
+
#add_index :<%= Scoreable.table_name %>, [:<%= "#{Scoreable.score_generator_name}_type" %>, :action], name: '<%= "index_#{Scoreable.table_name}_on_#{Scoreable.score_generator_name}_type_and_action"%>'
|
26
|
+
end
|
27
|
+
end
|
data/lib/scoreable.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
module Scoreable
|
2
|
+
# name of "score"
|
3
|
+
mattr_accessor :score_term
|
4
|
+
@@score_term = 'score'
|
5
|
+
|
6
|
+
def score_term=(term)
|
7
|
+
@@score_term = term.to_s.downcase
|
8
|
+
end
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def config
|
12
|
+
yield self
|
13
|
+
end
|
14
|
+
|
15
|
+
def table_name
|
16
|
+
score_term.tableize
|
17
|
+
end
|
18
|
+
|
19
|
+
def model_name
|
20
|
+
score_term.camelize
|
21
|
+
end
|
22
|
+
|
23
|
+
def score_receiver_name
|
24
|
+
"#{score_term}_receiver"
|
25
|
+
end
|
26
|
+
|
27
|
+
def score_generator_name
|
28
|
+
"#{score_term}_generator"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Scoreable
|
2
|
+
module Generator
|
3
|
+
module GeneratedMethods; end
|
4
|
+
|
5
|
+
module ClassMethods
|
6
|
+
## Scoreable.score_term = 'score'
|
7
|
+
## use to configure score generation scheme
|
8
|
+
# Example:
|
9
|
+
## give 5 points to user
|
10
|
+
## generate_score create: {score: 5, for: :user}
|
11
|
+
## generate_score create: 5 (need to set global score_reciever for this call using score_receiver= :receiver_object, :receiver_object could be a method that will return receiver
|
12
|
+
##
|
13
|
+
## give 5 point to "user" on "create" and call "report_point" as callback
|
14
|
+
## generate_score create: { :score: 5, for: :user, callback: :report_score}
|
15
|
+
##
|
16
|
+
## You can configure score for multiple method in single call
|
17
|
+
## generate_score update: 4, create: 5, upvote: {score: 5, for: :upvoter}
|
18
|
+
##
|
19
|
+
def generate_score(args)
|
20
|
+
include Scoreable::Generator::InstanceMethods
|
21
|
+
|
22
|
+
args.keys.each do |action|
|
23
|
+
score = args[action]
|
24
|
+
action = action.to_s
|
25
|
+
|
26
|
+
method_without_score_feature = action+"_without_#{Scoreable.score_term}"
|
27
|
+
method_with_score_feature = action+"_with_#{Scoreable.score_term}"
|
28
|
+
|
29
|
+
Scoreable::Generator::GeneratedMethods.class_eval do
|
30
|
+
define_method method_with_score_feature.to_sym do
|
31
|
+
send method_without_score_feature
|
32
|
+
log_score 5,action, 'user'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
include Scoreable::Generator::GeneratedMethods
|
38
|
+
|
39
|
+
args.keys.each do |action|
|
40
|
+
alias_method_chain action, Scoreable.score_term
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
alias_method "generate_#{Scoreable.score_term}", :generate_score unless respond_to? "generate_#{Scoreable.score_term}"
|
45
|
+
|
46
|
+
mattr_accessor :score_receiver
|
47
|
+
mattr_accessor "#{Scoreable.score_term}_receiver"
|
48
|
+
end
|
49
|
+
|
50
|
+
module InstanceMethods
|
51
|
+
|
52
|
+
def itself
|
53
|
+
self
|
54
|
+
end
|
55
|
+
|
56
|
+
def log_score(score,action,receiver)
|
57
|
+
receiver = self.send receiver if [String,Symbol].include? receiver.class
|
58
|
+
receiver.send(Scoreable.table_name).create! action: action, :"#{Scoreable.score_term}" => score, :"#{Scoreable.score_term}_generator" => self
|
59
|
+
end
|
60
|
+
alias_method "log_#{Scoreable.score_term}_receiver", :log_score
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Scoreable
|
2
|
+
module Receiver
|
3
|
+
module ClassMethods
|
4
|
+
define_method "receive_#{Scoreable.score_term}" do
|
5
|
+
has_many "#{Scoreable.table_name}".to_sym, as: Scoreable.score_receiver_name
|
6
|
+
|
7
|
+
include Scoreable::Receiver::InstanceMethods
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
module InstanceMethods
|
12
|
+
define_method "total_#{Scoreable.score_term}" do
|
13
|
+
eval(Scoreable.table_name).sum Scoreable.score_term
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'scoreable/generator/active_record'
|
3
|
+
require 'scoreable/receiver/active_record'
|
4
|
+
require 'scoreable/scoreable'
|
5
|
+
|
6
|
+
module Scoreable
|
7
|
+
ActiveRecord::Base.class_eval do
|
8
|
+
extend Scoreable::Generator::ClassMethods
|
9
|
+
extend Scoreable::Receiver::ClassMethods
|
10
|
+
end
|
11
|
+
end
|
data/scoreable.gemspec
ADDED
@@ -0,0 +1,77 @@
|
|
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{scoreable}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = [%q{Naveed Ahmad}]
|
12
|
+
s.date = %q{2012-09-11}
|
13
|
+
s.description = %q{longer description of your gem}
|
14
|
+
s.email = %q{naveedahmada036@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.md",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.md",
|
26
|
+
"README.rdoc",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"lib/generators/scoreable/config_generator.rb",
|
30
|
+
"lib/generators/scoreable/install_generator.rb",
|
31
|
+
"lib/generators/scoreable/templates/README",
|
32
|
+
"lib/generators/scoreable/templates/README2",
|
33
|
+
"lib/generators/scoreable/templates/initializer.rb",
|
34
|
+
"lib/generators/scoreable/templates/migration.rb",
|
35
|
+
"lib/generators/scoreable/templates/score_model.rb",
|
36
|
+
"lib/scoreable.rb",
|
37
|
+
"lib/scoreable/generator/active_record.rb",
|
38
|
+
"lib/scoreable/receiver/active_record.rb",
|
39
|
+
"lib/scoreable/scoreable.rb",
|
40
|
+
"scoreable.gemspec",
|
41
|
+
"spec/scoreable_spec.rb",
|
42
|
+
"spec/spec_helper.rb"
|
43
|
+
]
|
44
|
+
s.homepage = %q{http://github.com/naveed-ahmad/scoreable}
|
45
|
+
s.licenses = [%q{MIT}]
|
46
|
+
s.require_paths = [%q{lib}]
|
47
|
+
s.rubygems_version = %q{1.8.6}
|
48
|
+
s.summary = %q{one-line summary of your gem}
|
49
|
+
|
50
|
+
if s.respond_to? :specification_version then
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
54
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
55
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
56
|
+
s.add_development_dependency(%q<bundler>, ["= 1.2.0"])
|
57
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
58
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
59
|
+
s.add_development_dependency(%q<pry>, [">= 0"])
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
62
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
63
|
+
s.add_dependency(%q<bundler>, ["= 1.2.0"])
|
64
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
65
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
66
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
67
|
+
end
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
70
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
71
|
+
s.add_dependency(%q<bundler>, ["= 1.2.0"])
|
72
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
73
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
74
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'scoreable'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: scoreable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Naveed Ahmad
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &76344800 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.8.0
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *76344800
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rdoc
|
27
|
+
requirement: &76344510 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.12'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *76344510
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: bundler
|
38
|
+
requirement: &76344160 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - =
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.2.0
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *76344160
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: jeweler
|
49
|
+
requirement: &76343850 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.8.4
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *76343850
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: simplecov
|
60
|
+
requirement: &76343430 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *76343430
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: &76343040 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *76343040
|
80
|
+
description: longer description of your gem
|
81
|
+
email: naveedahmada036@gmail.com
|
82
|
+
executables: []
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files:
|
85
|
+
- LICENSE.txt
|
86
|
+
- README.md
|
87
|
+
- README.rdoc
|
88
|
+
files:
|
89
|
+
- .document
|
90
|
+
- Gemfile
|
91
|
+
- Gemfile.lock
|
92
|
+
- LICENSE.txt
|
93
|
+
- README.md
|
94
|
+
- README.rdoc
|
95
|
+
- Rakefile
|
96
|
+
- VERSION
|
97
|
+
- lib/generators/scoreable/config_generator.rb
|
98
|
+
- lib/generators/scoreable/install_generator.rb
|
99
|
+
- lib/generators/scoreable/templates/README
|
100
|
+
- lib/generators/scoreable/templates/README2
|
101
|
+
- lib/generators/scoreable/templates/initializer.rb
|
102
|
+
- lib/generators/scoreable/templates/migration.rb
|
103
|
+
- lib/generators/scoreable/templates/score_model.rb
|
104
|
+
- lib/scoreable.rb
|
105
|
+
- lib/scoreable/generator/active_record.rb
|
106
|
+
- lib/scoreable/receiver/active_record.rb
|
107
|
+
- lib/scoreable/scoreable.rb
|
108
|
+
- scoreable.gemspec
|
109
|
+
- spec/scoreable_spec.rb
|
110
|
+
- spec/spec_helper.rb
|
111
|
+
homepage: http://github.com/naveed-ahmad/scoreable
|
112
|
+
licenses:
|
113
|
+
- MIT
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - ! '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
segments:
|
125
|
+
- 0
|
126
|
+
hash: 915395293
|
127
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
requirements: []
|
134
|
+
rubyforge_project:
|
135
|
+
rubygems_version: 1.8.6
|
136
|
+
signing_key:
|
137
|
+
specification_version: 3
|
138
|
+
summary: one-line summary of your gem
|
139
|
+
test_files: []
|