math_input 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 868e081a055278e1a82b5a4b8a963895e577e65b
4
+ data.tar.gz: cbc73bd0e1ed845233a1679768d5f67d5737831f
5
+ SHA512:
6
+ metadata.gz: c601535e4607824ce6e0da935f5c57174a640614797965f333b8c517c80235a00a79e00b27af2a247c09642ef41fbb97ad35f74ac8954eff75d8aa8ea0036e09
7
+ data.tar.gz: 9a8d6ea31a065eed468502b15b52176f30832f3d1c27a585ead1d261793a6c74ee17f3ba9ce71ad8bef64ebfc6a82769b34e8e8b8b259a51759b59c5d68d251f
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
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>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
data/.idea/misc.xml ADDED
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
4
+ <OptionsSetting value="true" id="Add" />
5
+ <OptionsSetting value="true" id="Remove" />
6
+ <OptionsSetting value="true" id="Checkout" />
7
+ <OptionsSetting value="true" id="Update" />
8
+ <OptionsSetting value="true" id="Status" />
9
+ <OptionsSetting value="true" id="Edit" />
10
+ <ConfirmationsSetting value="0" id="Add" />
11
+ <ConfirmationsSetting value="0" id="Remove" />
12
+ </component>
13
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.0.0-p648" project-jdk-type="RUBY_SDK" />
14
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
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/math_input.iml" filepath="$PROJECT_DIR$/.idea/math_input.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,692 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="968045e6-d860-4584-9196-4a724136188b" name="Default" comment="">
5
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/math_input.gemspec" afterPath="$PROJECT_DIR$/math_input.gemspec" />
6
+ </list>
7
+ <ignored path="math_input.iws" />
8
+ <ignored path=".idea/workspace.xml" />
9
+ <ignored path=".idea/dataSources.local.xml" />
10
+ <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
11
+ <option name="TRACKING_ENABLED" value="true" />
12
+ <option name="SHOW_DIALOG" value="false" />
13
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
14
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
15
+ <option name="LAST_RESOLUTION" value="IGNORE" />
16
+ </component>
17
+ <component name="CreatePatchCommitExecutor">
18
+ <option name="PATCH_PATH" value="" />
19
+ </component>
20
+ <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
21
+ <component name="FavoritesManager">
22
+ <favorites_list name="math_input" />
23
+ </component>
24
+ <component name="FileEditorManager">
25
+ <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
26
+ <file leaf-file-name="Gemfile" pinned="false" current-in-tab="false">
27
+ <entry file="file://$PROJECT_DIR$/Gemfile">
28
+ <provider selected="true" editor-type-id="text-editor">
29
+ <state relative-caret-position="30">
30
+ <caret line="2" column="23" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
31
+ <folding />
32
+ </state>
33
+ </provider>
34
+ </entry>
35
+ </file>
36
+ <file leaf-file-name="math_input.gemspec" pinned="false" current-in-tab="true">
37
+ <entry file="file://$PROJECT_DIR$/math_input.gemspec">
38
+ <provider selected="true" editor-type-id="text-editor">
39
+ <state relative-caret-position="240">
40
+ <caret line="22" column="7" selection-start-line="17" selection-start-column="9" selection-end-line="22" selection-end-column="7" />
41
+ <folding />
42
+ </state>
43
+ </provider>
44
+ </entry>
45
+ </file>
46
+ <file leaf-file-name="Rakefile" pinned="false" current-in-tab="false">
47
+ <entry file="file://$PROJECT_DIR$/Rakefile">
48
+ <provider selected="true" editor-type-id="text-editor">
49
+ <state relative-caret-position="0">
50
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
51
+ <folding />
52
+ </state>
53
+ </provider>
54
+ </entry>
55
+ </file>
56
+ <file leaf-file-name="README.md" pinned="false" current-in-tab="false">
57
+ <entry file="file://$PROJECT_DIR$/README.md">
58
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
59
+ <state split_layout="SPLIT">
60
+ <first_editor relative-caret-position="60">
61
+ <caret line="4" column="93" selection-start-line="4" selection-start-column="93" selection-end-line="4" selection-end-column="93" />
62
+ <folding />
63
+ </first_editor>
64
+ <second_editor />
65
+ </state>
66
+ </provider>
67
+ </entry>
68
+ </file>
69
+ <file leaf-file-name="math_input.rb" pinned="false" current-in-tab="false">
70
+ <entry file="file://$PROJECT_DIR$/lib/math_input.rb">
71
+ <provider selected="true" editor-type-id="text-editor">
72
+ <state relative-caret-position="30">
73
+ <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
74
+ <folding />
75
+ </state>
76
+ </provider>
77
+ </entry>
78
+ </file>
79
+ <file leaf-file-name="math_input.js" pinned="false" current-in-tab="false">
80
+ <entry file="file://$PROJECT_DIR$/vendor/assets/javascripts/math_input.js">
81
+ <provider selected="true" editor-type-id="text-editor">
82
+ <state relative-caret-position="1155">
83
+ <caret line="77" column="34" selection-start-line="77" selection-start-column="34" selection-end-line="77" selection-end-column="34" />
84
+ <folding />
85
+ </state>
86
+ </provider>
87
+ </entry>
88
+ </file>
89
+ <file leaf-file-name="simple_form_extension.rb" pinned="false" current-in-tab="false">
90
+ <entry file="file://$PROJECT_DIR$/lib/math_input/simple_form_extension.rb">
91
+ <provider selected="true" editor-type-id="text-editor">
92
+ <state relative-caret-position="60">
93
+ <caret line="4" column="38" selection-start-line="4" selection-start-column="38" selection-end-line="4" selection-end-column="38" />
94
+ <folding />
95
+ </state>
96
+ </provider>
97
+ </entry>
98
+ </file>
99
+ <file leaf-file-name="engine.rb" pinned="false" current-in-tab="false">
100
+ <entry file="file://$PROJECT_DIR$/lib/math_input/engine.rb">
101
+ <provider selected="true" editor-type-id="text-editor">
102
+ <state relative-caret-position="0">
103
+ <caret line="0" column="16" selection-start-line="0" selection-start-column="16" selection-end-line="0" selection-end-column="16" />
104
+ <folding />
105
+ </state>
106
+ </provider>
107
+ </entry>
108
+ </file>
109
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
110
+ <entry file="file://$PROJECT_DIR$/lib/math_input/version.rb">
111
+ <provider selected="true" editor-type-id="text-editor">
112
+ <state relative-caret-position="45">
113
+ <caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
114
+ <folding />
115
+ </state>
116
+ </provider>
117
+ </entry>
118
+ </file>
119
+ </leaf>
120
+ </component>
121
+ <component name="Git.Settings">
122
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
123
+ </component>
124
+ <component name="IdeDocumentHistory">
125
+ <option name="CHANGED_PATHS">
126
+ <list>
127
+ <option value="$PROJECT_DIR$/Gemfile" />
128
+ <option value="$PROJECT_DIR$/assets/javascripts/math_input.js" />
129
+ <option value="$PROJECT_DIR$/lib/math_input/engine.rb" />
130
+ <option value="$PROJECT_DIR$/lib/math_input/simple_form_extansion.rb" />
131
+ <option value="$PROJECT_DIR$/lib/math_input.rb" />
132
+ <option value="$PROJECT_DIR$/README.md" />
133
+ <option value="$PROJECT_DIR$/math_input.gemspec" />
134
+ </list>
135
+ </option>
136
+ </component>
137
+ <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
138
+ <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
139
+ <component name="JsGulpfileManager">
140
+ <detection-done>true</detection-done>
141
+ <sorting>DEFINITION_ORDER</sorting>
142
+ </component>
143
+ <component name="ProjectFrameBounds">
144
+ <option name="width" value="1280" />
145
+ <option name="height" value="800" />
146
+ </component>
147
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
148
+ <OptionsSetting value="true" id="Add" />
149
+ <OptionsSetting value="true" id="Remove" />
150
+ <OptionsSetting value="true" id="Checkout" />
151
+ <OptionsSetting value="true" id="Update" />
152
+ <OptionsSetting value="true" id="Status" />
153
+ <OptionsSetting value="true" id="Edit" />
154
+ <ConfirmationsSetting value="0" id="Add" />
155
+ <ConfirmationsSetting value="0" id="Remove" />
156
+ </component>
157
+ <component name="ProjectView">
158
+ <navigator currentView="ProjectPane" proportions="" version="1">
159
+ <flattenPackages />
160
+ <showMembers />
161
+ <showModules />
162
+ <showLibraryContents />
163
+ <hideEmptyPackages />
164
+ <abbreviatePackageNames />
165
+ <autoscrollToSource />
166
+ <autoscrollFromSource />
167
+ <sortByType />
168
+ <manualOrder />
169
+ <foldersAlwaysOnTop value="true" />
170
+ </navigator>
171
+ <panes>
172
+ <pane id="Scratches" />
173
+ <pane id="Scope" />
174
+ <pane id="ProjectPane">
175
+ <subPane>
176
+ <PATH>
177
+ <PATH_ELEMENT>
178
+ <option name="myItemId" value="math_input" />
179
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
180
+ </PATH_ELEMENT>
181
+ </PATH>
182
+ <PATH>
183
+ <PATH_ELEMENT>
184
+ <option name="myItemId" value="math_input" />
185
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
186
+ </PATH_ELEMENT>
187
+ <PATH_ELEMENT>
188
+ <option name="myItemId" value="math_input" />
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="math_input" />
195
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
196
+ </PATH_ELEMENT>
197
+ <PATH_ELEMENT>
198
+ <option name="myItemId" value="math_input" />
199
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
200
+ </PATH_ELEMENT>
201
+ <PATH_ELEMENT>
202
+ <option name="myItemId" value="vendor" />
203
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
204
+ </PATH_ELEMENT>
205
+ <PATH_ELEMENT>
206
+ <option name="myItemId" value="assets" />
207
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
208
+ </PATH_ELEMENT>
209
+ <PATH_ELEMENT>
210
+ <option name="myItemId" value="javascripts" />
211
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
212
+ </PATH_ELEMENT>
213
+ </PATH>
214
+ <PATH>
215
+ <PATH_ELEMENT>
216
+ <option name="myItemId" value="math_input" />
217
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
218
+ </PATH_ELEMENT>
219
+ <PATH_ELEMENT>
220
+ <option name="myItemId" value="math_input" />
221
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
222
+ </PATH_ELEMENT>
223
+ <PATH_ELEMENT>
224
+ <option name="myItemId" value="vendor" />
225
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
226
+ </PATH_ELEMENT>
227
+ <PATH_ELEMENT>
228
+ <option name="myItemId" value="assets" />
229
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
230
+ </PATH_ELEMENT>
231
+ <PATH_ELEMENT>
232
+ <option name="myItemId" value="images" />
233
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
234
+ </PATH_ELEMENT>
235
+ </PATH>
236
+ <PATH>
237
+ <PATH_ELEMENT>
238
+ <option name="myItemId" value="math_input" />
239
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
240
+ </PATH_ELEMENT>
241
+ <PATH_ELEMENT>
242
+ <option name="myItemId" value="math_input" />
243
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
244
+ </PATH_ELEMENT>
245
+ <PATH_ELEMENT>
246
+ <option name="myItemId" value="lib" />
247
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
248
+ </PATH_ELEMENT>
249
+ </PATH>
250
+ <PATH>
251
+ <PATH_ELEMENT>
252
+ <option name="myItemId" value="math_input" />
253
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
254
+ </PATH_ELEMENT>
255
+ <PATH_ELEMENT>
256
+ <option name="myItemId" value="math_input" />
257
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
258
+ </PATH_ELEMENT>
259
+ <PATH_ELEMENT>
260
+ <option name="myItemId" value="lib" />
261
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
262
+ </PATH_ELEMENT>
263
+ <PATH_ELEMENT>
264
+ <option name="myItemId" value="math_input" />
265
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
266
+ </PATH_ELEMENT>
267
+ </PATH>
268
+ </subPane>
269
+ </pane>
270
+ </panes>
271
+ </component>
272
+ <component name="PropertiesComponent">
273
+ <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
274
+ <property name="settings.editor.splitter.proportion" value="0.2" />
275
+ <property name="last_opened_file_path" value="$PROJECT_DIR$" />
276
+ <property name="WebServerToolWindowFactoryState" value="false" />
277
+ <property name="FullScreen" value="true" />
278
+ </component>
279
+ <component name="RecentsManager">
280
+ <key name="CopyFile.RECENT_KEYS">
281
+ <recent name="$PROJECT_DIR$/lib/math_input" />
282
+ </key>
283
+ <key name="MoveFile.RECENT_KEYS">
284
+ <recent name="$PROJECT_DIR$/vendor/assets/images" />
285
+ <recent name="$PROJECT_DIR$/vendor/assets" />
286
+ </key>
287
+ </component>
288
+ <component name="RunManager">
289
+ <configuration default="true" type="CucumberRunConfigurationType" factoryName="Cucumber">
290
+ <predefined_log_file id="RUBY_CUCUMBER" enabled="true" />
291
+ <module name="" />
292
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
293
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
294
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
295
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
296
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
297
+ <envs />
298
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
299
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
300
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
301
+ <COVERAGE_PATTERN ENABLED="true">
302
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
303
+ </COVERAGE_PATTERN>
304
+ </EXTENSION>
305
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*.feature" />
306
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
307
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
308
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
309
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_TAGS_FILTER" VALUE="" />
310
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="TEST_NAME_FILTER" VALUE="" />
311
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_ARGS" VALUE="--color -r features" />
312
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
313
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
314
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="VERBOSE_OPTION" VALUE="false" />
315
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
316
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
317
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
318
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="CUCUMBER_RUNNER_PATH" VALUE="" />
319
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_RUNNER" VALUE="false" />
320
+ <CUCUMBER_RUN_CONFIG_SETTINGS_ID NAME="SETTINGS_VERSION" VALUE="2" />
321
+ <method />
322
+ </configuration>
323
+ <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
324
+ <method />
325
+ </configuration>
326
+ <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
327
+ <predefined_log_file id="RUBY_RSPEC" enabled="true" />
328
+ <module name="" />
329
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
330
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
331
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
332
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
333
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
334
+ <envs />
335
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
336
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
337
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
338
+ <COVERAGE_PATTERN ENABLED="true">
339
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
340
+ </COVERAGE_PATTERN>
341
+ </EXTENSION>
342
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
343
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
344
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
345
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
346
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
347
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
348
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
349
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
350
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
351
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
352
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
353
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
354
+ <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
355
+ <method />
356
+ </configuration>
357
+ <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
358
+ <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
359
+ <module name="" />
360
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
361
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
362
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
363
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
364
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
365
+ <envs />
366
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
367
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
368
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
369
+ <COVERAGE_PATTERN ENABLED="true">
370
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
371
+ </COVERAGE_PATTERN>
372
+ </EXTENSION>
373
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
374
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
375
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
376
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="" />
377
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
378
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
379
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
380
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
381
+ <RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
382
+ <method />
383
+ </configuration>
384
+ <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
385
+ <node-interpreter>project</node-interpreter>
386
+ <node-options />
387
+ <gulpfile />
388
+ <tasks />
389
+ <arguments />
390
+ <envs />
391
+ <method />
392
+ </configuration>
393
+ <configuration default="true" type="js.build_tools.npm" factoryName="npm">
394
+ <command value="run-script" />
395
+ <scripts />
396
+ <node-interpreter value="project" />
397
+ <envs />
398
+ <method />
399
+ </configuration>
400
+ </component>
401
+ <component name="ShelveChangesManager" show_recycled="false">
402
+ <option name="remove_strategy" value="false" />
403
+ </component>
404
+ <component name="TaskManager">
405
+ <task active="true" id="Default" summary="Default task">
406
+ <changelist id="968045e6-d860-4584-9196-4a724136188b" name="Default" comment="" />
407
+ <created>1483458615112</created>
408
+ <option name="number" value="Default" />
409
+ <option name="presentableId" value="Default" />
410
+ <updated>1483458615112</updated>
411
+ <workItem from="1483458616609" duration="4541000" />
412
+ <workItem from="1483523162139" duration="1680000" />
413
+ <workItem from="1483632593258" duration="104000" />
414
+ </task>
415
+ <servers />
416
+ </component>
417
+ <component name="TimeTrackingManager">
418
+ <option name="totallyTimeSpent" value="6325000" />
419
+ </component>
420
+ <component name="ToolWindowManager">
421
+ <frame x="0" y="0" width="1280" height="800" extended-state="0" />
422
+ <editor active="true" />
423
+ <layout>
424
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19466881" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
425
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
426
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
427
+ <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
428
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3287483" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
429
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3287483" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
430
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
431
+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.30123797" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
432
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
433
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
434
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3287483" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
435
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
436
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
437
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
438
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
439
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
440
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
441
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
442
+ </layout>
443
+ </component>
444
+ <component name="Vcs.Log.UiProperties">
445
+ <option name="RECENTLY_FILTERED_USER_GROUPS">
446
+ <collection />
447
+ </option>
448
+ <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
449
+ <collection />
450
+ </option>
451
+ </component>
452
+ <component name="VcsContentAnnotationSettings">
453
+ <option name="myLimit" value="2678400000" />
454
+ </component>
455
+ <component name="XDebuggerManager">
456
+ <breakpoint-manager />
457
+ <watches-manager />
458
+ </component>
459
+ <component name="editorHistoryManager">
460
+ <entry file="file://$PROJECT_DIR$/Gemfile">
461
+ <provider selected="true" editor-type-id="text-editor">
462
+ <state relative-caret-position="30">
463
+ <caret line="2" column="23" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
464
+ <folding />
465
+ </state>
466
+ </provider>
467
+ </entry>
468
+ <entry file="file://$PROJECT_DIR$/math_input.gemspec">
469
+ <provider selected="true" editor-type-id="text-editor">
470
+ <state relative-caret-position="180">
471
+ <caret line="12" column="85" selection-start-line="12" selection-start-column="85" selection-end-line="12" selection-end-column="85" />
472
+ <folding />
473
+ </state>
474
+ </provider>
475
+ </entry>
476
+ <entry file="file://$PROJECT_DIR$/Rakefile">
477
+ <provider selected="true" editor-type-id="text-editor">
478
+ <state relative-caret-position="0">
479
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
480
+ <folding />
481
+ </state>
482
+ </provider>
483
+ </entry>
484
+ <entry file="file://$PROJECT_DIR$/README.md">
485
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
486
+ <state split_layout="SPLIT">
487
+ <first_editor relative-caret-position="0">
488
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
489
+ <folding />
490
+ </first_editor>
491
+ <second_editor />
492
+ </state>
493
+ </provider>
494
+ </entry>
495
+ <entry file="file://$PROJECT_DIR$/lib/math_input.rb">
496
+ <provider selected="true" editor-type-id="text-editor">
497
+ <state relative-caret-position="30">
498
+ <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
499
+ <folding />
500
+ </state>
501
+ </provider>
502
+ </entry>
503
+ <entry file="file://$PROJECT_DIR$/vendor/assets/javascripts/math_input.js">
504
+ <provider selected="true" editor-type-id="text-editor">
505
+ <state relative-caret-position="1155">
506
+ <caret line="77" column="34" selection-start-line="77" selection-start-column="34" selection-end-line="77" selection-end-column="34" />
507
+ <folding />
508
+ </state>
509
+ </provider>
510
+ </entry>
511
+ <entry file="file://$PROJECT_DIR$/lib/math_input/simple_form_extension.rb">
512
+ <provider selected="true" editor-type-id="text-editor">
513
+ <state relative-caret-position="60">
514
+ <caret line="4" column="38" selection-start-line="4" selection-start-column="38" selection-end-line="4" selection-end-column="38" />
515
+ <folding />
516
+ </state>
517
+ </provider>
518
+ </entry>
519
+ <entry file="file://$PROJECT_DIR$/lib/math_input/engine.rb">
520
+ <provider selected="true" editor-type-id="text-editor">
521
+ <state relative-caret-position="0">
522
+ <caret line="0" column="16" selection-start-line="0" selection-start-column="16" selection-end-line="0" selection-end-column="16" />
523
+ <folding />
524
+ </state>
525
+ </provider>
526
+ </entry>
527
+ <entry file="file://$PROJECT_DIR$/lib/math_input/version.rb">
528
+ <provider selected="true" editor-type-id="text-editor">
529
+ <state relative-caret-position="45">
530
+ <caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
531
+ <folding />
532
+ </state>
533
+ </provider>
534
+ </entry>
535
+ <entry file="file://$PROJECT_DIR$/Gemfile">
536
+ <provider selected="true" editor-type-id="text-editor">
537
+ <state relative-caret-position="30">
538
+ <caret line="2" column="23" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
539
+ <folding />
540
+ </state>
541
+ </provider>
542
+ </entry>
543
+ <entry file="file://$PROJECT_DIR$/math_input.gemspec">
544
+ <provider selected="true" editor-type-id="text-editor">
545
+ <state relative-caret-position="195">
546
+ <caret line="13" column="29" selection-start-line="13" selection-start-column="29" selection-end-line="13" selection-end-column="29" />
547
+ <folding />
548
+ </state>
549
+ </provider>
550
+ </entry>
551
+ <entry file="file://$PROJECT_DIR$/Rakefile">
552
+ <provider selected="true" editor-type-id="text-editor">
553
+ <state relative-caret-position="0">
554
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
555
+ <folding />
556
+ </state>
557
+ </provider>
558
+ </entry>
559
+ <entry file="file://$PROJECT_DIR$/README.md">
560
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
561
+ <state split_layout="SPLIT">
562
+ <first_editor relative-caret-position="0">
563
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
564
+ <folding />
565
+ </first_editor>
566
+ <second_editor />
567
+ </state>
568
+ </provider>
569
+ </entry>
570
+ <entry file="file://$PROJECT_DIR$/lib/math_input.rb">
571
+ <provider selected="true" editor-type-id="text-editor">
572
+ <state relative-caret-position="0">
573
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
574
+ <folding />
575
+ </state>
576
+ </provider>
577
+ </entry>
578
+ <entry file="file://$PROJECT_DIR$/vendor/assets/javascripts/math_input.js">
579
+ <provider selected="true" editor-type-id="text-editor">
580
+ <state relative-caret-position="1155">
581
+ <caret line="77" column="34" selection-start-line="77" selection-start-column="34" selection-end-line="77" selection-end-column="34" />
582
+ <folding />
583
+ </state>
584
+ </provider>
585
+ </entry>
586
+ <entry file="file://$PROJECT_DIR$/lib/math_input/simple_form_extension.rb">
587
+ <provider selected="true" editor-type-id="text-editor">
588
+ <state relative-caret-position="60">
589
+ <caret line="4" column="38" selection-start-line="4" selection-start-column="38" selection-end-line="4" selection-end-column="38" />
590
+ <folding />
591
+ </state>
592
+ </provider>
593
+ </entry>
594
+ <entry file="file://$PROJECT_DIR$/lib/math_input/engine.rb">
595
+ <provider selected="true" editor-type-id="text-editor">
596
+ <state relative-caret-position="0">
597
+ <caret line="0" column="16" selection-start-line="0" selection-start-column="16" selection-end-line="0" selection-end-column="16" />
598
+ <folding />
599
+ </state>
600
+ </provider>
601
+ </entry>
602
+ <entry file="file://$PROJECT_DIR$/lib/math_input/version.rb">
603
+ <provider selected="true" editor-type-id="text-editor">
604
+ <state relative-caret-position="45">
605
+ <caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
606
+ <folding />
607
+ </state>
608
+ </provider>
609
+ </entry>
610
+ <entry file="file://$PROJECT_DIR$/bin/console" />
611
+ <entry file="file://$PROJECT_DIR$/lib/math_input/simple_form_extension.rb">
612
+ <provider selected="true" editor-type-id="text-editor">
613
+ <state relative-caret-position="60">
614
+ <caret line="4" column="38" selection-start-line="4" selection-start-column="38" selection-end-line="4" selection-end-column="38" />
615
+ <folding />
616
+ </state>
617
+ </provider>
618
+ </entry>
619
+ <entry file="file://$PROJECT_DIR$/lib/math_input/engine.rb">
620
+ <provider selected="true" editor-type-id="text-editor">
621
+ <state relative-caret-position="0">
622
+ <caret line="0" column="16" selection-start-line="0" selection-start-column="16" selection-end-line="0" selection-end-column="16" />
623
+ <folding />
624
+ </state>
625
+ </provider>
626
+ </entry>
627
+ <entry file="file://$PROJECT_DIR$/lib/math_input/version.rb">
628
+ <provider selected="true" editor-type-id="text-editor">
629
+ <state relative-caret-position="45">
630
+ <caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
631
+ <folding />
632
+ </state>
633
+ </provider>
634
+ </entry>
635
+ <entry file="file://$PROJECT_DIR$/Gemfile">
636
+ <provider selected="true" editor-type-id="text-editor">
637
+ <state relative-caret-position="30">
638
+ <caret line="2" column="23" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
639
+ <folding />
640
+ </state>
641
+ </provider>
642
+ </entry>
643
+ <entry file="file://$PROJECT_DIR$/Rakefile">
644
+ <provider selected="true" editor-type-id="text-editor">
645
+ <state relative-caret-position="0">
646
+ <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
647
+ <folding />
648
+ </state>
649
+ </provider>
650
+ </entry>
651
+ <entry file="file://$PROJECT_DIR$/lib/math_input.rb">
652
+ <provider selected="true" editor-type-id="text-editor">
653
+ <state relative-caret-position="30">
654
+ <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
655
+ <folding />
656
+ </state>
657
+ </provider>
658
+ </entry>
659
+ <entry file="file://$PROJECT_DIR$/vendor/assets/javascripts/math_input.js">
660
+ <provider selected="true" editor-type-id="text-editor">
661
+ <state relative-caret-position="1155">
662
+ <caret line="77" column="34" selection-start-line="77" selection-start-column="34" selection-end-line="77" selection-end-column="34" />
663
+ <folding />
664
+ </state>
665
+ </provider>
666
+ </entry>
667
+ <entry file="file://$PROJECT_DIR$/vendor/assets/images/demo.gif">
668
+ <provider selected="true" editor-type-id="images">
669
+ <state />
670
+ </provider>
671
+ </entry>
672
+ <entry file="file://$PROJECT_DIR$/README.md">
673
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
674
+ <state split_layout="SPLIT">
675
+ <first_editor relative-caret-position="60">
676
+ <caret line="4" column="93" selection-start-line="4" selection-start-column="93" selection-end-line="4" selection-end-column="93" />
677
+ <folding />
678
+ </first_editor>
679
+ <second_editor />
680
+ </state>
681
+ </provider>
682
+ </entry>
683
+ <entry file="file://$PROJECT_DIR$/math_input.gemspec">
684
+ <provider selected="true" editor-type-id="text-editor">
685
+ <state relative-caret-position="240">
686
+ <caret line="22" column="7" selection-start-line="17" selection-start-column="9" selection-end-line="22" selection-end-column="7" />
687
+ <folding />
688
+ </state>
689
+ </provider>
690
+ </entry>
691
+ </component>
692
+ </project>
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in math_input.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Rails Math Input Picker
2
+
3
+ This gem allows perform mathematical operations in the field.
4
+
5
+ ![demo](https://github.com/DSKonstantin/math_input/blob/master/vendor/assets/images/demo.gif)
6
+
7
+ =======
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'math_input'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install math_input
24
+
25
+ ## Usage
26
+
27
+ //= require math_input - include JS
28
+ $('.math-picker').MathInput() - initialize Plugin
29
+
30
+ if you use simple_form gem then can use
31
+
32
+ as: :math_input
33
+
34
+ OR determine class on input
35
+
36
+ <input class='math_input' .... >
37
+
38
+ ## Development
39
+
40
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
41
+
42
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
43
+
44
+ ## Contributing
45
+
46
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/math_input.
47
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/lib/math_input.rb ADDED
@@ -0,0 +1,3 @@
1
+ require 'math_input/version'
2
+ require 'math_input/engine'
3
+ require 'math_input/simple_form_extension' if Gem::Specification.find_by_name('simple_form') rescue Gem::LoadError
@@ -0,0 +1,6 @@
1
+ module MathInput
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ class MathPickerInput < SimpleForm::Inputs::StringInput
2
+
3
+ def input(wrapper_options)
4
+ input_html_classes << 'math-picker form-control'
5
+ input_html_options[:type] = 'text'
6
+ super
7
+ end
8
+
9
+ end
@@ -0,0 +1,3 @@
1
+ module MathInput
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'math_input/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "math_input"
8
+ spec.version = MathInput::VERSION
9
+ spec.authors = ["Konstantin Dyachenko"]
10
+ spec.email = ["ko.dyachenko@gmail.com"]
11
+
12
+ spec.summary = 'aas'
13
+ spec.description = "This gem allows perform mathematical operations in the field."
14
+ spec.homepage = 'https://github.com/DSKonstantin/math_input'
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ # if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ # else
21
+ # raise "RubyGems 2.0 or newer is required to protect against " \
22
+ # "public gem pushes."
23
+ # end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
+ f.match(%r{^(test|spec|features)/})
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "bundler", "~> 1.13"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ end
Binary file
@@ -0,0 +1,90 @@
1
+ (function($) {
2
+ $.fn.MathInput = function(options) {
3
+ var _calculateResult, _checkLastCharacter, _clearValue, _revertValue, _validateValue;
4
+ this.settings = {
5
+ valid_characters: (options != null ? options.valid_characters : void 0) || '0123456789+-()*/.',
6
+ error_timeout: (options != null ? options.error_timeout : void 0) || 1200,
7
+ exclude_last_characters: (options != null ? options.exclude_last_characters : void 0) || ['+', '-', '*', '/', ')', '('],
8
+ decimal_count: (options != null ? options.decimal_count : void 0) || this.data('decimalCount') || 2,
9
+ error_text: (options != null ? options.error_text : void 0) || this.data('errorText') || 'ERROR'
10
+ };
11
+ this.on('keypress', function(event) {
12
+ return _validateValue(event);
13
+ });
14
+ this.on('change', function(event) {
15
+ return _calculateResult(event);
16
+ });
17
+ this.on('click', function(event) {
18
+ return _clearValue(event);
19
+ });
20
+ $(document).on('mouseup', function(event) {
21
+ return _revertValue(event);
22
+ });
23
+ _revertValue = (function(_this) {
24
+ return function(event) {
25
+ var ref, ref1;
26
+ if (!((ref = _this.keep_element) != null ? ref.is(event.target) : void 0) && ((ref1 = _this.keep_element) != null ? ref1.has(event.target).length : void 0) === 0) {
27
+ if (_this.keep_element.val() === '') {
28
+ return _this.keep_element.val(parseFloat(0).toFixed(_this.settings.decimal_count));
29
+ }
30
+ }
31
+ };
32
+ })(this);
33
+ _clearValue = (function(_this) {
34
+ return function(event) {
35
+ _this.keep_element = $(event.currentTarget);
36
+ if ($(event.currentTarget).val() === '0.00' || $(event.currentTarget).val() === '0') {
37
+ return $(event.currentTarget).val('');
38
+ }
39
+ };
40
+ })(this);
41
+ _validateValue = (function(_this) {
42
+ return function(event) {
43
+ var chr;
44
+ if (event.keyCode === 13) {
45
+ event.preventDefault();
46
+ $(event.currentTarget).trigger('change');
47
+ }
48
+ chr = String.fromCharCode(event.which);
49
+ if (_this.settings.valid_characters.indexOf(chr) < 0) {
50
+ _this.blockCalculation = true;
51
+ return false;
52
+ } else {
53
+ _this.blockCalculation = false;
54
+ }
55
+ };
56
+ })(this);
57
+ _calculateResult = (function(_this) {
58
+ return function(event) {
59
+ var finishVal, newVal, startVal;
60
+ if (_this.blockCalculation) {
61
+ return;
62
+ }
63
+ startVal = _checkLastCharacter($(event.currentTarget).val());
64
+ newVal = eval(startVal);
65
+ finishVal = newVal ? newVal : 0.00;
66
+ if (finishVal === Infinity) {
67
+ $(event.currentTarget).addClass('math-input-error').val(_this.settings.error_text);
68
+ return setTimeout((function() {
69
+ finishVal = Number(0).toFixed(_this.settings.decimal_count);
70
+ return $(event.currentTarget).val(Number(finishVal).toFixed(_this.settings.decimal_count)).removeClass('math-input-error').trigger('change');
71
+ }), _this.settings.error_timeout);
72
+ } else {
73
+ return $(event.currentTarget).val(Number(finishVal).toFixed(_this.settings.decimal_count));
74
+ }
75
+ };
76
+ })(this);
77
+ return _checkLastCharacter = (function(_this) {
78
+ return function(val) {
79
+ if (jQuery.inArray(val[val.length - 1], _this.settings.exclude_last_characters) !== -1) {
80
+ val = val.slice(0, -1);
81
+ }
82
+ if (jQuery.inArray(val[val.length - 1], _this.settings.exclude_last_characters) !== -1) {
83
+ return _checkLastCharacter(val);
84
+ } else {
85
+ return val;
86
+ }
87
+ };
88
+ })(this);
89
+ };
90
+ })(jQuery);
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: math_input
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Konstantin Dyachenko
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-01-05 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.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
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
+ description: This gem allows perform mathematical operations in the field.
42
+ email:
43
+ - ko.dyachenko@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".idea/.rakeTasks"
50
+ - ".idea/math_input.iml"
51
+ - ".idea/misc.xml"
52
+ - ".idea/modules.xml"
53
+ - ".idea/vcs.xml"
54
+ - ".idea/workspace.xml"
55
+ - Gemfile
56
+ - README.md
57
+ - Rakefile
58
+ - lib/math_input.rb
59
+ - lib/math_input/engine.rb
60
+ - lib/math_input/simple_form_extension.rb
61
+ - lib/math_input/version.rb
62
+ - math_input.gemspec
63
+ - vendor/assets/images/demo.gif
64
+ - vendor/assets/javascripts/math_input.js
65
+ homepage: https://github.com/DSKonstantin/math_input
66
+ licenses: []
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.5.1
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: aas
88
+ test_files: []