merit 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3ba1793a99e686187f57a5a9c55c4244ac12593
4
- data.tar.gz: efec89f69825fc1a398ab865fd013af76aff760a
3
+ metadata.gz: 781f4040bce17e9983ae237f54bf91c1538ce365
4
+ data.tar.gz: c7aeb303a7c9b4378e5b5ecd4ad10de6842d3e64
5
5
  SHA512:
6
- metadata.gz: da93660057b6c2fe71593df135de01f7bc724cd8951ca7e4a189447123493ebf1de48a45c25e7a0ccddfed12bac919c83020c1975ab5050e72d261b436f1c8cd
7
- data.tar.gz: ff2b6c3f86e9f8d3a14044570f1dc5e002884e80fd8d1b7fb83e0033f60eb6ff8cbe085feab88dab06938aae576cdd75538337e3aa0b32380a24d53ac2c29db0
6
+ metadata.gz: 190bd669ef68c354cc322049f08a77bc68450a2762766be5f322cb84813a029bc74631f94ecbb7d2f1340281f10fb9a8fc5dcf6f243bc8f28adf76b8ce588c04
7
+ data.tar.gz: 15155d78b99d36ec84c7124b48e82cbcab1d877ff2d3e370a3aa8d899e09c0f1c99598c448226ff276427b5bf5072760c625831ef94ba391987a33299a17bf26
@@ -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!
@@ -1,4 +1,12 @@
1
- # Changelog
1
+ # News
2
+
3
+ User-visible changes worth mentioning.
4
+
5
+ ## 2.3.2
6
+
7
+ - [#218] Implement I18n for internationalization support
8
+ - Tests with Ruby 2.2. Ignores EOL Rails 4.0.
9
+ - Adds CONTRIBUTING document
2
10
 
3
11
  ## 2.3.1
4
12
 
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
- [![Build Status](https://travis-ci.org/tute/merit.svg?branch=master)](http://travis-ci.org/tute/merit)
6
+ [![Build Status](https://travis-ci.org/merit-gem/merit.svg?branch=master)](http://travis-ci.org/merit-gem/merit)
7
7
  [![Coverage Status](https://img.shields.io/coveralls/tute/merit.svg)](https://coveralls.io/r/tute/merit?branch=master)
8
8
  [![Code Climate](https://codeclimate.com/github/tute/merit/badges/gpa.svg)](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
 
@@ -0,0 +1,5 @@
1
+ en:
2
+ merit:
3
+ granted_badge: "granted %{badge_name} badge"
4
+ granted_points: "granted %{points} points"
5
+ removed_badge: "removed %{badge_name} badge"
@@ -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: "granted #{points} points",
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: "granted #{badge.name} badge",
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: "removed #{badge.name} badge",
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[0].split('#')[0]
16
+ rule.model_name = options[:model_name] || actions.first.split('#').first
17
17
  rule.block = block
18
18
 
19
19
  actions.each do |action|
@@ -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.1'
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.1
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-01-15 00:00:00.000000000 Z
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
- - CHANGELOG.md
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.5
285
+ rubygems_version: 2.4.6
284
286
  signing_key:
285
287
  specification_version: 4
286
288
  summary: General reputation Rails engine.