mongoid-likeable 4.2.3 → 5.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +15 -0
- data/.gitignore +2 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +45 -0
- data/LICENSE +1 -1
- data/README.md +51 -3
- data/Rakefile +2 -2
- data/lib/mongoid/likeable.rb +2 -2
- data/mongoid-likeable.gemspec +2 -2
- metadata +11 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d382d56cff72dc29a4bfdec20d833e824dc65ff3
|
4
|
+
data.tar.gz: d4c321c7d17d4ddabec2e6b3a6a85453d71802f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64b272aae533a39a6ab5e8f9f34fffb51172511174e3ccfeb7e0181b7191c3fb107f5e7790db276a17458ea1938ec16570769dd243b49af7443bba18d63b9346
|
7
|
+
data.tar.gz: ef0ab9bd09ae264d130fbc365f9e33d2a09eaa2f244acae822bdf4c1ff8613620bbd0832ac8139dfe6c4fd9acd4102c90a9e1b90b0c246df099a77d1dc5830cf
|
data/.editorconfig
ADDED
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Contributing to mongoid-likeable
|
2
|
+
|
3
|
+
Looking to contribute something to mongoid-likeable? **Here's how you can help.**
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
## Reporting issues
|
8
|
+
|
9
|
+
We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the mongoid-likeable core. Please read the following guidelines before opening any issue.
|
10
|
+
|
11
|
+
1. **Search for existing issues.**
|
12
|
+
2. **Create an isolated and reproducible test case.**
|
13
|
+
3. **Include a live example if possible.**
|
14
|
+
4. **Share as much information as possible.** Include at least Rails version, mongoid version and gem version. Also include steps to reproduce the bug.
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
## Key branches
|
19
|
+
|
20
|
+
- `master` is the latest, deployed version. **Never make pull requests against this branch.**
|
21
|
+
- `develop` is the official development branch for the next release.
|
22
|
+
|
23
|
+
Take a look at [git-flow, A successful Git branching model](http://nvie.com/posts/a-successful-git-branching-model/)
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
## Pull requests
|
28
|
+
|
29
|
+
- Try to submit pull requests against the `develop` branch for easier merging
|
30
|
+
- Try not to pollute your pull request with unintended changes--keep them simple and small
|
31
|
+
- **Test. Code coverage should never go below 100%.** If you find a bug, write at first a failing test case and then fix it.
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
## Coding standards
|
36
|
+
|
37
|
+
### Ruby
|
38
|
+
|
39
|
+
- [Ruby Styleguide](https://github.com/styleguide/ruby)
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
By contributing your code, you agree to license your contribution under the terms of the [BSD 2-Clause License](LICENSE)
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
Add like to your Mongoid documents.
|
9
9
|
This is a fork of `tombell/mongoid-voteable` for people who only need likes.
|
10
10
|
|
11
|
-
|
11
|
+
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
@@ -20,10 +20,14 @@ or add the gem to your `Gemfile`
|
|
20
20
|
|
21
21
|
gem 'mongoid-likeable'
|
22
22
|
|
23
|
+
|
24
|
+
|
23
25
|
## Thread safety
|
24
26
|
|
25
27
|
This gem is thread safe.
|
26
28
|
|
29
|
+
|
30
|
+
|
27
31
|
## Usage
|
28
32
|
|
29
33
|
Include the `Mongoid::Likeable` module into your models you want to like.
|
@@ -60,8 +64,52 @@ not called `_id` you can still pass the ID in as the second parameter instead.
|
|
60
64
|
@story.liked? @user.id
|
61
65
|
```
|
62
66
|
|
63
|
-
## License
|
64
67
|
|
65
|
-
|
68
|
+
|
69
|
+
## Contributing
|
70
|
+
|
71
|
+
Please read through our [contributing guidelines](CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
72
|
+
|
73
|
+
More over, if your pull request contains patches or features, you must include relevant unit tests.
|
74
|
+
|
75
|
+
Editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>.
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
## Versioning
|
80
|
+
|
81
|
+
For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Twbs Less Rails will be maintained under the Semantic Versioning guidelines as much as possible. Twbs Less Rails will not follow Bootstrap's version number.
|
82
|
+
|
83
|
+
Releases will be numbered with the following format:
|
84
|
+
|
85
|
+
`<major>.<minor>.<patch>`
|
86
|
+
|
87
|
+
And constructed with the following guidelines:
|
88
|
+
|
89
|
+
* Breaking backward compatibility bumps the major (and resets the minor and patch)
|
90
|
+
* New additions without breaking backward compatibility bumps the minor (and resets the patch)
|
91
|
+
* Bug fixes and misc changes bumps the patch
|
92
|
+
|
93
|
+
For more information on SemVer, please visit [http://semver.org/](http://semver.org/).
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
## Authors
|
98
|
+
|
99
|
+
**Geremia Taglialatela**
|
100
|
+
|
101
|
+
+ http://github.com/tagliala
|
102
|
+
+ http://twitter.com/gtagliala
|
103
|
+
|
104
|
+
**Cesidio Di Landa**
|
105
|
+
|
106
|
+
+ http://github.com/cesidio
|
107
|
+
+ http://twitter.com/cesid
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
## Copyright and license
|
112
|
+
|
113
|
+
Copyright 2014 diowa under [the BSD 2-Clause license](LICENSE).
|
66
114
|
|
67
115
|
mongoid-voteable is licensed under the MIT License - Copyright (c) 2012 Tom Bell
|
data/Rakefile
CHANGED
data/lib/mongoid/likeable.rb
CHANGED
@@ -13,14 +13,14 @@ module Mongoid
|
|
13
13
|
def like(liker)
|
14
14
|
id = liker_id(liker)
|
15
15
|
return if liked? id
|
16
|
-
push :
|
16
|
+
push likers: id
|
17
17
|
update_likers
|
18
18
|
end
|
19
19
|
|
20
20
|
def unlike(liker)
|
21
21
|
id = liker_id(liker)
|
22
22
|
return unless liked? id
|
23
|
-
pull :
|
23
|
+
pull likers: id
|
24
24
|
update_likers
|
25
25
|
end
|
26
26
|
|
data/mongoid-likeable.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'mongoid-likeable'
|
6
|
-
s.version = '
|
6
|
+
s.version = '5.0.0.alpha1'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ['diowa']
|
9
9
|
s.email = ['dev@diowa.com']
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.rubyforge_project = 'mongoid-likeable'
|
16
16
|
|
17
|
-
s.add_dependency 'mongoid', '
|
17
|
+
s.add_dependency 'mongoid', '>= 4.0.0.alpha1'
|
18
18
|
|
19
19
|
s.add_development_dependency 'database_cleaner'
|
20
20
|
s.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-likeable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- diowa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0.alpha1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0.alpha1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: database_cleaner
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,9 +102,11 @@ extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
104
|
- .coveralls.yml
|
105
|
+
- .editorconfig
|
105
106
|
- .gitignore
|
106
107
|
- .travis.yml
|
107
108
|
- CHANGELOG.md
|
109
|
+
- CONTRIBUTING.md
|
108
110
|
- Gemfile
|
109
111
|
- LICENSE
|
110
112
|
- README.md
|
@@ -131,12 +133,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
131
133
|
version: '0'
|
132
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
135
|
requirements:
|
134
|
-
- - '
|
136
|
+
- - '>'
|
135
137
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
138
|
+
version: 1.3.1
|
137
139
|
requirements: []
|
138
140
|
rubyforge_project: mongoid-likeable
|
139
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.1.11
|
140
142
|
signing_key:
|
141
143
|
specification_version: 4
|
142
144
|
summary: Add likes to your Mongoid documents
|