merit 2.3.1 → 2.3.2
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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +45 -0
- data/{CHANGELOG.md → NEWS.md} +9 -1
- data/README.md +12 -1
- data/config/locales/en.yml +5 -0
- data/lib/merit/judge.rb +3 -3
- data/lib/merit/rules_badge_methods.rb +1 -1
- data/merit.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 781f4040bce17e9983ae237f54bf91c1538ce365
|
4
|
+
data.tar.gz: c7aeb303a7c9b4378e5b5ecd4ad10de6842d3e64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190bd669ef68c354cc322049f08a77bc68450a2762766be5f322cb84813a029bc74631f94ecbb7d2f1340281f10fb9a8fc5dcf6f243bc8f28adf76b8ce588c04
|
7
|
+
data.tar.gz: 15155d78b99d36ec84c7124b48e82cbcab1d877ff2d3e370a3aa8d899e09c0f1c99598c448226ff276427b5bf5072760c625831ef94ba391987a33299a17bf26
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
We love pull requests from everyone. By participating in this project, you agree
|
4
|
+
to abide by the thoughtbot [code of conduct].
|
5
|
+
|
6
|
+
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
|
7
|
+
|
8
|
+
Fork, then clone the repo:
|
9
|
+
|
10
|
+
git clone git@github.com:your-username/merit.git
|
11
|
+
|
12
|
+
Set up Ruby dependencies via Bundler
|
13
|
+
|
14
|
+
bundle install
|
15
|
+
|
16
|
+
Make sure the tests pass:
|
17
|
+
|
18
|
+
rake
|
19
|
+
|
20
|
+
Make your change.
|
21
|
+
Write tests.
|
22
|
+
Follow our [style guide][style].
|
23
|
+
Make the tests pass:
|
24
|
+
|
25
|
+
[style]: https://github.com/thoughtbot/guides/tree/master/style
|
26
|
+
|
27
|
+
rake
|
28
|
+
|
29
|
+
Write a [good commit message][commit].
|
30
|
+
Push to your fork.
|
31
|
+
[Submit a pull request][pr].
|
32
|
+
|
33
|
+
[commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
34
|
+
[pr]: https://github.com/merit-gem/merit/compare/
|
35
|
+
|
36
|
+
If [Hound] catches style violations,
|
37
|
+
fix them.
|
38
|
+
|
39
|
+
[hound]: https://houndci.com
|
40
|
+
|
41
|
+
Wait for us.
|
42
|
+
We try to at least comment on pull requests within one business day.
|
43
|
+
We may suggest changes.
|
44
|
+
|
45
|
+
Thank you for your contribution!
|
data/{CHANGELOG.md → NEWS.md}
RENAMED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Merit adds reputation behavior to Rails apps in the form of Badges, Points,
|
4
4
|
and Rankings.
|
5
5
|
|
6
|
-
[](http://travis-ci.org/merit-gem/merit)
|
7
7
|
[](https://coveralls.io/r/tute/merit?branch=master)
|
8
8
|
[](https://codeclimate.com/github/tute/merit)
|
9
9
|
|
@@ -292,6 +292,17 @@ end
|
|
292
292
|
config.add_observer 'ReputationChangeObserver'
|
293
293
|
```
|
294
294
|
|
295
|
+
# I18n
|
296
|
+
|
297
|
+
Merit uses default messages with I18n for notify alerts. To customize your app, you can set up your locale file:
|
298
|
+
|
299
|
+
```yaml
|
300
|
+
en:
|
301
|
+
merit:
|
302
|
+
granted_badge: "granted %{badge_name} badge"
|
303
|
+
granted_points: "granted %{points} points"
|
304
|
+
removed_badge: "removed %{badge_name} badge"
|
305
|
+
```
|
295
306
|
|
296
307
|
# Uninstalling Merit
|
297
308
|
|
data/lib/merit/judge.rb
CHANGED
@@ -27,7 +27,7 @@ module Merit
|
|
27
27
|
sashes.each do |sash|
|
28
28
|
point = sash.add_points points, category: category
|
29
29
|
notify_observers(
|
30
|
-
description: "
|
30
|
+
description: I18n.t("merit.granted_points", points: points),
|
31
31
|
merit_object: point,
|
32
32
|
sash_id: point.sash_id
|
33
33
|
)
|
@@ -41,7 +41,7 @@ module Merit
|
|
41
41
|
next unless new_or_multiple?(sash)
|
42
42
|
badge_sash = sash.add_badge badge.id
|
43
43
|
notify_observers(
|
44
|
-
description: "
|
44
|
+
description: I18n.t("merit.granted_badge", badge_name: badge.name),
|
45
45
|
merit_object: badge_sash,
|
46
46
|
sash_id: badge_sash.sash_id
|
47
47
|
)
|
@@ -52,7 +52,7 @@ module Merit
|
|
52
52
|
sashes.each do |sash|
|
53
53
|
sash.rm_badge badge.id
|
54
54
|
notify_observers(
|
55
|
-
description: "
|
55
|
+
description: I18n.t("merit.removed_badge", badge_name: badge.name),
|
56
56
|
sash_id: sash.id
|
57
57
|
)
|
58
58
|
end
|
@@ -13,7 +13,7 @@ module Merit
|
|
13
13
|
rule.to = options[:to] || :action_user
|
14
14
|
rule.multiple = options[:multiple] || false
|
15
15
|
rule.temporary = options[:temporary] || false
|
16
|
-
rule.model_name = options[:model_name] || actions
|
16
|
+
rule.model_name = options[:model_name] || actions.first.split('#').first
|
17
17
|
rule.block = block
|
18
18
|
|
19
19
|
actions.each do |action|
|
data/merit.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.homepage = "http://github.com/tute/merit"
|
6
6
|
s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
|
7
7
|
s.license = 'MIT'
|
8
|
-
s.version = '2.3.
|
8
|
+
s.version = '2.3.2'
|
9
9
|
s.authors = ["Tute Costa"]
|
10
10
|
s.email = 'tutecosta@gmail.com'
|
11
11
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tute Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ambry
|
@@ -115,15 +115,17 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
-
|
118
|
+
- CONTRIBUTING.md
|
119
119
|
- Gemfile
|
120
120
|
- MIT-LICENSE
|
121
|
+
- NEWS.md
|
121
122
|
- README.md
|
122
123
|
- Rakefile
|
123
124
|
- TESTING.txt
|
124
125
|
- UPGRADING.md
|
125
126
|
- app/models/merit/action.rb
|
126
127
|
- app/models/merit/badge.rb
|
128
|
+
- config/locales/en.yml
|
127
129
|
- lib/generators/active_record/install_generator.rb
|
128
130
|
- lib/generators/active_record/merit_generator.rb
|
129
131
|
- lib/generators/active_record/remove_generator.rb
|
@@ -280,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
282
|
version: '0'
|
281
283
|
requirements: []
|
282
284
|
rubyforge_project:
|
283
|
-
rubygems_version: 2.4.
|
285
|
+
rubygems_version: 2.4.6
|
284
286
|
signing_key:
|
285
287
|
specification_version: 4
|
286
288
|
summary: General reputation Rails engine.
|