mongoid_followable 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.idea/.name ADDED
@@ -0,0 +1 @@
1
+ mongoid_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 mongoid_followable-0.0.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install mongoid_followable-0.0.1.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.0.1 and build and push mongoid_followable-0.0.1.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
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/mongoid_followable.iml" filepath="$PROJECT_DIR$/.idea/mongoid_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.7, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.7)" level="application" />
8
+ </component>
9
+ </module>
10
+
data/.idea/vcs.xml ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
7
+
@@ -0,0 +1,348 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="90bdec60-890b-4083-b05d-2f665a1f4d70" name="Default" comment="">
5
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.gitignore" />
6
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Gemfile" />
7
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Rakefile" />
8
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/mongoid_followable.rb" />
9
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/mongoid_followable/version.rb" />
10
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/mongoid_followable.gemspec" />
11
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/models/user.rb" />
12
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/mongoid/followable_spec.rb" />
13
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/spec_helper.rb" />
14
+ </list>
15
+ <ignored path="mongoid_followable.iws" />
16
+ <ignored path=".idea/workspace.xml" />
17
+ <option name="TRACKING_ENABLED" value="true" />
18
+ <option name="SHOW_DIALOG" value="false" />
19
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
20
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
21
+ <option name="LAST_RESOLUTION" value="IGNORE" />
22
+ </component>
23
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
24
+ <component name="CoverageDataManager" choice="3" />
25
+ <component name="CreatePatchCommitExecutor">
26
+ <option name="PATCH_PATH" value="" />
27
+ <option name="REVERSE_PATCH" value="false" />
28
+ </component>
29
+ <component name="DaemonCodeAnalyzer">
30
+ <disable_hints />
31
+ </component>
32
+ <component name="FavoritesManager">
33
+ <favorites_list name="mongoid_followable" />
34
+ </component>
35
+ <component name="FileEditorManager">
36
+ <leaf>
37
+ <file leaf-file-name="followable_spec.rb" pinned="false" current="false" current-in-tab="false">
38
+ <entry file="file://$PROJECT_DIR$/spec/mongoid/followable_spec.rb">
39
+ <provider selected="true" editor-type-id="text-editor">
40
+ <state line="42" column="33" selection-start="1138" selection-end="1138" vertical-scroll-proportion="0.0">
41
+ <folding />
42
+ </state>
43
+ </provider>
44
+ </entry>
45
+ </file>
46
+ <file leaf-file-name="mongoid_followable.rb" pinned="false" current="true" current-in-tab="true">
47
+ <entry file="file://$PROJECT_DIR$/lib/mongoid_followable.rb">
48
+ <provider selected="true" editor-type-id="text-editor">
49
+ <state line="11" column="23" selection-start="297" selection-end="297" vertical-scroll-proportion="0.23878437">
50
+ <folding />
51
+ </state>
52
+ </provider>
53
+ </entry>
54
+ </file>
55
+ </leaf>
56
+ </component>
57
+ <component name="FindManager">
58
+ <FindUsagesManager>
59
+ <setting name="OPEN_NEW_TAB" value="false" />
60
+ </FindUsagesManager>
61
+ </component>
62
+ <component name="Git.Settings">
63
+ <option name="CHECKOUT_INCLUDE_TAGS" value="false" />
64
+ <option name="UPDATE_CHANGES_POLICY" value="STASH" />
65
+ </component>
66
+ <component name="IdeDocumentHistory">
67
+ <option name="changedFiles">
68
+ <list>
69
+ <option value="$PROJECT_DIR$/mongoid_followable.gemspec" />
70
+ <option value="$PROJECT_DIR$/lib/mongoid_followable/version.rb" />
71
+ <option value="$PROJECT_DIR$/spec/spec_helper.rb" />
72
+ <option value="$PROJECT_DIR$/spec/models/user.rb" />
73
+ <option value="$PROJECT_DIR$/spec/mongoid/followable_spec.rb" />
74
+ <option value="$PROJECT_DIR$/lib/mongoid_followable.rb" />
75
+ </list>
76
+ </option>
77
+ </component>
78
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
79
+ <OptionsSetting value="true" id="Add" />
80
+ <OptionsSetting value="true" id="Remove" />
81
+ <OptionsSetting value="true" id="Checkout" />
82
+ <OptionsSetting value="true" id="Update" />
83
+ <OptionsSetting value="true" id="Status" />
84
+ <OptionsSetting value="true" id="Edit" />
85
+ <ConfirmationsSetting value="2" id="Add" />
86
+ <ConfirmationsSetting value="0" id="Remove" />
87
+ </component>
88
+ <component name="ProjectReloadState">
89
+ <option name="STATE" value="0" />
90
+ </component>
91
+ <component name="ProjectView">
92
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
93
+ <flattenPackages />
94
+ <showMembers />
95
+ <showModules />
96
+ <showLibraryContents />
97
+ <hideEmptyPackages />
98
+ <abbreviatePackageNames />
99
+ <autoscrollToSource />
100
+ <autoscrollFromSource />
101
+ <sortByType />
102
+ </navigator>
103
+ <panes>
104
+ <pane id="Scope" />
105
+ <pane id="Favorites" />
106
+ <pane id="ProjectPane">
107
+ <subPane>
108
+ <PATH>
109
+ <PATH_ELEMENT>
110
+ <option name="myItemId" value="mongoid_followable" />
111
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
112
+ </PATH_ELEMENT>
113
+ </PATH>
114
+ <PATH>
115
+ <PATH_ELEMENT>
116
+ <option name="myItemId" value="mongoid_followable" />
117
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
118
+ </PATH_ELEMENT>
119
+ <PATH_ELEMENT>
120
+ <option name="myItemId" value="mongoid_followable" />
121
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
122
+ </PATH_ELEMENT>
123
+ </PATH>
124
+ <PATH>
125
+ <PATH_ELEMENT>
126
+ <option name="myItemId" value="mongoid_followable" />
127
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
128
+ </PATH_ELEMENT>
129
+ <PATH_ELEMENT>
130
+ <option name="myItemId" value="mongoid_followable" />
131
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
132
+ </PATH_ELEMENT>
133
+ <PATH_ELEMENT>
134
+ <option name="myItemId" value="spec" />
135
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
136
+ </PATH_ELEMENT>
137
+ </PATH>
138
+ <PATH>
139
+ <PATH_ELEMENT>
140
+ <option name="myItemId" value="mongoid_followable" />
141
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
142
+ </PATH_ELEMENT>
143
+ <PATH_ELEMENT>
144
+ <option name="myItemId" value="mongoid_followable" />
145
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
146
+ </PATH_ELEMENT>
147
+ <PATH_ELEMENT>
148
+ <option name="myItemId" value="spec" />
149
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
150
+ </PATH_ELEMENT>
151
+ <PATH_ELEMENT>
152
+ <option name="myItemId" value="mongoid" />
153
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
154
+ </PATH_ELEMENT>
155
+ </PATH>
156
+ <PATH>
157
+ <PATH_ELEMENT>
158
+ <option name="myItemId" value="mongoid_followable" />
159
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
160
+ </PATH_ELEMENT>
161
+ <PATH_ELEMENT>
162
+ <option name="myItemId" value="mongoid_followable" />
163
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
164
+ </PATH_ELEMENT>
165
+ <PATH_ELEMENT>
166
+ <option name="myItemId" value="spec" />
167
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
168
+ </PATH_ELEMENT>
169
+ <PATH_ELEMENT>
170
+ <option name="myItemId" value="models" />
171
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
172
+ </PATH_ELEMENT>
173
+ </PATH>
174
+ <PATH>
175
+ <PATH_ELEMENT>
176
+ <option name="myItemId" value="mongoid_followable" />
177
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
178
+ </PATH_ELEMENT>
179
+ <PATH_ELEMENT>
180
+ <option name="myItemId" value="mongoid_followable" />
181
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
182
+ </PATH_ELEMENT>
183
+ <PATH_ELEMENT>
184
+ <option name="myItemId" value="lib" />
185
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
186
+ </PATH_ELEMENT>
187
+ </PATH>
188
+ </subPane>
189
+ </pane>
190
+ </panes>
191
+ </component>
192
+ <component name="RunManager">
193
+ <configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
194
+ <module name="" />
195
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
196
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
197
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
198
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
199
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
200
+ <envs />
201
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
202
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" track_test_folders="true" runner="rcov">
203
+ <COVERAGE_PATTERN ENABLED="true">
204
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
205
+ </COVERAGE_PATTERN>
206
+ </EXTENSION>
207
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
208
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
209
+ <method />
210
+ </configuration>
211
+ <list size="0" />
212
+ </component>
213
+ <component name="ShelveChangesManager" show_recycled="false" />
214
+ <component name="SvnConfiguration" maxAnnotateRevisions="500">
215
+ <option name="USER" value="" />
216
+ <option name="PASSWORD" value="" />
217
+ <option name="LAST_MERGED_REVISION" />
218
+ <option name="MERGE_DRY_RUN" value="false" />
219
+ <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
220
+ <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
221
+ <option name="IGNORE_SPACES_IN_MERGE" value="false" />
222
+ <option name="DETECT_NESTED_COPIES" value="true" />
223
+ <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
224
+ <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
225
+ <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
226
+ <option name="FORCE_UPDATE" value="false" />
227
+ <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
228
+ </component>
229
+ <component name="TaskManager">
230
+ <task active="true" id="Default" summary="Default task">
231
+ <created>1308618686031</created>
232
+ <updated>1308618686031</updated>
233
+ </task>
234
+ <servers />
235
+ </component>
236
+ <component name="ToolWindowManager">
237
+ <frame x="1" y="24" width="1598" height="851" extended-state="3" />
238
+ <editor active="true" />
239
+ <layout>
240
+ <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="-1" side_tool="false" content_ui="tabs" />
241
+ <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" />
242
+ <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" />
243
+ <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" />
244
+ <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="-1" side_tool="false" content_ui="tabs" />
245
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.17811705" sideWeight="0.6703601" order="0" side_tool="false" content_ui="tabs" />
246
+ <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" />
247
+ <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" />
248
+ <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="-1" side_tool="false" content_ui="tabs" />
249
+ <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" />
250
+ <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" />
251
+ <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" />
252
+ <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" />
253
+ <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" />
254
+ <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" />
255
+ </layout>
256
+ </component>
257
+ <component name="VcsManagerConfiguration">
258
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
259
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
260
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
261
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
262
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
263
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
264
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
265
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
266
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
267
+ <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
268
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
269
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
270
+ <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
271
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
272
+ <option name="LAST_COMMIT_MESSAGE" />
273
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
274
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
275
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
276
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
277
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
278
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
279
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
280
+ <option name="ACTIVE_VCS_NAME" />
281
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
282
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
283
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
284
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
285
+ </component>
286
+ <component name="XDebuggerManager">
287
+ <breakpoint-manager />
288
+ </component>
289
+ <component name="editorHistoryManager">
290
+ <entry file="file://$PROJECT_DIR$/mongoid_followable.gemspec">
291
+ <provider selected="true" editor-type-id="text-editor">
292
+ <state line="6" column="27" selection-start="205" selection-end="205" vertical-scroll-proportion="0.1300578">
293
+ <folding />
294
+ </state>
295
+ </provider>
296
+ </entry>
297
+ <entry file="file://$PROJECT_DIR$/Rakefile">
298
+ <provider selected="true" editor-type-id="text-editor">
299
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
300
+ <folding />
301
+ </state>
302
+ </provider>
303
+ </entry>
304
+ <entry file="file://$PROJECT_DIR$/spec/models/user.rb">
305
+ <provider selected="true" editor-type-id="text-editor">
306
+ <state line="2" column="29" selection-start="68" selection-end="68" vertical-scroll-proportion="0.04341534">
307
+ <folding />
308
+ </state>
309
+ </provider>
310
+ </entry>
311
+ <entry file="file://$PROJECT_DIR$/lib/mongoid_followable/version.rb">
312
+ <provider selected="true" editor-type-id="text-editor">
313
+ <state line="2" column="4" selection-start="39" selection-end="39" vertical-scroll-proportion="0.0">
314
+ <folding />
315
+ </state>
316
+ </provider>
317
+ </entry>
318
+ <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
319
+ <provider selected="true" editor-type-id="text-editor">
320
+ <state line="17" column="54" selection-start="439" selection-end="439" vertical-scroll-proportion="0.5629139">
321
+ <folding />
322
+ </state>
323
+ </provider>
324
+ </entry>
325
+ <entry file="file://$PROJECT_DIR$/Gemfile">
326
+ <provider selected="true" editor-type-id="text-editor">
327
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
328
+ <folding />
329
+ </state>
330
+ </provider>
331
+ </entry>
332
+ <entry file="file://$PROJECT_DIR$/spec/mongoid/followable_spec.rb">
333
+ <provider selected="true" editor-type-id="text-editor">
334
+ <state line="42" column="33" selection-start="1138" selection-end="1138" vertical-scroll-proportion="0.0">
335
+ <folding />
336
+ </state>
337
+ </provider>
338
+ </entry>
339
+ <entry file="file://$PROJECT_DIR$/lib/mongoid_followable.rb">
340
+ <provider selected="true" editor-type-id="text-editor">
341
+ <state line="11" column="23" selection-start="297" selection-end="297" vertical-scroll-proportion="0.23878437">
342
+ <folding />
343
+ </state>
344
+ </provider>
345
+ </entry>
346
+ </component>
347
+ </project>
348
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in mongoid_followable.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Jie Fan
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 ADDED
@@ -0,0 +1,38 @@
1
+ ###mongoid_followable###
2
+ * * *
3
+ ### Installation###
4
+ In console:
5
+ gem install mongoid_followable
6
+ or in Gemfile:
7
+ gem 'mongoid_followable'
8
+ * * *
9
+ ###Usage###
10
+ To make model followable you need to include Mongoid::Followable into your document:
11
+ class User
12
+ include Mongoid::Document
13
+ include Mongoid::Followable
14
+ end
15
+ Now you can follow others in your controller:
16
+ ...
17
+ @user = some_other_user
18
+ current_user.follow(@user)
19
+
20
+ current_user.unfollow(@user)
21
+
22
+ current_user.follower_of?(@user)
23
+ current_user.followee_of?(@user)
24
+
25
+ current_user.follower_count
26
+ current_user.followee_count
27
+
28
+ User.followers_of(current_user)
29
+ User.followees_of(current_user)
30
+ ...
31
+
32
+ **In current version, only following the same model is allowed**
33
+
34
+ ###TODO###
35
+ inter-models followable
36
+
37
+ ###Copyright###
38
+ Copyright &copy; Jie Fan. See LICENSE.txt for further details.
data/README.rdoc ADDED
@@ -0,0 +1,38 @@
1
+ ###mongoid_followable###
2
+ * * *
3
+ ### Installation###
4
+ In console:
5
+ gem install mongoid_followable
6
+ or in Gemfile:
7
+ gem 'mongoid_followable'
8
+ * * *
9
+ ###Usage###
10
+ To make model followable you need to include Mongoid::Followable into your document:
11
+ class User
12
+ include Mongoid::Document
13
+ include Mongoid::Followable
14
+ end
15
+ Now you can follow others in your controller:
16
+ ...
17
+ @user = some_other_user
18
+ current_user.follow(@user)
19
+
20
+ current_user.unfollow(@user)
21
+
22
+ current_user.follower_of?(@user)
23
+ current_user.followee_of?(@user)
24
+
25
+ current_user.follower_count
26
+ current_user.followee_count
27
+
28
+ User.followers_of(current_user)
29
+ User.followees_of(current_user)
30
+ ...
31
+
32
+ **In current version, only following the same model is allowed**
33
+
34
+ ###TODO###
35
+ inter-models followable
36
+
37
+ ###Copyright###
38
+ Copyright &copy; Jie Fan. See LICENSE.txt for further details.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,5 @@
1
+ module Mongoid
2
+ module Followable
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,151 @@
1
+ module Mongoid
2
+ module Followable
3
+ extend ActiveSupport::Concern
4
+
5
+ included do |base|
6
+ base.field :follower, :type => Array, :default => []
7
+ base.field :followee, :type => Array, :default => []
8
+ end
9
+
10
+ module ClassMethods
11
+ # get a list of followers of certain model
12
+ #
13
+ # Example:
14
+ # >> @Jim = User.new
15
+ # >> @Tom = User.new
16
+ # >> @Jim.save
17
+ # >> @Tom.save
18
+ # >> @Jim.follow(@Tom)
19
+ # >> User.followers_of(@Tom)
20
+ # => [@Jim]
21
+ #
22
+ # Arguments:
23
+ # model: (instance of model(like User, Group))
24
+ def followers_of(model)
25
+ self.any_in(:_id => model.follower)
26
+ end
27
+
28
+ # get a list of followees of certain model
29
+ #
30
+ # Example:
31
+ # >> @Jim = User.new
32
+ # >> @Tom = User.new
33
+ # >> @Jim.save
34
+ # >> @Tom.save
35
+ # >> @Jim.follow(@Tom)
36
+ # >> User.followees_of(@Jim)
37
+ # => [@Tom]
38
+ #
39
+ # Arguments:
40
+ # model: (instance of model(like User, Group))
41
+ def followees_of(model)
42
+ self.any_in(:_id => model.followee)
43
+ end
44
+ end
45
+
46
+ # judge whether a model is follower of another model
47
+ #
48
+ # Example:
49
+ # >> @Jim = User.new
50
+ # >> @Tom = User.new
51
+ # >> @Jim.save
52
+ # >> @Tom.save
53
+ # >> @Jim.follow(@Tom)
54
+ # >> @Jim.follower_of?(@Tom)
55
+ # => true
56
+ #
57
+ # Arguments:
58
+ # model: (instance of model(like User, Group))
59
+ def follower_of?(model)
60
+ return true if model.follower.include?(self.id) and self.followee.include?(model.id)
61
+ end
62
+
63
+ # judge whether a model is followee of another model
64
+ #
65
+ # Example:
66
+ # >> @Jim = User.new
67
+ # >> @Tom = User.new
68
+ # >> @Jim.save
69
+ # >> @Tom.save
70
+ # >> @Jim.follow(@Tom)
71
+ # >> @Tom.followee_of?(@Jim)
72
+ # => true
73
+ #
74
+ # Arguments:
75
+ # model: (instance of model(like User, Group))
76
+ def followee_of?(model)
77
+ return true if model.followee.include?(self.id) and self.follower.include?(model.id)
78
+ end
79
+
80
+ # follow a model
81
+ #
82
+ # Example:
83
+ # >> @Jim = User.new
84
+ # >> @Tom = User.new
85
+ # >> @Jim.save
86
+ # >> @Tom.save
87
+ # >> @Jim.follow(@Tom)
88
+ #
89
+ # Arguments:
90
+ # model: (instance of model(like User, Group))
91
+ def follow(model)
92
+ unless model == self
93
+ model.follower |= [self.id]
94
+ self.followee |= [model.id]
95
+ end
96
+ end
97
+
98
+ # cancel following a model
99
+ #
100
+ # Example:
101
+ # >> @Jim = User.new
102
+ # >> @Tom = User.new
103
+ # >> @Jim.save
104
+ # >> @Tom.save
105
+ # >> @Jim.follow(@Tom)
106
+ # >> @Jim.unfollow(@Tom)
107
+ #
108
+ # Arguments:
109
+ # model: (instance of model(like User, Group))
110
+ def unfollow(model)
111
+ unless model == self
112
+ model.follower -= [self.id]
113
+ self.followee -= [model.id]
114
+ end
115
+ end
116
+
117
+ # count followers of a model
118
+ #
119
+ # Example:
120
+ # >> @Jim = User.new
121
+ # >> @Tom = User.new
122
+ # >> @Jim.save
123
+ # >> @Tom.save
124
+ # >> @Jim.follow(@Tom)
125
+ # >> @Tom.follower_count
126
+ # => 1
127
+ #
128
+ # Arguments:
129
+ # none
130
+ def follower_count
131
+ self.follower.length
132
+ end
133
+
134
+ # count followees of a model
135
+ #
136
+ # Example:
137
+ # >> @Jim = User.new
138
+ # >> @Tom = User.new
139
+ # >> @Jim.save
140
+ # >> @Tom.save
141
+ # >> @Jim.follow(@Tom)
142
+ # >> @Jim.followee_count
143
+ # => 1
144
+ #
145
+ # Arguments:
146
+ # none
147
+ def followee_count
148
+ self.followee.length
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "mongoid_followable/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "mongoid_followable"
7
+ s.version = Mongoid::Followable::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.date = "2011-06-21"
10
+ s.authors = ["Jie Fan"]
11
+ s.email = ["ustc.flyingfox@gmail.com"]
12
+ s.homepage = "https://github.com/lastomato/mongoid_followable"
13
+ s.summary = %q{ adds following feature to models }
14
+ s.description = %q{ Mongoid Followable adds following feature to models }
15
+
16
+ s.rubyforge_project = "mongoid_followable"
17
+
18
+ s.add_dependency("mongoid", "~> 2.0.1")
19
+ s.add_dependency("bson_ext", "~> 1.3.0")
20
+ s.add_development_dependency("database_cleaner", "~> 0.6")
21
+ s.add_development_dependency("rspec", "~> 2.6")
22
+
23
+ s.files = `git ls-files`.split("\n")
24
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
25
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
26
+ s.require_paths = ["lib"]
27
+ end
@@ -0,0 +1,4 @@
1
+ class User
2
+ include Mongoid::Document
3
+ include Mongoid::Followable
4
+ end
@@ -0,0 +1,70 @@
1
+ require 'spec_helper'
2
+
3
+ module Mongoid
4
+ describe User do
5
+
6
+ let!(:u) { User.new }
7
+
8
+ context "certain user" do
9
+
10
+ before do
11
+ u.save
12
+ @v = User.new
13
+ @v.save
14
+ end
15
+
16
+ it "follows a user" do
17
+ u.follow(@v)
18
+ u.followee.include?(@v.id).should be_true
19
+ @v.follower.include?(u.id).should be_true
20
+
21
+ u.follower_of?(@v).should be_true
22
+ u.followee_of?(@v).should be_false
23
+ @v.follower_of?(u).should be_false
24
+ @v.followee_of?(u).should be_true
25
+
26
+ u.follower_of?(u).should be_false
27
+ @v.followee_of?(@v).should be_false
28
+ @v.follower_of?(@v).should be_false
29
+ u.followee_of?(u).should be_false
30
+
31
+ u.follower_count.should == 0
32
+ @v.follower_count.should == 1
33
+ u.followee_count.should == 1
34
+ @v.followee_count.should == 0
35
+
36
+ User.followers_of(@v).should == [u]
37
+ User.followees_of(@v).should == []
38
+ User.followers_of(u).should == []
39
+ User.followees_of(u).should == [@v]
40
+ end
41
+
42
+ it "unfollows a user" do
43
+ u.unfollow(@v)
44
+ u.followee.include?(@v.id).should be_false
45
+ @v.follower.include?(u.id).should be_false
46
+
47
+ u.follower_of?(@v).should be_false
48
+ u.followee_of?(@v).should be_false
49
+ @v.follower_of?(u).should be_false
50
+ @v.followee_of?(u).should be_false
51
+
52
+ u.follower_of?(u).should be_false
53
+ @v.followee_of?(@v).should be_false
54
+ @v.follower_of?(@v).should be_false
55
+ u.followee_of?(u).should be_false
56
+
57
+ u.follower_count.should == 0
58
+ @v.follower_count.should == 0
59
+ u.followee_count.should == 0
60
+ @v.followee_count.should == 0
61
+
62
+ User.followers_of(u).should == []
63
+ User.followees_of(u).should == []
64
+ User.followers_of(@v).should == []
65
+ User.followees_of(@v).should == []
66
+ end
67
+
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,20 @@
1
+ require "rubygems"
2
+ require "bundler/setup"
3
+
4
+ require "database_cleaner"
5
+ require "mongoid"
6
+ require "rspec"
7
+
8
+ Mongoid.configure do |config|
9
+ name = "mongoid_followable_test"
10
+ config.master = Mongo::Connection.new.db(name)
11
+ end
12
+
13
+ require File.expand_path("../../lib/mongoid_followable", __FILE__)
14
+
15
+ Dir["#{File.dirname(__FILE__)}/models/*.rb"].each { |f| require f }
16
+
17
+ RSpec.configure do |c|
18
+ c.before(:all) { DatabaseCleaner.strategy = :truncation }
19
+ c.before(:each) { DatabaseCleaner.clean }
20
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mongoid_followable
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Jie Fan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-21 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: mongoid
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 2.0.1
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: bson_ext
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 1.3.0
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: database_cleaner
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: "0.6"
47
+ type: :development
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: rspec
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: "2.6"
58
+ type: :development
59
+ version_requirements: *id004
60
+ description: " Mongoid Followable adds following feature to models "
61
+ email:
62
+ - ustc.flyingfox@gmail.com
63
+ executables: []
64
+
65
+ extensions: []
66
+
67
+ extra_rdoc_files: []
68
+
69
+ files:
70
+ - .gitignore
71
+ - .idea/.name
72
+ - .idea/.rakeTasks
73
+ - .idea/encodings.xml
74
+ - .idea/misc.xml
75
+ - .idea/modules.xml
76
+ - .idea/mongoid_followable.iml
77
+ - .idea/vcs.xml
78
+ - .idea/workspace.xml
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README
82
+ - README.rdoc
83
+ - Rakefile
84
+ - lib/mongoid_followable.rb
85
+ - lib/mongoid_followable/version.rb
86
+ - mongoid_followable.gemspec
87
+ - spec/models/user.rb
88
+ - spec/mongoid/followable_spec.rb
89
+ - spec/spec_helper.rb
90
+ has_rdoc: true
91
+ homepage: https://github.com/lastomato/mongoid_followable
92
+ licenses: []
93
+
94
+ post_install_message:
95
+ rdoc_options: []
96
+
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: "0"
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: "0"
111
+ requirements: []
112
+
113
+ rubyforge_project: mongoid_followable
114
+ rubygems_version: 1.6.2
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: adds following feature to models
118
+ test_files: []
119
+