cards_lib 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +255 -37
- data/lib/cards_lib/card.rb +33 -1
- data/lib/cards_lib/ranker.rb +24 -0
- data/lib/cards_lib/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0852ab0d0d53bc0e53dae11134b73666e3ab6f6
|
4
|
+
data.tar.gz: bda57195826ca5c1aa4beaae728ea5172aab6714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68f6a9ae594cbbc6cd79b0654c093d5633bf6821f9065fcd19f7367652a23e7d93f71e8865af63513c3782110f83e73b7e8aaaa11916c72ebe8804bcd2e2a1d2
|
7
|
+
data.tar.gz: 535e112f704b2b7910f40492c933dd6a46e996ab5d9cf766b97015fe903f2976c908350a18638c0c28f33052f2cfc20ead0b5e7f629a4e1f4bc961736a9db512
|
data/.idea/workspace.xml
CHANGED
@@ -2,7 +2,10 @@
|
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
4
|
<list default="true" id="8e729df1-4f81-4614-900c-5868119b304d" name="Default" comment="">
|
5
|
-
<change type="
|
5
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/cards_lib/ranker.rb" />
|
6
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/cards_lib/card.rb" afterPath="$PROJECT_DIR$/lib/cards_lib/card.rb" />
|
7
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/test/card_test.rb" afterPath="$PROJECT_DIR$/test/card_test.rb" />
|
8
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/cards_lib/version.rb" afterPath="$PROJECT_DIR$/lib/cards_lib/version.rb" />
|
6
9
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
7
10
|
</list>
|
8
11
|
<ignored path="CardsLib.iws" />
|
@@ -24,41 +27,31 @@
|
|
24
27
|
</component>
|
25
28
|
<component name="FileEditorManager">
|
26
29
|
<leaf>
|
27
|
-
<file leaf-file-name="card_test.rb" pinned="false" current-in-tab="
|
30
|
+
<file leaf-file-name="card_test.rb" pinned="false" current-in-tab="true">
|
28
31
|
<entry file="file://$PROJECT_DIR$/test/card_test.rb">
|
29
32
|
<provider selected="true" editor-type-id="text-editor">
|
30
|
-
<state vertical-scroll-proportion="
|
31
|
-
<caret line="
|
33
|
+
<state vertical-scroll-proportion="1.0378913">
|
34
|
+
<caret line="42" column="5" selection-start-line="42" selection-start-column="5" selection-end-line="42" selection-end-column="5" />
|
32
35
|
<folding />
|
33
36
|
</state>
|
34
37
|
</provider>
|
35
38
|
</entry>
|
36
39
|
</file>
|
37
|
-
<file leaf-file-name=".
|
38
|
-
<entry file="file://$PROJECT_DIR
|
39
|
-
<provider selected="true" editor-type-id="text-editor">
|
40
|
-
<state vertical-scroll-proportion="0.0">
|
41
|
-
<caret line="0" column="7" selection-start-line="0" selection-start-column="7" selection-end-line="0" selection-end-column="7" />
|
42
|
-
<folding />
|
43
|
-
</state>
|
44
|
-
</provider>
|
45
|
-
</entry>
|
46
|
-
</file>
|
47
|
-
<file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
|
48
|
-
<entry file="file://$PROJECT_DIR$/lib/cards_lib/version.rb">
|
40
|
+
<file leaf-file-name="card.rb" pinned="false" current-in-tab="false">
|
41
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/card.rb">
|
49
42
|
<provider selected="true" editor-type-id="text-editor">
|
50
43
|
<state vertical-scroll-proportion="0.0">
|
51
|
-
<caret line="
|
44
|
+
<caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
|
52
45
|
<folding />
|
53
46
|
</state>
|
54
47
|
</provider>
|
55
48
|
</entry>
|
56
49
|
</file>
|
57
|
-
<file leaf-file-name="
|
58
|
-
<entry file="file://$PROJECT_DIR$/lib/cards_lib/
|
50
|
+
<file leaf-file-name="ranker.rb" pinned="false" current-in-tab="false">
|
51
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/ranker.rb">
|
59
52
|
<provider selected="true" editor-type-id="text-editor">
|
60
53
|
<state vertical-scroll-proportion="0.0">
|
61
|
-
<caret line="
|
54
|
+
<caret line="21" column="7" selection-start-line="21" selection-start-column="7" selection-end-line="21" selection-end-column="7" />
|
62
55
|
<folding />
|
63
56
|
</state>
|
64
57
|
</provider>
|
@@ -72,10 +65,12 @@
|
|
72
65
|
<component name="IdeDocumentHistory">
|
73
66
|
<option name="CHANGED_PATHS">
|
74
67
|
<list>
|
68
|
+
<option value="$PROJECT_DIR$/.gitignore" />
|
75
69
|
<option value="$PROJECT_DIR$/lib/cards_lib/version.rb" />
|
76
|
-
<option value="$PROJECT_DIR$/lib/cards_lib/
|
70
|
+
<option value="$PROJECT_DIR$/lib/cards_lib/ranker.rb" />
|
71
|
+
<option value="$PROJECT_DIR$/lib/cards_lib/standard.rb" />
|
77
72
|
<option value="$PROJECT_DIR$/test/card_test.rb" />
|
78
|
-
<option value="$PROJECT_DIR
|
73
|
+
<option value="$PROJECT_DIR$/lib/cards_lib/card.rb" />
|
79
74
|
</list>
|
80
75
|
</option>
|
81
76
|
</component>
|
@@ -88,9 +83,9 @@
|
|
88
83
|
</component>
|
89
84
|
<component name="ProjectFrameBounds">
|
90
85
|
<option name="x" value="50" />
|
91
|
-
<option name="y" value="
|
86
|
+
<option name="y" value="21" />
|
92
87
|
<option name="width" value="1230" />
|
93
|
-
<option name="height" value="
|
88
|
+
<option name="height" value="1003" />
|
94
89
|
</component>
|
95
90
|
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
96
91
|
<OptionsSetting value="true" id="Add" />
|
@@ -116,7 +111,6 @@
|
|
116
111
|
</navigator>
|
117
112
|
<panes>
|
118
113
|
<pane id="Scratches" />
|
119
|
-
<pane id="Scope" />
|
120
114
|
<pane id="ProjectPane">
|
121
115
|
<subPane>
|
122
116
|
<PATH>
|
@@ -183,13 +177,141 @@
|
|
183
177
|
</PATH>
|
184
178
|
</subPane>
|
185
179
|
</pane>
|
180
|
+
<pane id="Scope" />
|
186
181
|
</panes>
|
187
182
|
</component>
|
188
183
|
<component name="PropertiesComponent">
|
189
|
-
<property name="last_opened_file_path" value="$PROJECT_DIR
|
184
|
+
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
190
185
|
<property name="WebServerToolWindowFactoryState" value="false" />
|
186
|
+
<property name="FullScreen" value="false" />
|
187
|
+
</component>
|
188
|
+
<component name="RunManager">
|
189
|
+
<configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
|
190
|
+
<predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
|
191
|
+
<module name="" />
|
192
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
193
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
|
194
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
195
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
196
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
197
|
+
<envs />
|
198
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
199
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
200
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
201
|
+
<COVERAGE_PATTERN ENABLED="true">
|
202
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
203
|
+
</COVERAGE_PATTERN>
|
204
|
+
</EXTENSION>
|
205
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
206
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
|
207
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
208
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
209
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
|
210
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
|
211
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
|
212
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
|
213
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
214
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
215
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
|
216
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
217
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
218
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
219
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
|
220
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
|
221
|
+
<CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
|
222
|
+
<method />
|
223
|
+
</configuration>
|
224
|
+
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
225
|
+
<method />
|
226
|
+
</configuration>
|
227
|
+
<configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
|
228
|
+
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
229
|
+
<module name="" />
|
230
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
231
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
|
232
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
233
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
234
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
235
|
+
<envs />
|
236
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
237
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
238
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
239
|
+
<COVERAGE_PATTERN ENABLED="true">
|
240
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
241
|
+
</COVERAGE_PATTERN>
|
242
|
+
</EXTENSION>
|
243
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
244
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
245
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
|
246
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
247
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
248
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
|
249
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
250
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
251
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
252
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
|
253
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
254
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
255
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
256
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
257
|
+
<method />
|
258
|
+
</configuration>
|
259
|
+
<configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
|
260
|
+
<module name="" />
|
261
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
262
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
|
263
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
264
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
265
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
266
|
+
<envs />
|
267
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
268
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
269
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
270
|
+
<COVERAGE_PATTERN ENABLED="true">
|
271
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
272
|
+
</COVERAGE_PATTERN>
|
273
|
+
</EXTENSION>
|
274
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
275
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
|
276
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
|
277
|
+
<method />
|
278
|
+
</configuration>
|
279
|
+
<configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
|
280
|
+
<predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
|
281
|
+
<module name="" />
|
282
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
283
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
|
284
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
285
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
286
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
287
|
+
<envs />
|
288
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
289
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
290
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
291
|
+
<COVERAGE_PATTERN ENABLED="true">
|
292
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
293
|
+
</COVERAGE_PATTERN>
|
294
|
+
</EXTENSION>
|
295
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
296
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
297
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
|
298
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
299
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
|
300
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
301
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
302
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
303
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
304
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
305
|
+
<method />
|
306
|
+
</configuration>
|
307
|
+
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
308
|
+
<method />
|
309
|
+
</configuration>
|
191
310
|
</component>
|
192
311
|
<component name="ShelveChangesManager" show_recycled="false" />
|
312
|
+
<component name="SvnConfiguration">
|
313
|
+
<configuration />
|
314
|
+
</component>
|
193
315
|
<component name="TaskManager">
|
194
316
|
<task active="true" id="Default" summary="Default task">
|
195
317
|
<changelist id="8e729df1-4f81-4614-900c-5868119b304d" name="Default" comment="" />
|
@@ -200,29 +322,37 @@
|
|
200
322
|
<servers />
|
201
323
|
</component>
|
202
324
|
<component name="ToolWindowManager">
|
203
|
-
<frame x="50" y="
|
204
|
-
<editor active="
|
325
|
+
<frame x="50" y="21" width="1230" height="1003" extended-state="6" />
|
326
|
+
<editor active="false" />
|
205
327
|
<layout>
|
206
|
-
<window_info id="Terminal" active="
|
328
|
+
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32908705" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
207
329
|
<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" />
|
208
|
-
<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="
|
330
|
+
<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" />
|
209
331
|
<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" />
|
210
|
-
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="
|
211
|
-
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.
|
212
|
-
<window_info id="
|
213
|
-
<window_info id="
|
214
|
-
<window_info id="
|
332
|
+
<window_info id="Application Servers" 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" />
|
333
|
+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25841752" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
334
|
+
<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" />
|
335
|
+
<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" />
|
336
|
+
<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" />
|
337
|
+
<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" />
|
338
|
+
<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" />
|
215
339
|
<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" />
|
216
340
|
<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" />
|
217
341
|
<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" />
|
218
342
|
<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" />
|
219
343
|
<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" />
|
220
|
-
<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" />
|
221
344
|
<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" />
|
222
345
|
<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" />
|
223
|
-
<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" />
|
224
346
|
</layout>
|
225
347
|
</component>
|
348
|
+
<component name="Vcs.Log.UiProperties">
|
349
|
+
<option name="RECENTLY_FILTERED_USER_GROUPS">
|
350
|
+
<collection />
|
351
|
+
</option>
|
352
|
+
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
|
353
|
+
<collection />
|
354
|
+
</option>
|
355
|
+
</component>
|
226
356
|
<component name="VcsContentAnnotationSettings">
|
227
357
|
<option name="myLimit" value="2678400000" />
|
228
358
|
</component>
|
@@ -231,6 +361,22 @@
|
|
231
361
|
<watches-manager />
|
232
362
|
</component>
|
233
363
|
<component name="editorHistoryManager">
|
364
|
+
<entry file="file://$PROJECT_DIR$/test/card_test.rb">
|
365
|
+
<provider selected="true" editor-type-id="text-editor">
|
366
|
+
<state vertical-scroll-proportion="0.0">
|
367
|
+
<caret line="30" column="27" selection-start-line="30" selection-start-column="27" selection-end-line="30" selection-end-column="27" />
|
368
|
+
<folding />
|
369
|
+
</state>
|
370
|
+
</provider>
|
371
|
+
</entry>
|
372
|
+
<entry file="file://$PROJECT_DIR$/.gitignore">
|
373
|
+
<provider selected="true" editor-type-id="text-editor">
|
374
|
+
<state vertical-scroll-proportion="0.0">
|
375
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
376
|
+
<folding />
|
377
|
+
</state>
|
378
|
+
</provider>
|
379
|
+
</entry>
|
234
380
|
<entry file="file://$PROJECT_DIR$/lib/cards_lib/version.rb">
|
235
381
|
<provider selected="true" editor-type-id="text-editor">
|
236
382
|
<state vertical-scroll-proportion="0.0">
|
@@ -255,6 +401,30 @@
|
|
255
401
|
</state>
|
256
402
|
</provider>
|
257
403
|
</entry>
|
404
|
+
<entry file="file://$PROJECT_DIR$/.gitignore">
|
405
|
+
<provider selected="true" editor-type-id="text-editor">
|
406
|
+
<state vertical-scroll-proportion="0.0">
|
407
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
408
|
+
<folding />
|
409
|
+
</state>
|
410
|
+
</provider>
|
411
|
+
</entry>
|
412
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/version.rb">
|
413
|
+
<provider selected="true" editor-type-id="text-editor">
|
414
|
+
<state vertical-scroll-proportion="0.0">
|
415
|
+
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
416
|
+
<folding />
|
417
|
+
</state>
|
418
|
+
</provider>
|
419
|
+
</entry>
|
420
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/card.rb">
|
421
|
+
<provider selected="true" editor-type-id="text-editor">
|
422
|
+
<state vertical-scroll-proportion="0.0">
|
423
|
+
<caret line="13" column="10" selection-start-line="13" selection-start-column="10" selection-end-line="13" selection-end-column="10" />
|
424
|
+
<folding />
|
425
|
+
</state>
|
426
|
+
</provider>
|
427
|
+
</entry>
|
258
428
|
<entry file="file://$PROJECT_DIR$/.gitignore">
|
259
429
|
<provider selected="true" editor-type-id="text-editor">
|
260
430
|
<state vertical-scroll-proportion="0.0">
|
@@ -263,5 +433,53 @@
|
|
263
433
|
</state>
|
264
434
|
</provider>
|
265
435
|
</entry>
|
436
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/version.rb">
|
437
|
+
<provider selected="true" editor-type-id="text-editor">
|
438
|
+
<state vertical-scroll-proportion="0.024711696">
|
439
|
+
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
440
|
+
<folding />
|
441
|
+
</state>
|
442
|
+
</provider>
|
443
|
+
</entry>
|
444
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/standard.rb">
|
445
|
+
<provider selected="true" editor-type-id="text-editor">
|
446
|
+
<state vertical-scroll-proportion="0.049423393">
|
447
|
+
<caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
|
448
|
+
<folding />
|
449
|
+
</state>
|
450
|
+
</provider>
|
451
|
+
</entry>
|
452
|
+
<entry file="file://$PROJECT_DIR$/Rakefile">
|
453
|
+
<provider selected="true" editor-type-id="text-editor">
|
454
|
+
<state vertical-scroll-proportion="0.0">
|
455
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
456
|
+
<folding />
|
457
|
+
</state>
|
458
|
+
</provider>
|
459
|
+
</entry>
|
460
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/ranker.rb">
|
461
|
+
<provider selected="true" editor-type-id="text-editor">
|
462
|
+
<state vertical-scroll-proportion="0.0">
|
463
|
+
<caret line="21" column="7" selection-start-line="21" selection-start-column="7" selection-end-line="21" selection-end-column="7" />
|
464
|
+
<folding />
|
465
|
+
</state>
|
466
|
+
</provider>
|
467
|
+
</entry>
|
468
|
+
<entry file="file://$PROJECT_DIR$/lib/cards_lib/card.rb">
|
469
|
+
<provider selected="true" editor-type-id="text-editor">
|
470
|
+
<state vertical-scroll-proportion="0.0">
|
471
|
+
<caret line="2" column="19" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
|
472
|
+
<folding />
|
473
|
+
</state>
|
474
|
+
</provider>
|
475
|
+
</entry>
|
476
|
+
<entry file="file://$PROJECT_DIR$/test/card_test.rb">
|
477
|
+
<provider selected="true" editor-type-id="text-editor">
|
478
|
+
<state vertical-scroll-proportion="1.0378913">
|
479
|
+
<caret line="42" column="5" selection-start-line="42" selection-start-column="5" selection-end-line="42" selection-end-column="5" />
|
480
|
+
<folding />
|
481
|
+
</state>
|
482
|
+
</provider>
|
483
|
+
</entry>
|
266
484
|
</component>
|
267
485
|
</project>
|
data/lib/cards_lib/card.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
module CardsLib
|
2
2
|
class Card
|
3
|
-
|
3
|
+
include Comparable
|
4
|
+
def initialize(face, ranker = Ranker)
|
4
5
|
raise InvalidCardFace, "face cannot be blank" if face.to_s.empty?
|
5
6
|
@suit = nil
|
6
7
|
@rank = nil
|
8
|
+
@ranker = ranker
|
7
9
|
if face.is_a? Hash
|
8
10
|
@suit = face.fetch(:suit) { nil }
|
9
11
|
@rank = face.fetch(:rank) { nil }
|
@@ -17,6 +19,7 @@ module CardsLib
|
|
17
19
|
else
|
18
20
|
@face = face
|
19
21
|
end
|
22
|
+
@ranker = ranker.new(rank)
|
20
23
|
end
|
21
24
|
|
22
25
|
def face
|
@@ -30,9 +33,38 @@ module CardsLib
|
|
30
33
|
def rank
|
31
34
|
@rank || @face[0]
|
32
35
|
end
|
36
|
+
|
37
|
+
def <=>(other)
|
38
|
+
@ranker.<=>(other)
|
39
|
+
end
|
33
40
|
end
|
34
41
|
|
35
42
|
class InvalidCardFace < Exception
|
36
43
|
|
37
44
|
end
|
45
|
+
|
46
|
+
class Ranker
|
47
|
+
include Comparable
|
48
|
+
attr :rank, :ranks, :rank_lookup
|
49
|
+
def initialize(
|
50
|
+
rank = nil,
|
51
|
+
ranks: "A23456789TJQK".split(''),
|
52
|
+
rank_lookup: ->rank_face{
|
53
|
+
r = @ranks.index(rank_face).to_i + 1
|
54
|
+
# r = 10 if r > 10
|
55
|
+
r
|
56
|
+
})
|
57
|
+
@rank = rank
|
58
|
+
@ranks = ranks
|
59
|
+
@rank_lookup = rank_lookup
|
60
|
+
end
|
61
|
+
|
62
|
+
def <=>(item)
|
63
|
+
@rank_lookup[self.rank] <=> @rank_lookup[item.rank]
|
64
|
+
end
|
65
|
+
|
66
|
+
def inspect
|
67
|
+
@rank
|
68
|
+
end
|
69
|
+
end
|
38
70
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module CardsLib
|
2
|
+
class Ranker
|
3
|
+
include Comparable
|
4
|
+
attr :rank, :ranks, :rank_lookup
|
5
|
+
def initialize(
|
6
|
+
rank = nil,
|
7
|
+
ranks: "A23456789TJQK".split(''),
|
8
|
+
rank_lookup: ->rank_face{
|
9
|
+
@ranks.index(rank_face).to_i + 1
|
10
|
+
})
|
11
|
+
@rank = rank
|
12
|
+
@ranks = ranks
|
13
|
+
@rank_lookup = rank_lookup
|
14
|
+
end
|
15
|
+
|
16
|
+
def <=>(item)
|
17
|
+
@rank_lookup[self.rank] <=> @rank_lookup[item.rank]
|
18
|
+
end
|
19
|
+
|
20
|
+
def inspect
|
21
|
+
@rank
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/cards_lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cards_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel P. Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- lib/cards_lib.rb
|
108
108
|
- lib/cards_lib/card.rb
|
109
109
|
- lib/cards_lib/deck.rb
|
110
|
+
- lib/cards_lib/ranker.rb
|
110
111
|
- lib/cards_lib/standard.rb
|
111
112
|
- lib/cards_lib/version.rb
|
112
113
|
- travis.log
|