mongoid_noteable 0.0.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/.gitignore +4 -0
- 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/mongoid_noteable.iml +33 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +374 -0
- data/Gemfile +4 -0
- data/README.rdoc +54 -0
- data/Rakefile +1 -0
- data/app/models/news.rb +15 -0
- data/lib/mongoid_noteable.rb +2 -0
- data/lib/mongoid_noteable/noteable.rb +75 -0
- data/lib/mongoid_noteable/version.rb +5 -0
- data/mongoid_noteable.gemspec +27 -0
- data/spec/models/user.rb +4 -0
- data/spec/mongoid/noteable_spec.rb +47 -0
- data/spec/spec_helper.rb +19 -0
- metadata +164 -0
data/.gitignore
ADDED
data/.idea/.name
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mongoid_noteable
|
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" /></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/mongoid_noteable.iml" filepath="$PROJECT_DIR$/.idea/mongoid_noteable.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
9
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="GemRequirementsHolder" version="3">
|
|
4
|
+
<requirement>
|
|
5
|
+
<requirement>
|
|
6
|
+
<dependency name="bson_ext" version="1.3.0" bound="LATEST_IN_BRANCH" git="false" path="false" doRequire="true" />
|
|
7
|
+
</requirement>
|
|
8
|
+
<source from="Gemfile" />
|
|
9
|
+
</requirement>
|
|
10
|
+
<requirement>
|
|
11
|
+
<requirement>
|
|
12
|
+
<dependency name="mongoid" version="2.0.1" bound="LATEST_IN_BRANCH" git="false" path="false" doRequire="true" />
|
|
13
|
+
</requirement>
|
|
14
|
+
<source from="Gemfile" />
|
|
15
|
+
</requirement>
|
|
16
|
+
</component>
|
|
17
|
+
<component name="NewModuleRootManager">
|
|
18
|
+
<content url="file://$MODULE_DIR$" />
|
|
19
|
+
<orderEntry type="inheritedJdk" />
|
|
20
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
21
|
+
<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" />
|
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] mongoid (v2.0.2, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/mongoid-2.0.2)" level="application" />
|
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] bson_ext (v1.3.1, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/bson_ext-1.3.1)" level="application" />
|
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] builder (v2.1.2, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/builder-2.1.2)" level="application" />
|
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] activemodel (v3.0.9, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/activemodel-3.0.9)" level="application" />
|
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] bson (v1.3.1, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/bson-1.3.1)" level="application" />
|
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] i18n (v0.5.0, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/i18n-0.5.0)" level="application" />
|
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] activesupport (v3.0.9, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.9)" level="application" />
|
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] tzinfo (v0.3.28, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/tzinfo-0.3.28)" level="application" />
|
|
30
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] mongo (v1.3.1, /home/tomato/.rvm/gems/ruby-1.9.2-p136/gems/mongo-1.3.1)" level="application" />
|
|
31
|
+
</component>
|
|
32
|
+
</module>
|
|
33
|
+
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ChangeListManager">
|
|
4
|
+
<list default="true" id="1a94e103-1ad3-40a8-891c-00696e1e7b3a" name="Default" comment="" />
|
|
5
|
+
<ignored path="mongoid_noteable.iws" />
|
|
6
|
+
<ignored path=".idea/workspace.xml" />
|
|
7
|
+
<option name="TRACKING_ENABLED" value="true" />
|
|
8
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
9
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
11
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
|
14
|
+
<component name="CoverageDataManager" choice="3" />
|
|
15
|
+
<component name="CreatePatchCommitExecutor">
|
|
16
|
+
<option name="PATCH_PATH" value="" />
|
|
17
|
+
<option name="REVERSE_PATCH" value="false" />
|
|
18
|
+
</component>
|
|
19
|
+
<component name="DaemonCodeAnalyzer">
|
|
20
|
+
<disable_hints />
|
|
21
|
+
</component>
|
|
22
|
+
<component name="FavoritesManager">
|
|
23
|
+
<favorites_list name="mongoid_noteable" />
|
|
24
|
+
</component>
|
|
25
|
+
<component name="FileEditorManager">
|
|
26
|
+
<leaf>
|
|
27
|
+
<file leaf-file-name="mongoid_noteable.gemspec" pinned="false" current="true" current-in-tab="true">
|
|
28
|
+
<entry file="file://$PROJECT_DIR$/mongoid_noteable.gemspec">
|
|
29
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
30
|
+
<state line="10" column="64" selection-start="391" selection-end="391" vertical-scroll-proportion="0.2173913">
|
|
31
|
+
<folding />
|
|
32
|
+
</state>
|
|
33
|
+
</provider>
|
|
34
|
+
</entry>
|
|
35
|
+
</file>
|
|
36
|
+
</leaf>
|
|
37
|
+
</component>
|
|
38
|
+
<component name="FindManager">
|
|
39
|
+
<FindUsagesManager>
|
|
40
|
+
<setting name="OPEN_NEW_TAB" value="false" />
|
|
41
|
+
</FindUsagesManager>
|
|
42
|
+
</component>
|
|
43
|
+
<component name="Git.Settings">
|
|
44
|
+
<option name="CHECKOUT_INCLUDE_TAGS" value="false" />
|
|
45
|
+
<option name="UPDATE_CHANGES_POLICY" value="STASH" />
|
|
46
|
+
</component>
|
|
47
|
+
<component name="IdeDocumentHistory">
|
|
48
|
+
<option name="changedFiles">
|
|
49
|
+
<list>
|
|
50
|
+
<option value="$PROJECT_DIR$/lib/mongoid_noteable.rb" />
|
|
51
|
+
<option value="$PROJECT_DIR$/spec/models/user.rb" />
|
|
52
|
+
<option value="$PROJECT_DIR$/spec/spec_helper.rb" />
|
|
53
|
+
<option value="$PROJECT_DIR$/lib/mongoid_noteable/version.rb" />
|
|
54
|
+
<option value="$PROJECT_DIR$/app/models/news.rb" />
|
|
55
|
+
<option value="$PROJECT_DIR$/spec/mongoid/noteable_spec.rb" />
|
|
56
|
+
<option value="$PROJECT_DIR$/lib/mongoid_noteable/noteable.rb" />
|
|
57
|
+
<option value="$PROJECT_DIR$/README.rdoc" />
|
|
58
|
+
<option value="$PROJECT_DIR$/mongoid_noteable.gemspec" />
|
|
59
|
+
</list>
|
|
60
|
+
</option>
|
|
61
|
+
</component>
|
|
62
|
+
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
63
|
+
<OptionsSetting value="true" id="Add" />
|
|
64
|
+
<OptionsSetting value="true" id="Remove" />
|
|
65
|
+
<OptionsSetting value="true" id="Checkout" />
|
|
66
|
+
<OptionsSetting value="true" id="Update" />
|
|
67
|
+
<OptionsSetting value="true" id="Status" />
|
|
68
|
+
<OptionsSetting value="true" id="Edit" />
|
|
69
|
+
<ConfirmationsSetting value="0" id="Add" />
|
|
70
|
+
<ConfirmationsSetting value="0" id="Remove" />
|
|
71
|
+
</component>
|
|
72
|
+
<component name="ProjectReloadState">
|
|
73
|
+
<option name="STATE" value="0" />
|
|
74
|
+
</component>
|
|
75
|
+
<component name="ProjectView">
|
|
76
|
+
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
|
|
77
|
+
<flattenPackages />
|
|
78
|
+
<showMembers />
|
|
79
|
+
<showModules />
|
|
80
|
+
<showLibraryContents />
|
|
81
|
+
<hideEmptyPackages />
|
|
82
|
+
<abbreviatePackageNames />
|
|
83
|
+
<autoscrollToSource />
|
|
84
|
+
<autoscrollFromSource />
|
|
85
|
+
<sortByType />
|
|
86
|
+
</navigator>
|
|
87
|
+
<panes>
|
|
88
|
+
<pane id="ProjectPane">
|
|
89
|
+
<subPane>
|
|
90
|
+
<PATH>
|
|
91
|
+
<PATH_ELEMENT>
|
|
92
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
93
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
94
|
+
</PATH_ELEMENT>
|
|
95
|
+
</PATH>
|
|
96
|
+
<PATH>
|
|
97
|
+
<PATH_ELEMENT>
|
|
98
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
99
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
100
|
+
</PATH_ELEMENT>
|
|
101
|
+
<PATH_ELEMENT>
|
|
102
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
103
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
104
|
+
</PATH_ELEMENT>
|
|
105
|
+
</PATH>
|
|
106
|
+
<PATH>
|
|
107
|
+
<PATH_ELEMENT>
|
|
108
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
109
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
110
|
+
</PATH_ELEMENT>
|
|
111
|
+
<PATH_ELEMENT>
|
|
112
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
113
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
114
|
+
</PATH_ELEMENT>
|
|
115
|
+
<PATH_ELEMENT>
|
|
116
|
+
<option name="myItemId" value="spec" />
|
|
117
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
118
|
+
</PATH_ELEMENT>
|
|
119
|
+
</PATH>
|
|
120
|
+
<PATH>
|
|
121
|
+
<PATH_ELEMENT>
|
|
122
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
123
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
124
|
+
</PATH_ELEMENT>
|
|
125
|
+
<PATH_ELEMENT>
|
|
126
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
127
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
128
|
+
</PATH_ELEMENT>
|
|
129
|
+
<PATH_ELEMENT>
|
|
130
|
+
<option name="myItemId" value="spec" />
|
|
131
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
132
|
+
</PATH_ELEMENT>
|
|
133
|
+
<PATH_ELEMENT>
|
|
134
|
+
<option name="myItemId" value="mongoid" />
|
|
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_noteable" />
|
|
141
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
142
|
+
</PATH_ELEMENT>
|
|
143
|
+
<PATH_ELEMENT>
|
|
144
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
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="models" />
|
|
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_noteable" />
|
|
159
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
160
|
+
</PATH_ELEMENT>
|
|
161
|
+
<PATH_ELEMENT>
|
|
162
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
163
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
164
|
+
</PATH_ELEMENT>
|
|
165
|
+
<PATH_ELEMENT>
|
|
166
|
+
<option name="myItemId" value="lib" />
|
|
167
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
168
|
+
</PATH_ELEMENT>
|
|
169
|
+
</PATH>
|
|
170
|
+
<PATH>
|
|
171
|
+
<PATH_ELEMENT>
|
|
172
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
173
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
174
|
+
</PATH_ELEMENT>
|
|
175
|
+
<PATH_ELEMENT>
|
|
176
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
177
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
178
|
+
</PATH_ELEMENT>
|
|
179
|
+
<PATH_ELEMENT>
|
|
180
|
+
<option name="myItemId" value="lib" />
|
|
181
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
182
|
+
</PATH_ELEMENT>
|
|
183
|
+
<PATH_ELEMENT>
|
|
184
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
185
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
186
|
+
</PATH_ELEMENT>
|
|
187
|
+
</PATH>
|
|
188
|
+
<PATH>
|
|
189
|
+
<PATH_ELEMENT>
|
|
190
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
191
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
192
|
+
</PATH_ELEMENT>
|
|
193
|
+
<PATH_ELEMENT>
|
|
194
|
+
<option name="myItemId" value="mongoid_noteable" />
|
|
195
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
196
|
+
</PATH_ELEMENT>
|
|
197
|
+
<PATH_ELEMENT>
|
|
198
|
+
<option name="myItemId" value="app" />
|
|
199
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
200
|
+
</PATH_ELEMENT>
|
|
201
|
+
<PATH_ELEMENT>
|
|
202
|
+
<option name="myItemId" value="models" />
|
|
203
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
204
|
+
</PATH_ELEMENT>
|
|
205
|
+
</PATH>
|
|
206
|
+
</subPane>
|
|
207
|
+
</pane>
|
|
208
|
+
<pane id="Favorites" />
|
|
209
|
+
<pane id="Scope" />
|
|
210
|
+
</panes>
|
|
211
|
+
</component>
|
|
212
|
+
<component name="RunManager">
|
|
213
|
+
<configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
|
|
214
|
+
<module name="" />
|
|
215
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
|
216
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
|
|
217
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
|
218
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
|
219
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
|
220
|
+
<envs />
|
|
221
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
|
222
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" track_test_folders="true" runner="rcov">
|
|
223
|
+
<COVERAGE_PATTERN ENABLED="true">
|
|
224
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
|
225
|
+
</COVERAGE_PATTERN>
|
|
226
|
+
</EXTENSION>
|
|
227
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
|
|
228
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
|
|
229
|
+
<method />
|
|
230
|
+
</configuration>
|
|
231
|
+
<list size="0" />
|
|
232
|
+
</component>
|
|
233
|
+
<component name="ShelveChangesManager" show_recycled="false" />
|
|
234
|
+
<component name="SvnConfiguration" maxAnnotateRevisions="500">
|
|
235
|
+
<option name="USER" value="" />
|
|
236
|
+
<option name="PASSWORD" value="" />
|
|
237
|
+
<option name="LAST_MERGED_REVISION" />
|
|
238
|
+
<option name="MERGE_DRY_RUN" value="false" />
|
|
239
|
+
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
|
|
240
|
+
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
|
|
241
|
+
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
|
|
242
|
+
<option name="DETECT_NESTED_COPIES" value="true" />
|
|
243
|
+
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
|
|
244
|
+
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
|
|
245
|
+
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
|
|
246
|
+
<option name="FORCE_UPDATE" value="false" />
|
|
247
|
+
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
|
|
248
|
+
</component>
|
|
249
|
+
<component name="TaskManager">
|
|
250
|
+
<task active="true" id="Default" summary="Default task">
|
|
251
|
+
<changelist id="1a94e103-1ad3-40a8-891c-00696e1e7b3a" name="Default" comment="" />
|
|
252
|
+
<created>1308797913561</created>
|
|
253
|
+
<updated>1308797913561</updated>
|
|
254
|
+
</task>
|
|
255
|
+
<servers />
|
|
256
|
+
</component>
|
|
257
|
+
<component name="ToolWindowManager">
|
|
258
|
+
<frame x="1" y="24" width="1598" height="851" extended-state="1" />
|
|
259
|
+
<editor active="true" />
|
|
260
|
+
<layout>
|
|
261
|
+
<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" />
|
|
262
|
+
<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" />
|
|
263
|
+
<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" />
|
|
264
|
+
<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" />
|
|
265
|
+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.1910828" sideWeight="0.67128986" order="0" side_tool="false" content_ui="tabs" />
|
|
266
|
+
<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" />
|
|
267
|
+
<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" />
|
|
268
|
+
<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" />
|
|
269
|
+
<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" />
|
|
270
|
+
<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" />
|
|
271
|
+
<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" />
|
|
272
|
+
<window_info id="Find" 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" />
|
|
273
|
+
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32871014" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
|
274
|
+
<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" />
|
|
275
|
+
<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" />
|
|
276
|
+
<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" />
|
|
277
|
+
</layout>
|
|
278
|
+
</component>
|
|
279
|
+
<component name="VcsManagerConfiguration">
|
|
280
|
+
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
|
|
281
|
+
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
|
|
282
|
+
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
|
|
283
|
+
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
|
|
284
|
+
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
|
|
285
|
+
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
|
|
286
|
+
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
|
|
287
|
+
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
|
|
288
|
+
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
|
|
289
|
+
<option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
|
|
290
|
+
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
|
|
291
|
+
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
|
|
292
|
+
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
|
|
293
|
+
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
|
|
294
|
+
<option name="LAST_COMMIT_MESSAGE" />
|
|
295
|
+
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
|
|
296
|
+
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
|
|
297
|
+
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
|
|
298
|
+
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
|
|
299
|
+
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
|
|
300
|
+
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
|
|
301
|
+
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
|
|
302
|
+
<option name="ACTIVE_VCS_NAME" />
|
|
303
|
+
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
|
|
304
|
+
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
|
|
305
|
+
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
|
|
306
|
+
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
|
|
307
|
+
</component>
|
|
308
|
+
<component name="XDebuggerManager">
|
|
309
|
+
<breakpoint-manager />
|
|
310
|
+
</component>
|
|
311
|
+
<component name="editorHistoryManager">
|
|
312
|
+
<entry file="file://$PROJECT_DIR$/spec/models/user.rb">
|
|
313
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
314
|
+
<state line="2" column="27" selection-start="66" selection-end="66" vertical-scroll-proportion="0.04347826" />
|
|
315
|
+
</provider>
|
|
316
|
+
</entry>
|
|
317
|
+
<entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
|
|
318
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
319
|
+
<state line="13" column="52" selection-start="340" selection-end="340" vertical-scroll-proportion="0.2826087" />
|
|
320
|
+
</provider>
|
|
321
|
+
</entry>
|
|
322
|
+
<entry file="file://$PROJECT_DIR$/lib/mongoid_noteable/version.rb">
|
|
323
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
324
|
+
<state line="3" column="5" selection-start="60" selection-end="60" vertical-scroll-proportion="0.06521739" />
|
|
325
|
+
</provider>
|
|
326
|
+
</entry>
|
|
327
|
+
<entry file="file://$PROJECT_DIR$/Rakefile">
|
|
328
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
329
|
+
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
|
|
330
|
+
</provider>
|
|
331
|
+
</entry>
|
|
332
|
+
<entry file="file://$PROJECT_DIR$/spec/mongoid/noteable_spec.rb">
|
|
333
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
334
|
+
<state line="42" column="23" selection-start="1836" selection-end="1836" vertical-scroll-proportion="0.86410636">
|
|
335
|
+
<folding />
|
|
336
|
+
</state>
|
|
337
|
+
</provider>
|
|
338
|
+
</entry>
|
|
339
|
+
<entry file="file://$PROJECT_DIR$/app/models/news.rb">
|
|
340
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
341
|
+
<state line="13" column="15" selection-start="451" selection-end="451" vertical-scroll-proportion="0.2826087">
|
|
342
|
+
<folding />
|
|
343
|
+
</state>
|
|
344
|
+
</provider>
|
|
345
|
+
</entry>
|
|
346
|
+
<entry file="file://$PROJECT_DIR$/lib/mongoid_noteable.rb">
|
|
347
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
348
|
+
<state line="0" column="59" selection-start="59" selection-end="59" vertical-scroll-proportion="0.0" />
|
|
349
|
+
</provider>
|
|
350
|
+
</entry>
|
|
351
|
+
<entry file="file://$PROJECT_DIR$/README.rdoc">
|
|
352
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
353
|
+
<state line="49" column="30" selection-start="1314" selection-end="1314" vertical-scroll-proportion="1.0652174">
|
|
354
|
+
<folding />
|
|
355
|
+
</state>
|
|
356
|
+
</provider>
|
|
357
|
+
</entry>
|
|
358
|
+
<entry file="file://$PROJECT_DIR$/lib/mongoid_noteable/noteable.rb">
|
|
359
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
360
|
+
<state line="64" column="21" selection-start="1409" selection-end="1409" vertical-scroll-proportion="1.3913044">
|
|
361
|
+
<folding />
|
|
362
|
+
</state>
|
|
363
|
+
</provider>
|
|
364
|
+
</entry>
|
|
365
|
+
<entry file="file://$PROJECT_DIR$/mongoid_noteable.gemspec">
|
|
366
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
367
|
+
<state line="10" column="64" selection-start="391" selection-end="391" vertical-scroll-proportion="0.2173913">
|
|
368
|
+
<folding />
|
|
369
|
+
</state>
|
|
370
|
+
</provider>
|
|
371
|
+
</entry>
|
|
372
|
+
</component>
|
|
373
|
+
</project>
|
|
374
|
+
|
data/Gemfile
ADDED
data/README.rdoc
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
= mongoid_noteable
|
|
2
|
+
|
|
3
|
+
acts just like facebook's news feed(recommend to be used with mongoid_followable[https://github.com/lastomato/mongoid_followable])
|
|
4
|
+
|
|
5
|
+
== Installation
|
|
6
|
+
|
|
7
|
+
In console:
|
|
8
|
+
gem install mongoid_noteable
|
|
9
|
+
or in Gemfile:
|
|
10
|
+
gem 'mongoid_noteable', "~> 0.0.1"
|
|
11
|
+
|
|
12
|
+
== Usage
|
|
13
|
+
|
|
14
|
+
To make model noteable you need to include Mongoid::Noteable into your document. Using it accompany with mongoid_followable is recommended.
|
|
15
|
+
class User
|
|
16
|
+
include Mongoid::Document
|
|
17
|
+
include Mongoid::Follower
|
|
18
|
+
include Mongoid::Noteable
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
class Group
|
|
22
|
+
include Mongoid::Document
|
|
23
|
+
include Mongoid::Followable
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
Now you can follow others in your controller:
|
|
27
|
+
...
|
|
28
|
+
# This is what mongoid_followable does
|
|
29
|
+
@group = Group.new
|
|
30
|
+
@group.save
|
|
31
|
+
|
|
32
|
+
current_user.follow(@group)
|
|
33
|
+
|
|
34
|
+
# Below is what mongoid_noteable does
|
|
35
|
+
current_user.add_news(@group.name, "published", @some_post.name)
|
|
36
|
+
current_user.recent_news
|
|
37
|
+
current_user.news_with_subject(@group.name)
|
|
38
|
+
current_user.news_with_action("published")
|
|
39
|
+
current_user.news_with_object(@some_object.some_attribute)
|
|
40
|
+
...
|
|
41
|
+
|
|
42
|
+
* Any bug or issue, please send me an email: ustc.flyingfox@gmail.com
|
|
43
|
+
|
|
44
|
+
== TODO
|
|
45
|
+
|
|
46
|
+
* fix bug in test
|
|
47
|
+
* news_like_* methods for fuzzy search
|
|
48
|
+
* more fields(Besides "subject", "action" and "object") in News.
|
|
49
|
+
|
|
50
|
+
(If you have any idea, advice or suggestion, don't hesitate to contact me!)
|
|
51
|
+
|
|
52
|
+
== Copyright
|
|
53
|
+
|
|
54
|
+
Copyright (c) Jie Fan. See LICENSE.txt for further details.
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/app/models/news.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class News
|
|
2
|
+
include Mongoid::Document
|
|
3
|
+
include Mongoid::Timestamps
|
|
4
|
+
|
|
5
|
+
field :subject, :type => String
|
|
6
|
+
field :action, :type => String
|
|
7
|
+
field :object, :type => String
|
|
8
|
+
|
|
9
|
+
belongs_to :noteable, :polymorphic => true
|
|
10
|
+
|
|
11
|
+
scope :desc_created_at, desc(:created_at)
|
|
12
|
+
scope :by_field, lambda { |name, value| where(name.to_sym => value).desc_created_at }
|
|
13
|
+
scope :by_time, lambda { |t| where(:created_at.gt => Time.now - t).desc_created_at }
|
|
14
|
+
scope :before, lambda { |t| where(:created_at.lt => Time.now - t).desc_created_at }
|
|
15
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
module Mongoid
|
|
2
|
+
module Noteable
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do |base|
|
|
6
|
+
base.field :news_count, :type => Integer, :default => 100
|
|
7
|
+
base.has_many :news, :class_name => "News", :as => :noteable, :dependent => :destroy
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# set how many pieces of news one user can have
|
|
11
|
+
#
|
|
12
|
+
# Example:
|
|
13
|
+
# >> @u = User.new
|
|
14
|
+
# >> @u.save
|
|
15
|
+
# >> @u.set_news_limit(1000)
|
|
16
|
+
# => true
|
|
17
|
+
#
|
|
18
|
+
# Arguments:
|
|
19
|
+
# limit => Integer
|
|
20
|
+
|
|
21
|
+
def set_news_limit(limit)
|
|
22
|
+
self.update_attribute(:news_count, limit)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# add one piece of news
|
|
26
|
+
#
|
|
27
|
+
# Example:
|
|
28
|
+
# >> @u.add_news("I", "voted for", "Bush")
|
|
29
|
+
# => nil
|
|
30
|
+
#
|
|
31
|
+
# Arguments:
|
|
32
|
+
# args => news objects
|
|
33
|
+
|
|
34
|
+
def add_news(*args)
|
|
35
|
+
self.news.create!(:subject => args[0].to_s, :action => args[1].to_s, :object => args[2].to_s)
|
|
36
|
+
|
|
37
|
+
if self.news.count > self.news_count
|
|
38
|
+
self.news[self.news_count..-1].each do |news|
|
|
39
|
+
news.destroy
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
#get all news
|
|
45
|
+
|
|
46
|
+
def all_news
|
|
47
|
+
rebuild_news(self.news.desc_created_at)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
#get all recent news
|
|
51
|
+
|
|
52
|
+
def recent_news(time = 3600)
|
|
53
|
+
rebuild_news(self.news.by_time(time))
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
#define 3 methods
|
|
57
|
+
|
|
58
|
+
def method_missing(name, *args)
|
|
59
|
+
if name.to_s =~ /^news_with_(subject|action|object)$/i
|
|
60
|
+
rebuild_news(self.news.by_field($1, args[0]))
|
|
61
|
+
else
|
|
62
|
+
super
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
private
|
|
67
|
+
def rebuild_news(news_list)
|
|
68
|
+
news = []
|
|
69
|
+
news_list.each do |n|
|
|
70
|
+
news << n.subject + ' ' + n.action + ' ' + n.object
|
|
71
|
+
end
|
|
72
|
+
news
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
require "mongoid_noteable/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = "mongoid_noteable"
|
|
7
|
+
s.version = Mongoid::Noteable::VERSION
|
|
8
|
+
s.date = "2011-06-23"
|
|
9
|
+
s.authors = ["Jie Fan"]
|
|
10
|
+
s.email = ["ustc.flyingfox@gmail.com"]
|
|
11
|
+
s.homepage = "https://github.com/lastomato/mongoid_noteable"
|
|
12
|
+
s.summary = %q{ adds news feature to models }
|
|
13
|
+
s.description = %q{ Mongoid Noteable adds news feature to models }
|
|
14
|
+
|
|
15
|
+
s.rubyforge_project = "mongoid_noteable"
|
|
16
|
+
|
|
17
|
+
s.add_dependency("mongoid", "~> 2.0.1")
|
|
18
|
+
s.add_dependency("bson_ext", "~> 1.3.0")
|
|
19
|
+
s.add_dependency("mongoid_followable", "~> 0.1.1")
|
|
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
|
data/spec/models/user.rb
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Mongoid::Noteable do
|
|
4
|
+
|
|
5
|
+
describe User do
|
|
6
|
+
|
|
7
|
+
let!(:u) { User.new }
|
|
8
|
+
|
|
9
|
+
context "begins" do
|
|
10
|
+
|
|
11
|
+
before do
|
|
12
|
+
u.save
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "setting news count" do
|
|
16
|
+
u.news_count.should == 100
|
|
17
|
+
u.set_news_limit(5)
|
|
18
|
+
u.news_count.should == 5
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "adding several news" do
|
|
22
|
+
u.add_news("Shannon", "published", "A Symbolic Analysis of Relay and Switching Circuits")
|
|
23
|
+
sleep(1)
|
|
24
|
+
u.add_news("Shamir", "commented", "'Great Job!'")
|
|
25
|
+
sleep(1)
|
|
26
|
+
u.add_news("Cover", "commented", "'Nice!'")
|
|
27
|
+
sleep(1)
|
|
28
|
+
u.add_news("Zheng", "shouted", "'Wow!'")
|
|
29
|
+
sleep(1)
|
|
30
|
+
u.add_news("I", "cannot understand", "what they are saying")
|
|
31
|
+
sleep(1)
|
|
32
|
+
|
|
33
|
+
u.all_news.should == ["I cannot understand what they are saying", "Zheng shouted 'Wow!'", "Cover commented 'Nice!'", "Shamir commented 'Great Job!'", "Shannon published A Symbolic Analysis of Relay and Switching Circuits"]
|
|
34
|
+
u.recent_news.should == ["I cannot understand what they are saying", "Zheng shouted 'Wow!'", "Cover commented 'Nice!'", "Shamir commented 'Great Job!'", "Shannon published A Symbolic Analysis of Relay and Switching Circuits"]
|
|
35
|
+
u.recent_news(5400).should == ["I cannot understand what they are saying", "Zheng shouted 'Wow!'", "Cover commented 'Nice!'", "Shamir commented 'Great Job!'", "Shannon published A Symbolic Analysis of Relay and Switching Circuits"]
|
|
36
|
+
|
|
37
|
+
u.news_with_subject("Shannon").should == ["Shannon published A Symbolic Analysis of Relay and Switching Circuits"]
|
|
38
|
+
u.news_with_action("commented").should == ["Cover commented 'Nice!'", "Shamir commented 'Great Job!'"]
|
|
39
|
+
u.news_with_object("'Wow!'").should == ["Zheng shouted 'Wow!'"]
|
|
40
|
+
|
|
41
|
+
u.add_news("I", "come back", "again")
|
|
42
|
+
|
|
43
|
+
u.all_news[0..4].should == ["I come back again", "I cannot understand what they are saying", "Zheng shouted 'Wow!'", "Cover commented 'Nice!'", "Shamir commented 'Great Job!'"]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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_noteable_test"
|
|
10
|
+
config.master = Mongo::Connection.new.db(name)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
require File.expand_path("../../lib/mongoid_noteable", __FILE__)
|
|
14
|
+
require File.expand_path("../models/user", __FILE__)
|
|
15
|
+
|
|
16
|
+
RSpec.configure do |c|
|
|
17
|
+
c.before(:all) { DatabaseCleaner.strategy = :truncation }
|
|
18
|
+
c.before(:each) { DatabaseCleaner.clean }
|
|
19
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: mongoid_noteable
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 29
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 0
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.0.1
|
|
11
|
+
platform: ruby
|
|
12
|
+
authors:
|
|
13
|
+
- Jie Fan
|
|
14
|
+
autorequire:
|
|
15
|
+
bindir: bin
|
|
16
|
+
cert_chain: []
|
|
17
|
+
|
|
18
|
+
date: 2011-06-23 00:00:00 -04:00
|
|
19
|
+
default_executable:
|
|
20
|
+
dependencies:
|
|
21
|
+
- !ruby/object:Gem::Dependency
|
|
22
|
+
name: mongoid
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 13
|
|
30
|
+
segments:
|
|
31
|
+
- 2
|
|
32
|
+
- 0
|
|
33
|
+
- 1
|
|
34
|
+
version: 2.0.1
|
|
35
|
+
type: :runtime
|
|
36
|
+
version_requirements: *id001
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
38
|
+
name: bson_ext
|
|
39
|
+
prerelease: false
|
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ~>
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
hash: 27
|
|
46
|
+
segments:
|
|
47
|
+
- 1
|
|
48
|
+
- 3
|
|
49
|
+
- 0
|
|
50
|
+
version: 1.3.0
|
|
51
|
+
type: :runtime
|
|
52
|
+
version_requirements: *id002
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
54
|
+
name: mongoid_followable
|
|
55
|
+
prerelease: false
|
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ~>
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
hash: 25
|
|
62
|
+
segments:
|
|
63
|
+
- 0
|
|
64
|
+
- 1
|
|
65
|
+
- 1
|
|
66
|
+
version: 0.1.1
|
|
67
|
+
type: :runtime
|
|
68
|
+
version_requirements: *id003
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: database_cleaner
|
|
71
|
+
prerelease: false
|
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ~>
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
hash: 7
|
|
78
|
+
segments:
|
|
79
|
+
- 0
|
|
80
|
+
- 6
|
|
81
|
+
version: "0.6"
|
|
82
|
+
type: :development
|
|
83
|
+
version_requirements: *id004
|
|
84
|
+
- !ruby/object:Gem::Dependency
|
|
85
|
+
name: rspec
|
|
86
|
+
prerelease: false
|
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
88
|
+
none: false
|
|
89
|
+
requirements:
|
|
90
|
+
- - ~>
|
|
91
|
+
- !ruby/object:Gem::Version
|
|
92
|
+
hash: 15
|
|
93
|
+
segments:
|
|
94
|
+
- 2
|
|
95
|
+
- 6
|
|
96
|
+
version: "2.6"
|
|
97
|
+
type: :development
|
|
98
|
+
version_requirements: *id005
|
|
99
|
+
description: " Mongoid Noteable adds news feature to models "
|
|
100
|
+
email:
|
|
101
|
+
- ustc.flyingfox@gmail.com
|
|
102
|
+
executables: []
|
|
103
|
+
|
|
104
|
+
extensions: []
|
|
105
|
+
|
|
106
|
+
extra_rdoc_files: []
|
|
107
|
+
|
|
108
|
+
files:
|
|
109
|
+
- .gitignore
|
|
110
|
+
- .idea/.name
|
|
111
|
+
- .idea/.rakeTasks
|
|
112
|
+
- .idea/encodings.xml
|
|
113
|
+
- .idea/misc.xml
|
|
114
|
+
- .idea/modules.xml
|
|
115
|
+
- .idea/mongoid_noteable.iml
|
|
116
|
+
- .idea/vcs.xml
|
|
117
|
+
- .idea/workspace.xml
|
|
118
|
+
- Gemfile
|
|
119
|
+
- README.rdoc
|
|
120
|
+
- Rakefile
|
|
121
|
+
- app/models/news.rb
|
|
122
|
+
- lib/mongoid_noteable.rb
|
|
123
|
+
- lib/mongoid_noteable/noteable.rb
|
|
124
|
+
- lib/mongoid_noteable/version.rb
|
|
125
|
+
- mongoid_noteable.gemspec
|
|
126
|
+
- spec/models/user.rb
|
|
127
|
+
- spec/mongoid/noteable_spec.rb
|
|
128
|
+
- spec/spec_helper.rb
|
|
129
|
+
has_rdoc: true
|
|
130
|
+
homepage: https://github.com/lastomato/mongoid_noteable
|
|
131
|
+
licenses: []
|
|
132
|
+
|
|
133
|
+
post_install_message:
|
|
134
|
+
rdoc_options: []
|
|
135
|
+
|
|
136
|
+
require_paths:
|
|
137
|
+
- lib
|
|
138
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
|
+
none: false
|
|
140
|
+
requirements:
|
|
141
|
+
- - ">="
|
|
142
|
+
- !ruby/object:Gem::Version
|
|
143
|
+
hash: 3
|
|
144
|
+
segments:
|
|
145
|
+
- 0
|
|
146
|
+
version: "0"
|
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
|
+
none: false
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
hash: 3
|
|
153
|
+
segments:
|
|
154
|
+
- 0
|
|
155
|
+
version: "0"
|
|
156
|
+
requirements: []
|
|
157
|
+
|
|
158
|
+
rubyforge_project: mongoid_noteable
|
|
159
|
+
rubygems_version: 1.4.1
|
|
160
|
+
signing_key:
|
|
161
|
+
specification_version: 3
|
|
162
|
+
summary: adds news feature to models
|
|
163
|
+
test_files: []
|
|
164
|
+
|