scoped_enum 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +35 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +5 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scoped_enum.iml +30 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +526 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +50 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/scoped_enum.rb +52 -0
- data/lib/scoped_enum/version.rb +3 -0
- data/scoped_enum.gemspec +29 -0
- metadata +177 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7daf1502aaeb4d1449bed5131ec2482d497085de
|
4
|
+
data.tar.gz: 8e981d0df2a772935ba5535530a84ad3f8a0cb4c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d208a9db5a4c6ba271abe888a15f6dc935eb0ad1a1c0783697a23053499705fe9854377923791ac82a24325582a579bdd9beaa5689d033a5d304cfe02fdb81c1
|
7
|
+
data.tar.gz: 83243c240d08fd74ddf65578b21b0605915e24dd19e0f763d5334fce1b356198c11bac0e6e26c8781b26f47809c89ebde8238a01d1bf059d1f7396fca2644050
|
data/.gitignore
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
*.rbc
|
2
|
+
capybara-*.html
|
3
|
+
.rspec
|
4
|
+
/log
|
5
|
+
/tmp
|
6
|
+
/db/*.sqlite3
|
7
|
+
/db/*.sqlite3-journal
|
8
|
+
/public/system
|
9
|
+
/coverage/
|
10
|
+
/spec/tmp
|
11
|
+
**.orig
|
12
|
+
rerun.txt
|
13
|
+
pickle-email-*.html
|
14
|
+
|
15
|
+
# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
|
16
|
+
config/initializers/secret_token.rb
|
17
|
+
config/secrets.yml
|
18
|
+
|
19
|
+
## Environment normalisation:
|
20
|
+
/.bundle
|
21
|
+
/vendor/bundle
|
22
|
+
|
23
|
+
# these should all be checked in to normalise the environment:
|
24
|
+
# Gemfile.lock, .ruby-version, .ruby-gemset
|
25
|
+
|
26
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
27
|
+
.rvmrc
|
28
|
+
|
29
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
30
|
+
/vendor/assets/bower_components
|
31
|
+
*.bowerrc
|
32
|
+
bower.json
|
33
|
+
|
34
|
+
# Ignore pow environment settings
|
35
|
+
.powenv
|
data/.idea/.name
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
scoped_enum
|
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 scoped_enum-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install scoped_enum-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.1.0 and build and push scoped_enum-0.1.0.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
|
data/.idea/encodings.xml
ADDED
data/.idea/misc.xml
ADDED
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/scoped_enum.iml" filepath="$PROJECT_DIR$/.idea/scoped_enum.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
9
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="CompassSettings">
|
4
|
+
<option name="compassSupportEnabled" value="true" />
|
5
|
+
</component>
|
6
|
+
<component name="FacetManager">
|
7
|
+
<facet type="gem" name="Ruby Gem">
|
8
|
+
<configuration>
|
9
|
+
<option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
|
10
|
+
<option name="GEM_APP_TEST_PATH" value="" />
|
11
|
+
<option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
|
12
|
+
</configuration>
|
13
|
+
</facet>
|
14
|
+
</component>
|
15
|
+
<component name="NewModuleRootManager">
|
16
|
+
<content url="file://$MODULE_DIR$" />
|
17
|
+
<orderEntry type="inheritedJdk" />
|
18
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="activerecord (v4.1.5, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="arel (v5.0.1.20140414130214, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.2, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="erubis (v2.7.0, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="factory_girl_rails (v4.4.1, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v10.3.2, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="thor (v0.19.1, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v1.2.2, RVM: ruby-1.9.3-p547) [gem]" level="application" />
|
28
|
+
</component>
|
29
|
+
</module>
|
30
|
+
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
@@ -0,0 +1,526 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ChangeListManager">
|
4
|
+
<list default="true" id="a257f218-e101-4b01-9af7-63ec6466cb06" name="Default" comment="">
|
5
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile.lock" afterPath="$PROJECT_DIR$/Gemfile.lock" />
|
6
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/scoped_enum.gemspec" afterPath="$PROJECT_DIR$/scoped_enum.gemspec" />
|
7
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/scoped_enum.iml" afterPath="$PROJECT_DIR$/.idea/scoped_enum.iml" />
|
8
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
9
|
+
</list>
|
10
|
+
<ignored path="scoped_enum.iws" />
|
11
|
+
<ignored path=".idea/workspace.xml" />
|
12
|
+
<option name="TRACKING_ENABLED" value="true" />
|
13
|
+
<option name="SHOW_DIALOG" value="false" />
|
14
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
15
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
16
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
17
|
+
</component>
|
18
|
+
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
19
|
+
<component name="CreatePatchCommitExecutor">
|
20
|
+
<option name="PATCH_PATH" value="" />
|
21
|
+
</component>
|
22
|
+
<component name="DaemonCodeAnalyzer">
|
23
|
+
<disable_hints />
|
24
|
+
</component>
|
25
|
+
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
26
|
+
<component name="FavoritesManager">
|
27
|
+
<favorites_list name="scoped_enum" />
|
28
|
+
</component>
|
29
|
+
<component name="FileEditorManager">
|
30
|
+
<leaf>
|
31
|
+
<file leaf-file-name="scoped_enum.rb" pinned="false" current="false" current-in-tab="false">
|
32
|
+
<entry file="file://$PROJECT_DIR$/lib/scoped_enum.rb">
|
33
|
+
<provider selected="true" editor-type-id="text-editor">
|
34
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="59" max-vertical-offset="870">
|
35
|
+
<caret line="29" column="55" selection-start-line="29" selection-start-column="55" selection-end-line="29" selection-end-column="55" />
|
36
|
+
<folding />
|
37
|
+
</state>
|
38
|
+
</provider>
|
39
|
+
</entry>
|
40
|
+
</file>
|
41
|
+
<file leaf-file-name="scoped_enum.gemspec" pinned="false" current="true" current-in-tab="true">
|
42
|
+
<entry file="file://$PROJECT_DIR$/scoped_enum.gemspec">
|
43
|
+
<provider selected="true" editor-type-id="text-editor">
|
44
|
+
<state vertical-scroll-proportion="0.61926603" vertical-offset="0" max-vertical-offset="654">
|
45
|
+
<caret line="27" column="65" selection-start-line="27" selection-start-column="65" selection-end-line="27" selection-end-column="65" />
|
46
|
+
<folding />
|
47
|
+
</state>
|
48
|
+
</provider>
|
49
|
+
</entry>
|
50
|
+
</file>
|
51
|
+
<file leaf-file-name="scoped_enum_spec.rb" pinned="false" current="false" current-in-tab="false">
|
52
|
+
<entry file="file://$PROJECT_DIR$/spec/scoped_enum_spec.rb">
|
53
|
+
<provider selected="true" editor-type-id="text-editor">
|
54
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="885" max-vertical-offset="1050">
|
55
|
+
<caret line="59" column="107" selection-start-line="59" selection-start-column="107" selection-end-line="59" selection-end-column="107" />
|
56
|
+
<folding />
|
57
|
+
</state>
|
58
|
+
</provider>
|
59
|
+
</entry>
|
60
|
+
</file>
|
61
|
+
<file leaf-file-name=".travis.yml" pinned="false" current="false" current-in-tab="false">
|
62
|
+
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
63
|
+
<provider selected="true" editor-type-id="text-editor">
|
64
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="135">
|
65
|
+
<caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
66
|
+
<folding />
|
67
|
+
</state>
|
68
|
+
</provider>
|
69
|
+
</entry>
|
70
|
+
</file>
|
71
|
+
<file leaf-file-name="models.rb" pinned="false" current="false" current-in-tab="false">
|
72
|
+
<entry file="file://$PROJECT_DIR$/spec/support/models.rb">
|
73
|
+
<provider selected="true" editor-type-id="text-editor">
|
74
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="105" max-vertical-offset="225">
|
75
|
+
<caret line="7" column="21" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
|
76
|
+
<folding />
|
77
|
+
</state>
|
78
|
+
</provider>
|
79
|
+
</entry>
|
80
|
+
</file>
|
81
|
+
</leaf>
|
82
|
+
</component>
|
83
|
+
<component name="FindManager">
|
84
|
+
<FindUsagesManager>
|
85
|
+
<setting name="OPEN_NEW_TAB" value="true" />
|
86
|
+
</FindUsagesManager>
|
87
|
+
</component>
|
88
|
+
<component name="Git.Settings">
|
89
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
90
|
+
</component>
|
91
|
+
<component name="IdeDocumentHistory">
|
92
|
+
<option name="changedFiles">
|
93
|
+
<list>
|
94
|
+
<option value="$PROJECT_DIR$/lib/scoped_enum/extensions/active_records/base.rb" />
|
95
|
+
<option value="$PROJECT_DIR$/lib/scoped_enum/extensions.rb" />
|
96
|
+
<option value="$PROJECT_DIR$/lib/scoped_enum/extensions/active_record.rb" />
|
97
|
+
<option value="$PROJECT_DIR$/spec/schema.rb" />
|
98
|
+
<option value="$PROJECT_DIR$/spec/models.rb" />
|
99
|
+
<option value="$PROJECT_DIR$/spec/factories/users.rb" />
|
100
|
+
<option value="$PROJECT_DIR$/spec/support/factory_girl.rb" />
|
101
|
+
<option value="$PROJECT_DIR$/spec/spec_helper.rb" />
|
102
|
+
<option value="$PROJECT_DIR$/spec/factories.rb" />
|
103
|
+
<option value="$PROJECT_DIR$/spec/support/models.rb" />
|
104
|
+
<option value="$PROJECT_DIR$/spec/scoped_enum_spec.rb" />
|
105
|
+
<option value="$PROJECT_DIR$/lib/scoped_enum.rb" />
|
106
|
+
<option value="$PROJECT_DIR$/scoped_enum.gemspec" />
|
107
|
+
</list>
|
108
|
+
</option>
|
109
|
+
</component>
|
110
|
+
<component name="ProjectFrameBounds">
|
111
|
+
<option name="x" value="38" />
|
112
|
+
<option name="y" value="23" />
|
113
|
+
<option name="width" value="1242" />
|
114
|
+
<option name="height" value="777" />
|
115
|
+
</component>
|
116
|
+
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
117
|
+
<OptionsSetting value="true" id="Add" />
|
118
|
+
<OptionsSetting value="true" id="Remove" />
|
119
|
+
<OptionsSetting value="true" id="Checkout" />
|
120
|
+
<OptionsSetting value="true" id="Update" />
|
121
|
+
<OptionsSetting value="true" id="Status" />
|
122
|
+
<OptionsSetting value="true" id="Edit" />
|
123
|
+
<ConfirmationsSetting value="1" id="Add" />
|
124
|
+
<ConfirmationsSetting value="0" id="Remove" />
|
125
|
+
</component>
|
126
|
+
<component name="ProjectReloadState">
|
127
|
+
<option name="STATE" value="0" />
|
128
|
+
</component>
|
129
|
+
<component name="ProjectView">
|
130
|
+
<navigator currentView="ProjectPane" proportions="" version="1">
|
131
|
+
<flattenPackages />
|
132
|
+
<showMembers />
|
133
|
+
<showModules />
|
134
|
+
<showLibraryContents />
|
135
|
+
<hideEmptyPackages />
|
136
|
+
<abbreviatePackageNames />
|
137
|
+
<autoscrollToSource />
|
138
|
+
<autoscrollFromSource />
|
139
|
+
<sortByType />
|
140
|
+
</navigator>
|
141
|
+
<panes>
|
142
|
+
<pane id="ProjectPane">
|
143
|
+
<subPane>
|
144
|
+
<PATH>
|
145
|
+
<PATH_ELEMENT>
|
146
|
+
<option name="myItemId" value="scoped_enum" />
|
147
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
148
|
+
</PATH_ELEMENT>
|
149
|
+
</PATH>
|
150
|
+
<PATH>
|
151
|
+
<PATH_ELEMENT>
|
152
|
+
<option name="myItemId" value="scoped_enum" />
|
153
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
154
|
+
</PATH_ELEMENT>
|
155
|
+
<PATH_ELEMENT>
|
156
|
+
<option name="myItemId" value="scoped_enum" />
|
157
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
158
|
+
</PATH_ELEMENT>
|
159
|
+
</PATH>
|
160
|
+
<PATH>
|
161
|
+
<PATH_ELEMENT>
|
162
|
+
<option name="myItemId" value="scoped_enum" />
|
163
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
164
|
+
</PATH_ELEMENT>
|
165
|
+
<PATH_ELEMENT>
|
166
|
+
<option name="myItemId" value="scoped_enum" />
|
167
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
168
|
+
</PATH_ELEMENT>
|
169
|
+
<PATH_ELEMENT>
|
170
|
+
<option name="myItemId" value="spec" />
|
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="scoped_enum" />
|
177
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
178
|
+
</PATH_ELEMENT>
|
179
|
+
<PATH_ELEMENT>
|
180
|
+
<option name="myItemId" value="scoped_enum" />
|
181
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
182
|
+
</PATH_ELEMENT>
|
183
|
+
<PATH_ELEMENT>
|
184
|
+
<option name="myItemId" value="spec" />
|
185
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
186
|
+
</PATH_ELEMENT>
|
187
|
+
<PATH_ELEMENT>
|
188
|
+
<option name="myItemId" value="support" />
|
189
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
190
|
+
</PATH_ELEMENT>
|
191
|
+
</PATH>
|
192
|
+
<PATH>
|
193
|
+
<PATH_ELEMENT>
|
194
|
+
<option name="myItemId" value="scoped_enum" />
|
195
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
196
|
+
</PATH_ELEMENT>
|
197
|
+
<PATH_ELEMENT>
|
198
|
+
<option name="myItemId" value="scoped_enum" />
|
199
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
200
|
+
</PATH_ELEMENT>
|
201
|
+
<PATH_ELEMENT>
|
202
|
+
<option name="myItemId" value="lib" />
|
203
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
204
|
+
</PATH_ELEMENT>
|
205
|
+
</PATH>
|
206
|
+
<PATH>
|
207
|
+
<PATH_ELEMENT>
|
208
|
+
<option name="myItemId" value="scoped_enum" />
|
209
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
210
|
+
</PATH_ELEMENT>
|
211
|
+
<PATH_ELEMENT>
|
212
|
+
<option name="myItemId" value="scoped_enum" />
|
213
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
214
|
+
</PATH_ELEMENT>
|
215
|
+
<PATH_ELEMENT>
|
216
|
+
<option name="myItemId" value="lib" />
|
217
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
218
|
+
</PATH_ELEMENT>
|
219
|
+
<PATH_ELEMENT>
|
220
|
+
<option name="myItemId" value="scoped_enum" />
|
221
|
+
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
222
|
+
</PATH_ELEMENT>
|
223
|
+
</PATH>
|
224
|
+
</subPane>
|
225
|
+
</pane>
|
226
|
+
<pane id="Scope" />
|
227
|
+
</panes>
|
228
|
+
</component>
|
229
|
+
<component name="PropertiesComponent">
|
230
|
+
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
231
|
+
<property name="WebServerToolWindowFactoryState" value="false" />
|
232
|
+
</component>
|
233
|
+
<component name="RecentsManager">
|
234
|
+
<key name="MoveFile.RECENT_KEYS">
|
235
|
+
<recent name="$PROJECT_DIR$/spec/support" />
|
236
|
+
</key>
|
237
|
+
</component>
|
238
|
+
<component name="RunManager">
|
239
|
+
<configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
|
240
|
+
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
241
|
+
<module name="" />
|
242
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
243
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
|
244
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
245
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
246
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
247
|
+
<envs />
|
248
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
249
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
250
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
251
|
+
<COVERAGE_PATTERN ENABLED="true">
|
252
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
253
|
+
</COVERAGE_PATTERN>
|
254
|
+
</EXTENSION>
|
255
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
256
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
257
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
|
258
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
259
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
260
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
|
261
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
262
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
263
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
264
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
|
265
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
266
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
267
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
268
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
269
|
+
<method />
|
270
|
+
</configuration>
|
271
|
+
<configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
|
272
|
+
<module name="" />
|
273
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
274
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
|
275
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
276
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
277
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
278
|
+
<envs />
|
279
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
280
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
281
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
282
|
+
<COVERAGE_PATTERN ENABLED="true">
|
283
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
284
|
+
</COVERAGE_PATTERN>
|
285
|
+
</EXTENSION>
|
286
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
287
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
|
288
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
|
289
|
+
<method />
|
290
|
+
</configuration>
|
291
|
+
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
292
|
+
<method />
|
293
|
+
</configuration>
|
294
|
+
<configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
|
295
|
+
<predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
|
296
|
+
<module name="" />
|
297
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
298
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
|
299
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
300
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
301
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
302
|
+
<envs />
|
303
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
304
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
305
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
306
|
+
<COVERAGE_PATTERN ENABLED="true">
|
307
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
308
|
+
</COVERAGE_PATTERN>
|
309
|
+
</EXTENSION>
|
310
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
311
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
312
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
|
313
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
314
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
|
315
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
316
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
317
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
318
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
319
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
320
|
+
<method />
|
321
|
+
</configuration>
|
322
|
+
<list size="0" />
|
323
|
+
</component>
|
324
|
+
<component name="ShelveChangesManager" show_recycled="false" />
|
325
|
+
<component name="TaskManager">
|
326
|
+
<task active="true" id="Default" summary="Default task">
|
327
|
+
<changelist id="a257f218-e101-4b01-9af7-63ec6466cb06" name="Default" comment="" />
|
328
|
+
<created>1427901125901</created>
|
329
|
+
<updated>1427901125901</updated>
|
330
|
+
</task>
|
331
|
+
<servers />
|
332
|
+
</component>
|
333
|
+
<component name="ToolWindowManager">
|
334
|
+
<frame x="38" y="23" width="1242" height="777" extended-state="6" />
|
335
|
+
<editor active="true" />
|
336
|
+
<layout>
|
337
|
+
<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" />
|
338
|
+
<window_info id="Terminal" 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" />
|
339
|
+
<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" />
|
340
|
+
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
341
|
+
<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="false" content_ui="tabs" />
|
342
|
+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25833333" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
343
|
+
<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" />
|
344
|
+
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
345
|
+
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
346
|
+
<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" />
|
347
|
+
<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" />
|
348
|
+
<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" />
|
349
|
+
<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" />
|
350
|
+
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32991204" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
351
|
+
<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" />
|
352
|
+
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
353
|
+
<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" />
|
354
|
+
<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" />
|
355
|
+
</layout>
|
356
|
+
</component>
|
357
|
+
<component name="Vcs.Log.UiProperties">
|
358
|
+
<option name="RECENTLY_FILTERED_USER_GROUPS">
|
359
|
+
<collection />
|
360
|
+
</option>
|
361
|
+
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
|
362
|
+
<collection />
|
363
|
+
</option>
|
364
|
+
</component>
|
365
|
+
<component name="VcsContentAnnotationSettings">
|
366
|
+
<option name="myLimit" value="2678400000" />
|
367
|
+
</component>
|
368
|
+
<component name="VcsManagerConfiguration">
|
369
|
+
<option name="myTodoPanelSettings">
|
370
|
+
<TodoPanelSettings />
|
371
|
+
</option>
|
372
|
+
</component>
|
373
|
+
<component name="XDebuggerManager">
|
374
|
+
<breakpoint-manager />
|
375
|
+
</component>
|
376
|
+
<component name="editorHistoryManager">
|
377
|
+
<entry file="file://$PROJECT_DIR$/lib/scoped_enum.rb">
|
378
|
+
<provider selected="true" editor-type-id="text-editor">
|
379
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="870">
|
380
|
+
<caret line="29" column="55" selection-start-line="29" selection-start-column="55" selection-end-line="29" selection-end-column="55" />
|
381
|
+
<folding />
|
382
|
+
</state>
|
383
|
+
</provider>
|
384
|
+
</entry>
|
385
|
+
<entry file="file://$PROJECT_DIR$/spec/scoped_enum_spec.rb">
|
386
|
+
<provider selected="true" editor-type-id="text-editor">
|
387
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="885" max-vertical-offset="1050">
|
388
|
+
<caret line="59" column="107" selection-start-line="59" selection-start-column="107" selection-end-line="59" selection-end-column="107" />
|
389
|
+
<folding />
|
390
|
+
</state>
|
391
|
+
</provider>
|
392
|
+
</entry>
|
393
|
+
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
394
|
+
<provider selected="true" editor-type-id="text-editor">
|
395
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="45" max-vertical-offset="135">
|
396
|
+
<caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
397
|
+
<folding />
|
398
|
+
</state>
|
399
|
+
</provider>
|
400
|
+
</entry>
|
401
|
+
<entry file="file://$PROJECT_DIR$/spec/support/models.rb">
|
402
|
+
<provider selected="true" editor-type-id="text-editor">
|
403
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="105" max-vertical-offset="225">
|
404
|
+
<caret line="7" column="21" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
|
405
|
+
<folding />
|
406
|
+
</state>
|
407
|
+
</provider>
|
408
|
+
</entry>
|
409
|
+
<entry file="file://$PROJECT_DIR$/Gemfile">
|
410
|
+
<provider selected="true" editor-type-id="text-editor">
|
411
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="60" max-vertical-offset="150">
|
412
|
+
<caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
413
|
+
<folding />
|
414
|
+
</state>
|
415
|
+
</provider>
|
416
|
+
</entry>
|
417
|
+
<entry file="file://$PROJECT_DIR$/scoped_enum.gemspec">
|
418
|
+
<provider selected="true" editor-type-id="text-editor">
|
419
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="180" max-vertical-offset="495">
|
420
|
+
<caret line="12" column="77" selection-start-line="12" selection-start-column="77" selection-end-line="12" selection-end-column="77" />
|
421
|
+
<folding />
|
422
|
+
</state>
|
423
|
+
</provider>
|
424
|
+
</entry>
|
425
|
+
<entry file="file://$PROJECT_DIR$/Gemfile">
|
426
|
+
<provider selected="true" editor-type-id="text-editor">
|
427
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="150">
|
428
|
+
<caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
429
|
+
<folding />
|
430
|
+
</state>
|
431
|
+
</provider>
|
432
|
+
</entry>
|
433
|
+
<entry file="file://$PROJECT_DIR$/lib/scoped_enum/version.rb">
|
434
|
+
<provider selected="true" editor-type-id="text-editor">
|
435
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="135">
|
436
|
+
<caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" />
|
437
|
+
<folding />
|
438
|
+
</state>
|
439
|
+
</provider>
|
440
|
+
</entry>
|
441
|
+
<entry file="file://$USER_HOME$/.rvm/gems/ruby-1.9.3-p547@global/gems/activerecord-4.1.5/lib/active_record/enum.rb">
|
442
|
+
<provider selected="true" editor-type-id="text-editor">
|
443
|
+
<state vertical-scroll-proportion="-0.14263074" vertical-offset="1320" max-vertical-offset="3075">
|
444
|
+
<caret line="82" column="23" selection-start-line="82" selection-start-column="23" selection-end-line="82" selection-end-column="23" />
|
445
|
+
</state>
|
446
|
+
</provider>
|
447
|
+
</entry>
|
448
|
+
<entry file="file://$PROJECT_DIR$/Rakefile">
|
449
|
+
<provider selected="true" editor-type-id="text-editor">
|
450
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="654">
|
451
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
452
|
+
</state>
|
453
|
+
</provider>
|
454
|
+
</entry>
|
455
|
+
<entry file="file://$PROJECT_DIR$/spec/support/schema.rb">
|
456
|
+
<provider selected="true" editor-type-id="text-editor">
|
457
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="210">
|
458
|
+
<caret line="4" column="32" selection-start-line="4" selection-start-column="32" selection-end-line="4" selection-end-column="32" />
|
459
|
+
<folding />
|
460
|
+
</state>
|
461
|
+
</provider>
|
462
|
+
</entry>
|
463
|
+
<entry file="file://$PROJECT_DIR$/spec/factories.rb">
|
464
|
+
<provider selected="true" editor-type-id="text-editor">
|
465
|
+
<state vertical-scroll-proportion="0.18348624" vertical-offset="0" max-vertical-offset="654">
|
466
|
+
<caret line="8" column="22" selection-start-line="8" selection-start-column="22" selection-end-line="8" selection-end-column="22" />
|
467
|
+
</state>
|
468
|
+
</provider>
|
469
|
+
</entry>
|
470
|
+
<entry file="file://$PROJECT_DIR$/spec/support/factory_girl.rb">
|
471
|
+
<provider selected="true" editor-type-id="text-editor">
|
472
|
+
<state vertical-scroll-proportion="0.09174312" vertical-offset="0" max-vertical-offset="654">
|
473
|
+
<caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
474
|
+
</state>
|
475
|
+
</provider>
|
476
|
+
</entry>
|
477
|
+
<entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
|
478
|
+
<provider selected="true" editor-type-id="text-editor">
|
479
|
+
<state vertical-scroll-proportion="0.27522936" vertical-offset="0" max-vertical-offset="654">
|
480
|
+
<caret line="12" column="0" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
|
481
|
+
</state>
|
482
|
+
</provider>
|
483
|
+
</entry>
|
484
|
+
<entry file="file://$PROJECT_DIR$/spec/support/models.rb">
|
485
|
+
<provider selected="true" editor-type-id="text-editor">
|
486
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="225">
|
487
|
+
<caret line="7" column="21" selection-start-line="7" selection-start-column="21" selection-end-line="7" selection-end-column="21" />
|
488
|
+
<folding />
|
489
|
+
</state>
|
490
|
+
</provider>
|
491
|
+
</entry>
|
492
|
+
<entry file="file://$PROJECT_DIR$/spec/scoped_enum_spec.rb">
|
493
|
+
<provider selected="true" editor-type-id="text-editor">
|
494
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1050">
|
495
|
+
<caret line="59" column="107" selection-start-line="59" selection-start-column="107" selection-end-line="59" selection-end-column="107" />
|
496
|
+
<folding />
|
497
|
+
</state>
|
498
|
+
</provider>
|
499
|
+
</entry>
|
500
|
+
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
501
|
+
<provider selected="true" editor-type-id="text-editor">
|
502
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="135">
|
503
|
+
<caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
504
|
+
<folding />
|
505
|
+
</state>
|
506
|
+
</provider>
|
507
|
+
</entry>
|
508
|
+
<entry file="file://$PROJECT_DIR$/lib/scoped_enum.rb">
|
509
|
+
<provider selected="true" editor-type-id="text-editor">
|
510
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="59" max-vertical-offset="870">
|
511
|
+
<caret line="29" column="55" selection-start-line="29" selection-start-column="55" selection-end-line="29" selection-end-column="55" />
|
512
|
+
<folding />
|
513
|
+
</state>
|
514
|
+
</provider>
|
515
|
+
</entry>
|
516
|
+
<entry file="file://$PROJECT_DIR$/scoped_enum.gemspec">
|
517
|
+
<provider selected="true" editor-type-id="text-editor">
|
518
|
+
<state vertical-scroll-proportion="0.61926603" vertical-offset="0" max-vertical-offset="654">
|
519
|
+
<caret line="27" column="65" selection-start-line="27" selection-start-column="65" selection-end-line="27" selection-end-column="65" />
|
520
|
+
<folding />
|
521
|
+
</state>
|
522
|
+
</provider>
|
523
|
+
</entry>
|
524
|
+
</component>
|
525
|
+
</project>
|
526
|
+
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
scoped_enum (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actionpack (4.1.8)
|
10
|
+
actionview (= 4.1.8)
|
11
|
+
activesupport (= 4.1.8)
|
12
|
+
rack (~> 1.5.2)
|
13
|
+
rack-test (~> 0.6.2)
|
14
|
+
actionview (4.1.8)
|
15
|
+
activesupport (= 4.1.8)
|
16
|
+
builder (~> 3.1)
|
17
|
+
erubis (~> 2.7.0)
|
18
|
+
activemodel (4.1.8)
|
19
|
+
activesupport (= 4.1.8)
|
20
|
+
builder (~> 3.1)
|
21
|
+
activerecord (4.1.8)
|
22
|
+
activemodel (= 4.1.8)
|
23
|
+
activesupport (= 4.1.8)
|
24
|
+
arel (~> 5.0.0)
|
25
|
+
activesupport (4.1.8)
|
26
|
+
i18n (~> 0.6, >= 0.6.9)
|
27
|
+
json (~> 1.7, >= 1.7.7)
|
28
|
+
minitest (~> 5.1)
|
29
|
+
thread_safe (~> 0.1)
|
30
|
+
tzinfo (~> 1.1)
|
31
|
+
arel (5.0.1.20140414130214)
|
32
|
+
builder (3.2.2)
|
33
|
+
diff-lcs (1.2.5)
|
34
|
+
erubis (2.7.0)
|
35
|
+
factory_girl (4.5.0)
|
36
|
+
activesupport (>= 3.0.0)
|
37
|
+
factory_girl_rails (4.5.0)
|
38
|
+
factory_girl (~> 4.5.0)
|
39
|
+
railties (>= 3.0.0)
|
40
|
+
i18n (0.7.0)
|
41
|
+
json (1.8.2)
|
42
|
+
minitest (5.5.1)
|
43
|
+
rack (1.5.2)
|
44
|
+
rack-test (0.6.3)
|
45
|
+
rack (>= 1.0)
|
46
|
+
railties (4.1.8)
|
47
|
+
actionpack (= 4.1.8)
|
48
|
+
activesupport (= 4.1.8)
|
49
|
+
rake (>= 0.8.7)
|
50
|
+
thor (>= 0.18.1, < 2.0)
|
51
|
+
rake (10.4.2)
|
52
|
+
rspec (3.2.0)
|
53
|
+
rspec-core (~> 3.2.0)
|
54
|
+
rspec-expectations (~> 3.2.0)
|
55
|
+
rspec-mocks (~> 3.2.0)
|
56
|
+
rspec-core (3.2.2)
|
57
|
+
rspec-support (~> 3.2.0)
|
58
|
+
rspec-expectations (3.2.0)
|
59
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
+
rspec-support (~> 3.2.0)
|
61
|
+
rspec-mocks (3.2.1)
|
62
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
+
rspec-support (~> 3.2.0)
|
64
|
+
rspec-support (3.2.2)
|
65
|
+
sqlite3 (1.3.10)
|
66
|
+
thor (0.19.1)
|
67
|
+
thread_safe (0.3.5)
|
68
|
+
tzinfo (1.2.2)
|
69
|
+
thread_safe (~> 0.1)
|
70
|
+
|
71
|
+
PLATFORMS
|
72
|
+
ruby
|
73
|
+
|
74
|
+
DEPENDENCIES
|
75
|
+
activerecord (>= 4.1.0)
|
76
|
+
activesupport
|
77
|
+
bundler (~> 1.8)
|
78
|
+
factory_girl_rails (>= 4.0)
|
79
|
+
rake (~> 10.0)
|
80
|
+
rspec
|
81
|
+
scoped_enum!
|
82
|
+
sqlite3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Han Lin
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# ScopedEnum
|
2
|
+
|
3
|
+
Group multiple enum values backed by ActiveRecord::Enum into scopes with ScopedEnum.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'scoped_enum'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install scoped_enum
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
In your ActiveRecord model:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
class User < ActiveRecord::Base
|
27
|
+
scoped_enum :role, { normal: 0, administrator: 1, superuser: 2 }, manager: [:administrator, :superuser]
|
28
|
+
end
|
29
|
+
```
|
30
|
+
|
31
|
+
Besides stuffs created by a normal enum call, it creates three more things:
|
32
|
+
|
33
|
+
1. An ActiveRecord scope with the same name as the enum scope.
|
34
|
+
```ruby
|
35
|
+
User.create(name: 'normal', role: :normal)
|
36
|
+
User.create(name: 'administrator', role: :administrator)
|
37
|
+
User.create(name: 'superuser', role: :superuser)
|
38
|
+
User.managers #=> [<User: 'administrator'>, <User: 'superuser'>]
|
39
|
+
```
|
40
|
+
2. A class method to return all scopes of an enum.
|
41
|
+
```ruby
|
42
|
+
User.role_scopes #=> { manager: { administrator: 1, superuser: 2 } }
|
43
|
+
```
|
44
|
+
3. An instance method to check if a record belongs to the scope.
|
45
|
+
```ruby
|
46
|
+
u = User.new(role: :normal)
|
47
|
+
u.manager? #=> false
|
48
|
+
u.role = :superuser
|
49
|
+
u.manager? #=> true
|
50
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "scoped_enum"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/scoped_enum.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
require "scoped_enum/version"
|
2
|
+
require 'active_support'
|
3
|
+
require 'active_record'
|
4
|
+
|
5
|
+
module ScopedEnum
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
def self.extended(base)
|
10
|
+
base.class_attribute(:defined_enum_scopes)
|
11
|
+
base.defined_enum_scopes = HashWithIndifferentAccess.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def scoped_enum(enum_name, enum_entries, scopes = {})
|
15
|
+
enum(enum_name => enum_entries)
|
16
|
+
scopes = HashWithIndifferentAccess.new_from_hash_copying_default(scopes)
|
17
|
+
|
18
|
+
target_enum = defined_enums[enum_name.to_s]
|
19
|
+
scopes.each do |scope_name, scope_enum_keys|
|
20
|
+
sub_enum_values = target_enum.values_at(*scope_enum_keys)
|
21
|
+
if defined_enum_scopes.has_key?(scope_name)
|
22
|
+
fail ArgumentError,
|
23
|
+
"Conflicting scope names. A scope named #{scope_name} has already been defined"
|
24
|
+
elsif sub_enum_values.include?(nil)
|
25
|
+
unknown_key = scope_enum_keys[sub_enum_values.index(nil)]
|
26
|
+
fail ArgumentError, "Unknown key - #{unknown_key} for enum #{enum_name}"
|
27
|
+
elsif respond_to?(scope_name.to_s.pluralize)
|
28
|
+
fail ArgumentError,
|
29
|
+
"Scope name - #{scope_name} conflicts with a class method of the same name"
|
30
|
+
elsif instance_methods.include?("#{scope_name}?".to_sym)
|
31
|
+
fail ArgumentError,
|
32
|
+
"Scope name - #{scope_name} conflicts with the instance method - #{scope_name}?"
|
33
|
+
end
|
34
|
+
|
35
|
+
sub_enum_entries = target_enum.slice(*scope_enum_keys)
|
36
|
+
defined_enum_scopes[scope_name] = sub_enum_entries
|
37
|
+
|
38
|
+
# 1. Instance method <scope_name>?
|
39
|
+
define_method("#{scope_name}?") do
|
40
|
+
sub_enum_entries.include? self.role
|
41
|
+
end
|
42
|
+
|
43
|
+
# 2. The class scope with the scope name
|
44
|
+
scope scope_name.to_s.pluralize, -> { where("#{enum_name}" => sub_enum_entries.values) }
|
45
|
+
end
|
46
|
+
# 3. The class method to return all scopes of the enum
|
47
|
+
singleton_class.send(:define_method, "#{enum_name}_scopes") { defined_enum_scopes.slice(*scopes.keys) }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
ActiveRecord::Base.send(:include, ScopedEnum)
|
data/scoped_enum.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'scoped_enum/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'scoped_enum'
|
8
|
+
spec.version = ScopedEnum::VERSION
|
9
|
+
spec.authors = ['Lin Han']
|
10
|
+
spec.email = ['hanlin.dev@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'Add scopes to enums easily'
|
13
|
+
spec.description = 'Group multiple enum values backed by ActiveRecord::Enum into scopes with ScopedEnum.'
|
14
|
+
spec.homepage = 'https://github.com/DIdiHL/scoped_enum.git'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = 'exe'
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.8'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 0'
|
25
|
+
spec.add_development_dependency "factory_girl_rails", "~> 4.0"
|
26
|
+
spec.add_development_dependency 'activerecord', '~> 4.1', '>= 4.1.0'
|
27
|
+
spec.add_development_dependency 'activesupport', '~> 0'
|
28
|
+
spec.add_development_dependency 'sqlite3', '~> 1.3', '>= 1.3.10'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: scoped_enum
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lin Han
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.8'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: factory_girl_rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activerecord
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.1'
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 4.1.0
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '4.1'
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 4.1.0
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: activesupport
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: sqlite3
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.3'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.3.10
|
113
|
+
type: :development
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '1.3'
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.3.10
|
123
|
+
description: Group multiple enum values backed by ActiveRecord::Enum into scopes with
|
124
|
+
ScopedEnum.
|
125
|
+
email:
|
126
|
+
- hanlin.dev@gmail.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- ".gitignore"
|
132
|
+
- ".idea/.name"
|
133
|
+
- ".idea/.rakeTasks"
|
134
|
+
- ".idea/encodings.xml"
|
135
|
+
- ".idea/misc.xml"
|
136
|
+
- ".idea/modules.xml"
|
137
|
+
- ".idea/scoped_enum.iml"
|
138
|
+
- ".idea/scopes/scope_settings.xml"
|
139
|
+
- ".idea/vcs.xml"
|
140
|
+
- ".idea/workspace.xml"
|
141
|
+
- ".travis.yml"
|
142
|
+
- Gemfile
|
143
|
+
- Gemfile.lock
|
144
|
+
- LICENSE.txt
|
145
|
+
- README.md
|
146
|
+
- Rakefile
|
147
|
+
- bin/console
|
148
|
+
- bin/setup
|
149
|
+
- lib/scoped_enum.rb
|
150
|
+
- lib/scoped_enum/version.rb
|
151
|
+
- scoped_enum.gemspec
|
152
|
+
homepage: https://github.com/DIdiHL/scoped_enum.git
|
153
|
+
licenses:
|
154
|
+
- MIT
|
155
|
+
metadata: {}
|
156
|
+
post_install_message:
|
157
|
+
rdoc_options: []
|
158
|
+
require_paths:
|
159
|
+
- lib
|
160
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - ">="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
requirements: []
|
171
|
+
rubyforge_project:
|
172
|
+
rubygems_version: 2.2.2
|
173
|
+
signing_key:
|
174
|
+
specification_version: 4
|
175
|
+
summary: Add scopes to enums easily
|
176
|
+
test_files: []
|
177
|
+
has_rdoc:
|