mongo_followable 0.2.0 → 0.2.1
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.
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +8 -0
- data/.idea/modules.xml +9 -0
- data/.idea/mongo_followable.iml +10 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +346 -0
- data/.rakeTasks +7 -0
- data/README.rdoc +10 -3
- data/lib/mongo_followable/followable.rb +15 -0
- data/lib/mongo_followable/follower.rb +6 -0
- data/lib/mongo_followable/version.rb +1 -1
- data/mongo_followable.gemspec +5 -5
- data/spec/mongo/followable_spec.rb +55 -7
- metadata +26 -12
data/.idea/.name
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mongo_followable
|
data/.idea/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build mongo_followable-0.2.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install mongo_followable-0.2.0.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.2.0 and build and push mongo_followable-0.2.0.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
|
data/.idea/encodings.xml
ADDED
data/.idea/misc.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="DependencyValidationManager">
|
|
4
|
+
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-1.9.2-p136" project-jdk-type="RUBY_SDK" />
|
|
7
|
+
</project>
|
|
8
|
+
|
data/.idea/modules.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/mongo_followable.iml" filepath="$PROJECT_DIR$/.idea/mongo_followable.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
9
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] bundler (v1.0.21, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.21)" level="application" />
|
|
8
|
+
</component>
|
|
9
|
+
</module>
|
|
10
|
+
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ChangeListManager">
|
|
4
|
+
<list default="true" id="46dc3a6d-3a97-49f8-becd-2ccba8c07e42" name="Default" comment="">
|
|
5
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
|
6
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.rdoc" afterPath="$PROJECT_DIR$/README.rdoc" />
|
|
7
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/mongo_followable/followable.rb" afterPath="$PROJECT_DIR$/lib/mongo_followable/followable.rb" />
|
|
8
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/mongo_followable/follower.rb" afterPath="$PROJECT_DIR$/lib/mongo_followable/follower.rb" />
|
|
9
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/mongo_followable/version.rb" afterPath="$PROJECT_DIR$/lib/mongo_followable/version.rb" />
|
|
10
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/mongo_followable.gemspec" afterPath="$PROJECT_DIR$/mongo_followable.gemspec" />
|
|
11
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/mongo/followable_spec.rb" afterPath="$PROJECT_DIR$/spec/mongo/followable_spec.rb" />
|
|
12
|
+
</list>
|
|
13
|
+
<ignored path="mongo_followable.iws" />
|
|
14
|
+
<ignored path=".idea/workspace.xml" />
|
|
15
|
+
<option name="TRACKING_ENABLED" value="true" />
|
|
16
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
17
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
18
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
19
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
20
|
+
</component>
|
|
21
|
+
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
|
22
|
+
<component name="CoverageDataManager" choice="3" />
|
|
23
|
+
<component name="CreatePatchCommitExecutor">
|
|
24
|
+
<option name="PATCH_PATH" value="" />
|
|
25
|
+
<option name="REVERSE_PATCH" value="false" />
|
|
26
|
+
</component>
|
|
27
|
+
<component name="DaemonCodeAnalyzer">
|
|
28
|
+
<disable_hints />
|
|
29
|
+
</component>
|
|
30
|
+
<component name="FavoritesManager">
|
|
31
|
+
<favorites_list name="mongo_followable" />
|
|
32
|
+
</component>
|
|
33
|
+
<component name="FileEditorManager">
|
|
34
|
+
<leaf />
|
|
35
|
+
</component>
|
|
36
|
+
<component name="FindManager">
|
|
37
|
+
<FindUsagesManager>
|
|
38
|
+
<setting name="OPEN_NEW_TAB" value="false" />
|
|
39
|
+
</FindUsagesManager>
|
|
40
|
+
</component>
|
|
41
|
+
<component name="Git.Settings">
|
|
42
|
+
<option name="CHECKOUT_INCLUDE_TAGS" value="false" />
|
|
43
|
+
<option name="UPDATE_CHANGES_POLICY" value="STASH" />
|
|
44
|
+
</component>
|
|
45
|
+
<component name="IdeDocumentHistory">
|
|
46
|
+
<option name="changedFiles">
|
|
47
|
+
<list>
|
|
48
|
+
<option value="$PROJECT_DIR$/app/models/follow.rb" />
|
|
49
|
+
<option value="$PROJECT_DIR$/spec/mongo_mapper/group.rb" />
|
|
50
|
+
<option value="$PROJECT_DIR$/spec/mongo_mapper/user.rb" />
|
|
51
|
+
<option value="$PROJECT_DIR$/spec/mongoid/group.rb" />
|
|
52
|
+
<option value="$PROJECT_DIR$/spec/mongoid/user.rb" />
|
|
53
|
+
<option value="$PROJECT_DIR$/spec/spec_helper.rb" />
|
|
54
|
+
<option value="$PROJECT_DIR$/lib/mongo_followable.rb" />
|
|
55
|
+
<option value="$PROJECT_DIR$/lib/mongo_followable/follower.rb" />
|
|
56
|
+
<option value="$PROJECT_DIR$/lib/mongo_followable/followable.rb" />
|
|
57
|
+
<option value="$PROJECT_DIR$/lib/mongo_followable/version.rb" />
|
|
58
|
+
<option value="$PROJECT_DIR$/spec/mongo/followable_spec.rb" />
|
|
59
|
+
<option value="$PROJECT_DIR$/README.rdoc" />
|
|
60
|
+
<option value="$PROJECT_DIR$/mongo_followable.gemspec" />
|
|
61
|
+
</list>
|
|
62
|
+
</option>
|
|
63
|
+
</component>
|
|
64
|
+
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
65
|
+
<OptionsSetting value="true" id="Add" />
|
|
66
|
+
<OptionsSetting value="true" id="Remove" />
|
|
67
|
+
<OptionsSetting value="true" id="Checkout" />
|
|
68
|
+
<OptionsSetting value="true" id="Update" />
|
|
69
|
+
<OptionsSetting value="true" id="Status" />
|
|
70
|
+
<OptionsSetting value="true" id="Edit" />
|
|
71
|
+
<ConfirmationsSetting value="2" id="Add" />
|
|
72
|
+
<ConfirmationsSetting value="0" id="Remove" />
|
|
73
|
+
</component>
|
|
74
|
+
<component name="ProjectReloadState">
|
|
75
|
+
<option name="STATE" value="0" />
|
|
76
|
+
</component>
|
|
77
|
+
<component name="ProjectView">
|
|
78
|
+
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
|
|
79
|
+
<flattenPackages />
|
|
80
|
+
<showMembers />
|
|
81
|
+
<showModules />
|
|
82
|
+
<showLibraryContents />
|
|
83
|
+
<hideEmptyPackages />
|
|
84
|
+
<abbreviatePackageNames />
|
|
85
|
+
<autoscrollToSource />
|
|
86
|
+
<autoscrollFromSource />
|
|
87
|
+
<sortByType />
|
|
88
|
+
</navigator>
|
|
89
|
+
<panes>
|
|
90
|
+
<pane id="ProjectPane">
|
|
91
|
+
<subPane>
|
|
92
|
+
<PATH>
|
|
93
|
+
<PATH_ELEMENT>
|
|
94
|
+
<option name="myItemId" value="mongo_followable" />
|
|
95
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
96
|
+
</PATH_ELEMENT>
|
|
97
|
+
</PATH>
|
|
98
|
+
<PATH>
|
|
99
|
+
<PATH_ELEMENT>
|
|
100
|
+
<option name="myItemId" value="mongo_followable" />
|
|
101
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
102
|
+
</PATH_ELEMENT>
|
|
103
|
+
<PATH_ELEMENT>
|
|
104
|
+
<option name="myItemId" value="mongo_followable" />
|
|
105
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
106
|
+
</PATH_ELEMENT>
|
|
107
|
+
</PATH>
|
|
108
|
+
<PATH>
|
|
109
|
+
<PATH_ELEMENT>
|
|
110
|
+
<option name="myItemId" value="mongo_followable" />
|
|
111
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
112
|
+
</PATH_ELEMENT>
|
|
113
|
+
<PATH_ELEMENT>
|
|
114
|
+
<option name="myItemId" value="mongo_followable" />
|
|
115
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
116
|
+
</PATH_ELEMENT>
|
|
117
|
+
<PATH_ELEMENT>
|
|
118
|
+
<option name="myItemId" value="lib" />
|
|
119
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
120
|
+
</PATH_ELEMENT>
|
|
121
|
+
</PATH>
|
|
122
|
+
<PATH>
|
|
123
|
+
<PATH_ELEMENT>
|
|
124
|
+
<option name="myItemId" value="mongo_followable" />
|
|
125
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
126
|
+
</PATH_ELEMENT>
|
|
127
|
+
<PATH_ELEMENT>
|
|
128
|
+
<option name="myItemId" value="mongo_followable" />
|
|
129
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
130
|
+
</PATH_ELEMENT>
|
|
131
|
+
<PATH_ELEMENT>
|
|
132
|
+
<option name="myItemId" value="lib" />
|
|
133
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
134
|
+
</PATH_ELEMENT>
|
|
135
|
+
<PATH_ELEMENT>
|
|
136
|
+
<option name="myItemId" value="mongo_followable" />
|
|
137
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
138
|
+
</PATH_ELEMENT>
|
|
139
|
+
</PATH>
|
|
140
|
+
<PATH>
|
|
141
|
+
<PATH_ELEMENT>
|
|
142
|
+
<option name="myItemId" value="mongo_followable" />
|
|
143
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
144
|
+
</PATH_ELEMENT>
|
|
145
|
+
<PATH_ELEMENT>
|
|
146
|
+
<option name="myItemId" value="mongo_followable" />
|
|
147
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
148
|
+
</PATH_ELEMENT>
|
|
149
|
+
<PATH_ELEMENT>
|
|
150
|
+
<option name="myItemId" value="app" />
|
|
151
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
152
|
+
</PATH_ELEMENT>
|
|
153
|
+
<PATH_ELEMENT>
|
|
154
|
+
<option name="myItemId" value="models" />
|
|
155
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
156
|
+
</PATH_ELEMENT>
|
|
157
|
+
</PATH>
|
|
158
|
+
</subPane>
|
|
159
|
+
</pane>
|
|
160
|
+
<pane id="Favorites" />
|
|
161
|
+
<pane id="Scope" />
|
|
162
|
+
</panes>
|
|
163
|
+
</component>
|
|
164
|
+
<component name="RecentsManager">
|
|
165
|
+
<key name="CopyFile.RECENT_KEYS">
|
|
166
|
+
<recent name="$PROJECT_DIR$" />
|
|
167
|
+
</key>
|
|
168
|
+
</component>
|
|
169
|
+
<component name="RunManager">
|
|
170
|
+
<list size="0" />
|
|
171
|
+
</component>
|
|
172
|
+
<component name="ShelveChangesManager" show_recycled="false" />
|
|
173
|
+
<component name="SvnConfiguration" maxAnnotateRevisions="500">
|
|
174
|
+
<option name="USER" value="" />
|
|
175
|
+
<option name="PASSWORD" value="" />
|
|
176
|
+
<option name="LAST_MERGED_REVISION" />
|
|
177
|
+
<option name="MERGE_DRY_RUN" value="false" />
|
|
178
|
+
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
|
|
179
|
+
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
|
|
180
|
+
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
|
|
181
|
+
<option name="DETECT_NESTED_COPIES" value="true" />
|
|
182
|
+
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
|
|
183
|
+
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
|
|
184
|
+
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
|
|
185
|
+
<option name="FORCE_UPDATE" value="false" />
|
|
186
|
+
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
|
|
187
|
+
</component>
|
|
188
|
+
<component name="TaskManager">
|
|
189
|
+
<task active="true" id="Default" summary="Default task">
|
|
190
|
+
<changelist id="46dc3a6d-3a97-49f8-becd-2ccba8c07e42" name="Default" comment="" />
|
|
191
|
+
<created>1320633827964</created>
|
|
192
|
+
<updated>1320633827964</updated>
|
|
193
|
+
</task>
|
|
194
|
+
<servers />
|
|
195
|
+
</component>
|
|
196
|
+
<component name="ToolWindowManager">
|
|
197
|
+
<frame x="1" y="24" width="1599" height="851" extended-state="0" />
|
|
198
|
+
<editor active="false" />
|
|
199
|
+
<layout>
|
|
200
|
+
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
201
|
+
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
|
202
|
+
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
|
|
203
|
+
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
204
|
+
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.19796307" sideWeight="0.6703601" order="0" side_tool="false" content_ui="tabs" />
|
|
205
|
+
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
206
|
+
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
|
207
|
+
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
208
|
+
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
|
209
|
+
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
210
|
+
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
211
|
+
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32963988" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
212
|
+
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
213
|
+
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
|
214
|
+
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
|
215
|
+
</layout>
|
|
216
|
+
</component>
|
|
217
|
+
<component name="VcsManagerConfiguration">
|
|
218
|
+
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
|
|
219
|
+
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
|
|
220
|
+
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
|
|
221
|
+
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
|
|
222
|
+
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
|
|
223
|
+
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
|
|
224
|
+
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
|
|
225
|
+
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
|
|
226
|
+
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
|
|
227
|
+
<option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
|
|
228
|
+
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
|
|
229
|
+
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
|
|
230
|
+
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
|
|
231
|
+
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
|
|
232
|
+
<option name="LAST_COMMIT_MESSAGE" />
|
|
233
|
+
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
|
|
234
|
+
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
|
|
235
|
+
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
|
|
236
|
+
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
|
|
237
|
+
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
|
|
238
|
+
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
|
|
239
|
+
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
|
|
240
|
+
<option name="ACTIVE_VCS_NAME" />
|
|
241
|
+
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
|
|
242
|
+
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
|
|
243
|
+
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
|
|
244
|
+
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
|
|
245
|
+
</component>
|
|
246
|
+
<component name="XDebuggerManager">
|
|
247
|
+
<breakpoint-manager />
|
|
248
|
+
</component>
|
|
249
|
+
<component name="editorHistoryManager">
|
|
250
|
+
<entry file="file://$PROJECT_DIR$/LICENSE.txt">
|
|
251
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
252
|
+
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
|
|
253
|
+
</provider>
|
|
254
|
+
</entry>
|
|
255
|
+
<entry file="file://$PROJECT_DIR$/Rakefile">
|
|
256
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
257
|
+
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
|
|
258
|
+
</provider>
|
|
259
|
+
</entry>
|
|
260
|
+
<entry file="file://$PROJECT_DIR$/spec/mongo_mapper/user.rb">
|
|
261
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
262
|
+
<state line="3" column="15" selection-start="86" selection-end="86" vertical-scroll-proportion="0.06521739" />
|
|
263
|
+
</provider>
|
|
264
|
+
</entry>
|
|
265
|
+
<entry file="file://$PROJECT_DIR$/spec/mongoid/user.rb">
|
|
266
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
267
|
+
<state line="2" column="15" selection-start="54" selection-end="54" vertical-scroll-proportion="0.04347826" />
|
|
268
|
+
</provider>
|
|
269
|
+
</entry>
|
|
270
|
+
<entry file="file://$PROJECT_DIR$/spec/mongoid/group.rb">
|
|
271
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
272
|
+
<state line="1" column="16" selection-start="28" selection-end="28" vertical-scroll-proportion="0.02173913" />
|
|
273
|
+
</provider>
|
|
274
|
+
</entry>
|
|
275
|
+
<entry file="file://$PROJECT_DIR$/spec/mongo_mapper/group.rb">
|
|
276
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
277
|
+
<state line="2" column="15" selection-start="59" selection-end="59" vertical-scroll-proportion="0.04347826" />
|
|
278
|
+
</provider>
|
|
279
|
+
</entry>
|
|
280
|
+
<entry file="file://$PROJECT_DIR$/Gemfile">
|
|
281
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
282
|
+
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
|
|
283
|
+
</provider>
|
|
284
|
+
</entry>
|
|
285
|
+
<entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
|
|
286
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
287
|
+
<state line="24" column="46" selection-start="788" selection-end="788" vertical-scroll-proportion="0.5217391" />
|
|
288
|
+
</provider>
|
|
289
|
+
</entry>
|
|
290
|
+
<entry file="file://$PROJECT_DIR$/lib/mongo_followable/version.rb">
|
|
291
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
292
|
+
<state line="1" column="18" selection-start="41" selection-end="41" vertical-scroll-proportion="0.02173913" />
|
|
293
|
+
</provider>
|
|
294
|
+
</entry>
|
|
295
|
+
<entry file="file://$PROJECT_DIR$/mongo_followable.gemspec">
|
|
296
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
297
|
+
<state line="2" column="35" selection-start="105" selection-end="105" vertical-scroll-proportion="0.0">
|
|
298
|
+
<folding />
|
|
299
|
+
</state>
|
|
300
|
+
</provider>
|
|
301
|
+
</entry>
|
|
302
|
+
<entry file="file://$PROJECT_DIR$/README.rdoc">
|
|
303
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
304
|
+
<state line="41" column="25" selection-start="1130" selection-end="1130" vertical-scroll-proportion="-0.9712991">
|
|
305
|
+
<folding />
|
|
306
|
+
</state>
|
|
307
|
+
</provider>
|
|
308
|
+
</entry>
|
|
309
|
+
<entry file="file://$PROJECT_DIR$/app/models/follow.rb">
|
|
310
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
311
|
+
<state line="10" column="30" selection-start="263" selection-end="263" vertical-scroll-proportion="0.2173913">
|
|
312
|
+
<folding />
|
|
313
|
+
</state>
|
|
314
|
+
</provider>
|
|
315
|
+
</entry>
|
|
316
|
+
<entry file="file://$PROJECT_DIR$/spec/mongo/followable_spec.rb">
|
|
317
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
318
|
+
<state line="146" column="45" selection-start="3667" selection-end="3667" vertical-scroll-proportion="0.26086956">
|
|
319
|
+
<folding />
|
|
320
|
+
</state>
|
|
321
|
+
</provider>
|
|
322
|
+
</entry>
|
|
323
|
+
<entry file="file://$PROJECT_DIR$/lib/mongo_followable/follower.rb">
|
|
324
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
325
|
+
<state line="152" column="34" selection-start="4717" selection-end="4717" vertical-scroll-proportion="0.0">
|
|
326
|
+
<folding />
|
|
327
|
+
</state>
|
|
328
|
+
</provider>
|
|
329
|
+
</entry>
|
|
330
|
+
<entry file="file://$PROJECT_DIR$/lib/mongo_followable/followable.rb">
|
|
331
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
332
|
+
<state line="114" column="54" selection-start="3607" selection-end="3607" vertical-scroll-proportion="0.022156574">
|
|
333
|
+
<folding />
|
|
334
|
+
</state>
|
|
335
|
+
</provider>
|
|
336
|
+
</entry>
|
|
337
|
+
<entry file="file://$PROJECT_DIR$/lib/mongo_followable.rb">
|
|
338
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
339
|
+
<state line="6" column="48" selection-start="301" selection-end="301" vertical-scroll-proportion="0.13043478">
|
|
340
|
+
<folding />
|
|
341
|
+
</state>
|
|
342
|
+
</provider>
|
|
343
|
+
</entry>
|
|
344
|
+
</component>
|
|
345
|
+
</project>
|
|
346
|
+
|
data/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build mongo_followable-0.2.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install mongo_followable-0.2.0.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.2.0 and build and push mongo_followable-0.2.0.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
|
data/README.rdoc
CHANGED
|
@@ -7,19 +7,19 @@ Now works for both Mongoid and Mongo_Mapper!
|
|
|
7
7
|
In console:
|
|
8
8
|
gem install mongo_followable
|
|
9
9
|
or in Gemfile:
|
|
10
|
-
gem 'mongo_followable', "~> 0.2.
|
|
10
|
+
gem 'mongo_followable', "~> 0.2.1"
|
|
11
11
|
|
|
12
12
|
== Usage
|
|
13
13
|
|
|
14
14
|
To make model followable you need to include Mongo::Followable into your document;Meanwhile, you also need to include Mongo::Follower in your follower model:
|
|
15
15
|
class User
|
|
16
|
-
include
|
|
16
|
+
include Mongoid::Document #for Mongo_Mapper users, this line of code should be include MongoMapper::Document
|
|
17
17
|
include Mongo::Followable
|
|
18
18
|
include Mongo::Follower
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
class Group
|
|
22
|
-
include
|
|
22
|
+
include Mongoid::Document #for Mongo_Mapper users, this line of code should be include MongoMapper::Document
|
|
23
23
|
include Mongo::Followable
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -34,6 +34,12 @@ And then you can follow a model:
|
|
|
34
34
|
|
|
35
35
|
current_user.follow(@group)
|
|
36
36
|
current_user.unfollow(@group)
|
|
37
|
+
current_user.unfollow_all
|
|
38
|
+
|
|
39
|
+
or,
|
|
40
|
+
|
|
41
|
+
@group.unfollowed(current_user)
|
|
42
|
+
@group.unfollowed_all
|
|
37
43
|
|
|
38
44
|
You can also judge whether a model is a follower of another model or a model is a followee of another model:
|
|
39
45
|
|
|
@@ -108,6 +114,7 @@ And see what the common followers/followees are:
|
|
|
108
114
|
== Thanks
|
|
109
115
|
|
|
110
116
|
Thanks the author(s) of acts_as_followable, you can find this gem here[https://github.com/xpepermint/acts_as_followable]
|
|
117
|
+
|
|
111
118
|
Thanks the author(s) of voteable_mongo, you can find this gem here[https://github.com/vinova/voteable_mongo]
|
|
112
119
|
|
|
113
120
|
== Copyright
|
|
@@ -109,6 +109,21 @@ module Mongo
|
|
|
109
109
|
rebuild_instances(self.followers)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
+
def unfollowed(*models)
|
|
113
|
+
models.each do |model|
|
|
114
|
+
unless model == self or !self.followee_of?(model) or !model.follower_of?(self) or self.cannot_followed.include?(model.class.name) or model.cannot_follow.include?(self.class.name)
|
|
115
|
+
model.followees.by_model(self).first.destroy
|
|
116
|
+
self.followers.by_model(model).first.destroy
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# unfollow all
|
|
122
|
+
|
|
123
|
+
def unfollowed_all
|
|
124
|
+
unfollowed(*self.all_followers)
|
|
125
|
+
end
|
|
126
|
+
|
|
112
127
|
# get all the followers of this model in certain type
|
|
113
128
|
#
|
|
114
129
|
# Example:
|
data/mongo_followable.gemspec
CHANGED
|
@@ -13,11 +13,11 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
|
|
14
14
|
s.rubyforge_project = "mongo_followable"
|
|
15
15
|
|
|
16
|
-
s.add_development_dependency('rspec', '~> 2.
|
|
17
|
-
s.add_development_dependency('mongoid', '~> 2.0')
|
|
18
|
-
s.add_development_dependency('mongo_mapper', '~> 0.
|
|
19
|
-
s.add_development_dependency('bson_ext', '~> 1.
|
|
20
|
-
s.add_development_dependency('database_cleaner', '~>0.
|
|
16
|
+
s.add_development_dependency('rspec', '~> 2.7.0')
|
|
17
|
+
s.add_development_dependency('mongoid', '~> 2.4.0')
|
|
18
|
+
s.add_development_dependency('mongo_mapper', '~> 0.10.0')
|
|
19
|
+
s.add_development_dependency('bson_ext', '~> 1.5.0')
|
|
20
|
+
s.add_development_dependency('database_cleaner', '~>0.7.0')
|
|
21
21
|
|
|
22
22
|
s.files = `git ls-files`.split("\n")
|
|
23
23
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
@@ -14,29 +14,32 @@ describe Mongo::Followable do
|
|
|
14
14
|
@v = User.new
|
|
15
15
|
@v.save
|
|
16
16
|
|
|
17
|
+
@w = User.new
|
|
18
|
+
@w.save
|
|
19
|
+
|
|
17
20
|
@g = Group.new
|
|
18
21
|
@g.save
|
|
19
22
|
end
|
|
20
23
|
|
|
21
24
|
it "following a user" do
|
|
22
|
-
u.follow(@v)
|
|
25
|
+
u.follow(@v, @g)
|
|
23
26
|
|
|
24
27
|
u.follower_of?(@v).should be_true
|
|
25
28
|
@v.followee_of?(u).should be_true
|
|
26
29
|
|
|
27
|
-
u.all_followees.should == [@v]
|
|
30
|
+
u.all_followees.should == [@v, @g]
|
|
28
31
|
@v.all_followers.should == [u]
|
|
29
32
|
|
|
30
33
|
u.followees_by_type("user").should == [@v]
|
|
31
34
|
@v.followers_by_type("user").should == [u]
|
|
32
35
|
|
|
33
|
-
u.followees_count.should ==
|
|
36
|
+
u.followees_count.should == 2
|
|
34
37
|
@v.followers_count.should == 1
|
|
35
38
|
|
|
36
39
|
u.followees_count_by_type("user").should == 1
|
|
37
40
|
@v.followers_count_by_type("user").should == 1
|
|
38
41
|
|
|
39
|
-
u.ever_follow.should
|
|
42
|
+
u.ever_follow.should =~ [@v, @g]
|
|
40
43
|
@v.ever_followed.should == [u]
|
|
41
44
|
|
|
42
45
|
u.common_followees?(@v).should be_false
|
|
@@ -50,8 +53,8 @@ describe Mongo::Followable do
|
|
|
50
53
|
User.with_max_followers_by_type('user').should == [@v]
|
|
51
54
|
end
|
|
52
55
|
|
|
53
|
-
it "unfollowing
|
|
54
|
-
u.
|
|
56
|
+
it "unfollowing" do
|
|
57
|
+
u.unfollow_all
|
|
55
58
|
|
|
56
59
|
u.follower_of?(@v).should be_false
|
|
57
60
|
@v.followee_of?(u).should be_false
|
|
@@ -89,7 +92,7 @@ describe Mongo::Followable do
|
|
|
89
92
|
|
|
90
93
|
u.follow(@v)
|
|
91
94
|
|
|
92
|
-
u.ever_follow.should
|
|
95
|
+
u.ever_follow.should =~ [@g, @v]
|
|
93
96
|
@g.ever_followed.should == [u]
|
|
94
97
|
|
|
95
98
|
u.common_followees?(@v).should be_false
|
|
@@ -120,6 +123,51 @@ describe Mongo::Followable do
|
|
|
120
123
|
|
|
121
124
|
u.followees_count_by_type("group").should == 0
|
|
122
125
|
@g.followers_count_by_type("group").should == 0
|
|
126
|
+
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
describe Group do
|
|
132
|
+
let!(:g) { Group.new }
|
|
133
|
+
|
|
134
|
+
context "begins" do
|
|
135
|
+
|
|
136
|
+
before do
|
|
137
|
+
g.save
|
|
138
|
+
|
|
139
|
+
@v = User.new
|
|
140
|
+
@w = User.new
|
|
141
|
+
@u = User.new
|
|
142
|
+
|
|
143
|
+
[@v, @w, @u].each { |u| u.save }
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
it "another way to unfollow a group" do
|
|
148
|
+
@u.follow(g)
|
|
149
|
+
@v.follow(g)
|
|
150
|
+
@w.follow(g)
|
|
151
|
+
|
|
152
|
+
g.all_followers.should =~ [@v,@u,@w]
|
|
153
|
+
|
|
154
|
+
@w.follower_of?(g).should be_true
|
|
155
|
+
g.followee_of?(@w).should be_true
|
|
156
|
+
|
|
157
|
+
#g.unfollowed(@w)
|
|
158
|
+
|
|
159
|
+
@u.follower_of?(g).should be_true
|
|
160
|
+
g.followee_of?(@u).should be_true
|
|
161
|
+
|
|
162
|
+
@v.follower_of?(g).should be_true
|
|
163
|
+
g.followee_of?(@v).should be_true
|
|
164
|
+
|
|
165
|
+
#g.all_followers.should =~ [@v,@u]
|
|
166
|
+
|
|
167
|
+
g.unfollowed_all
|
|
168
|
+
|
|
169
|
+
g.all_followers == []
|
|
170
|
+
|
|
123
171
|
end
|
|
124
172
|
end
|
|
125
173
|
end
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 2
|
|
8
|
-
-
|
|
9
|
-
version: 0.2.
|
|
8
|
+
- 1
|
|
9
|
+
version: 0.2.1
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Jie Fan
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date:
|
|
17
|
+
date: 2012-01-31 00:00:00 -05:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
@@ -27,8 +27,9 @@ dependencies:
|
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
28
|
segments:
|
|
29
29
|
- 2
|
|
30
|
-
-
|
|
31
|
-
|
|
30
|
+
- 7
|
|
31
|
+
- 0
|
|
32
|
+
version: 2.7.0
|
|
32
33
|
type: :development
|
|
33
34
|
version_requirements: *id001
|
|
34
35
|
- !ruby/object:Gem::Dependency
|
|
@@ -41,8 +42,9 @@ dependencies:
|
|
|
41
42
|
- !ruby/object:Gem::Version
|
|
42
43
|
segments:
|
|
43
44
|
- 2
|
|
45
|
+
- 4
|
|
44
46
|
- 0
|
|
45
|
-
version:
|
|
47
|
+
version: 2.4.0
|
|
46
48
|
type: :development
|
|
47
49
|
version_requirements: *id002
|
|
48
50
|
- !ruby/object:Gem::Dependency
|
|
@@ -55,8 +57,9 @@ dependencies:
|
|
|
55
57
|
- !ruby/object:Gem::Version
|
|
56
58
|
segments:
|
|
57
59
|
- 0
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
+
- 10
|
|
61
|
+
- 0
|
|
62
|
+
version: 0.10.0
|
|
60
63
|
type: :development
|
|
61
64
|
version_requirements: *id003
|
|
62
65
|
- !ruby/object:Gem::Dependency
|
|
@@ -69,8 +72,9 @@ dependencies:
|
|
|
69
72
|
- !ruby/object:Gem::Version
|
|
70
73
|
segments:
|
|
71
74
|
- 1
|
|
72
|
-
-
|
|
73
|
-
|
|
75
|
+
- 5
|
|
76
|
+
- 0
|
|
77
|
+
version: 1.5.0
|
|
74
78
|
type: :development
|
|
75
79
|
version_requirements: *id004
|
|
76
80
|
- !ruby/object:Gem::Dependency
|
|
@@ -83,8 +87,9 @@ dependencies:
|
|
|
83
87
|
- !ruby/object:Gem::Version
|
|
84
88
|
segments:
|
|
85
89
|
- 0
|
|
86
|
-
-
|
|
87
|
-
|
|
90
|
+
- 7
|
|
91
|
+
- 0
|
|
92
|
+
version: 0.7.0
|
|
88
93
|
type: :development
|
|
89
94
|
version_requirements: *id005
|
|
90
95
|
description: " Mongo Followable adds following feature to mongoid "
|
|
@@ -98,6 +103,15 @@ extra_rdoc_files: []
|
|
|
98
103
|
|
|
99
104
|
files:
|
|
100
105
|
- .gitignore
|
|
106
|
+
- .idea/.name
|
|
107
|
+
- .idea/.rakeTasks
|
|
108
|
+
- .idea/encodings.xml
|
|
109
|
+
- .idea/misc.xml
|
|
110
|
+
- .idea/modules.xml
|
|
111
|
+
- .idea/mongo_followable.iml
|
|
112
|
+
- .idea/vcs.xml
|
|
113
|
+
- .idea/workspace.xml
|
|
114
|
+
- .rakeTasks
|
|
101
115
|
- Gemfile
|
|
102
116
|
- LICENSE.txt
|
|
103
117
|
- README.rdoc
|