comparator 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ed87d7d8e8e52bb74b6f715cdcb1b5d873eea49d38ecb3c7bfaf454207c606d
4
- data.tar.gz: dd8dc1c5599dd6f475e0b907df34060124c955f3ef8f56f9de8007614bac708c
3
+ metadata.gz: 548cf2faac3311f774674f52fc32642974f590855f0bb1a2573325c233424e7e
4
+ data.tar.gz: 7a3e3f2ca3924838f3b2a7de383076229b671bb9aedaec2b3c0e3fba44c4575d
5
5
  SHA512:
6
- metadata.gz: 139ea9f493dba34f1ecbc0a9a8daed9e007c7003dc54cea5d9e2958f28dd60c6dd57f8044a7f1ccdcd0690b552b3b3f671f7608c7c75c63f13f4c7c781f475d6
7
- data.tar.gz: c4593fd8605cb6d217954c9039f87b5712dea0228570f33ab8c936e8f53298fddcc21d8df10803c12351def7d26e1d8b34b6a51e3db87af42d28d07e6a958566
6
+ metadata.gz: 458cc50b98bdb88458d408eb4e607c8b6407367daa93722daa787f807affbcb2655fd530abf848e2a742ebca003012dbf551bbc417de69a64fcbc7392a34f37e
7
+ data.tar.gz: 2d58de3a9329cf925ddb8308a39f84c6c087f496f403d5ff460e08e07c46f8a36033386fb76d3d5fc415154345aeb072259eaccab947b3c9fc166e94880264a6
@@ -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 comparator-0.1.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install comparator-0.1.1.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install comparator-0.1.1.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.1 and build and push comparator-0.1.1.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$" />
8
+ <orderEntry type="jdk" jdkName="rbenv: 2.6.3" jdkType="RUBY_SDK" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.2, rbenv: 2.6.3) [gem]" level="application" />
11
+ <orderEntry type="library" scope="PROVIDED" name="csv (v3.1.2, rbenv: 2.6.3) [gem]" level="application" />
12
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, rbenv: 2.6.3) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.5.0, rbenv: 2.6.3) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, rbenv: 2.6.3) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.0, rbenv: 2.6.3) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.0, rbenv: 2.6.3) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.0, rbenv: 2.6.3) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.0, rbenv: 2.6.3) [gem]" level="application" />
19
+ </component>
20
+ </module>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Rubocop" enabled="false" level="WARNING" enabled_by_default="false" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="JavaScriptSettings">
4
+ <option name="languageLevel" value="ES6" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.6.1" project-jdk-type="RUBY_SDK" />
7
+ </project>
@@ -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/comparator.iml" filepath="$PROJECT_DIR$/.idea/comparator.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -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>
@@ -1,11 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
- <list default="true" id="4eafc6cf-fbbf-4975-aecc-e1777eae00d6" name="Default Changelist" comment="">
5
- <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
- <change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
7
- <change beforePath="$PROJECT_DIR$/comparator.gemspec" beforeDir="false" afterPath="$PROJECT_DIR$/comparator.gemspec" afterDir="false" />
8
- </list>
4
+ <list default="true" id="4eafc6cf-fbbf-4975-aecc-e1777eae00d6" name="Default Changelist" comment="" />
9
5
  <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
10
6
  <option name="SHOW_DIALOG" value="false" />
11
7
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -13,48 +9,60 @@
13
9
  <option name="LAST_RESOLUTION" value="IGNORE" />
14
10
  </component>
15
11
  <component name="FileEditorManager">
16
- <leaf>
12
+ <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
17
13
  <file pinned="false" current-in-tab="false">
18
- <entry file="file://$PROJECT_DIR$/lib/comparator/csv.rb">
14
+ <entry file="file://$PROJECT_DIR$/comparator.gemspec">
19
15
  <provider selected="true" editor-type-id="text-editor">
20
- <state relative-caret-position="-501">
21
- <caret line="24" selection-start-line="24" selection-end-line="24" />
16
+ <state relative-caret-position="156">
17
+ <caret line="6" column="20" selection-start-line="6" selection-start-column="20" selection-end-line="6" selection-end-column="20" />
22
18
  </state>
23
19
  </provider>
24
20
  </entry>
25
21
  </file>
26
22
  <file pinned="false" current-in-tab="false">
27
- <entry file="file://$PROJECT_DIR$/lib/comparator/version.rb">
23
+ <entry file="file://$PROJECT_DIR$/lib/comparator/array.rb">
28
24
  <provider selected="true" editor-type-id="text-editor">
29
- <state relative-caret-position="78">
30
- <caret line="3" selection-start-line="3" selection-end-line="3" />
25
+ <state relative-caret-position="219">
26
+ <caret line="13" column="24" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="24" />
31
27
  </state>
32
28
  </provider>
33
29
  </entry>
34
30
  </file>
35
- <file pinned="false" current-in-tab="true">
36
- <entry file="file://$PROJECT_DIR$/comparator.gemspec">
31
+ <file pinned="false" current-in-tab="false">
32
+ <entry file="file://$PROJECT_DIR$/lib/comparator/csv.rb">
37
33
  <provider selected="true" editor-type-id="text-editor">
38
- <state relative-caret-position="176">
39
- <caret line="12" column="25" selection-start-line="12" selection-start-column="25" selection-end-line="12" selection-end-column="25" />
34
+ <state relative-caret-position="910">
35
+ <caret line="35" lean-forward="true" selection-start-line="35" selection-end-line="35" />
40
36
  </state>
41
37
  </provider>
42
38
  </entry>
43
39
  </file>
44
40
  <file pinned="false" current-in-tab="false">
45
- <entry file="file://$PROJECT_DIR$/Gemfile">
41
+ <entry file="file://$PROJECT_DIR$/lib/comparator.rb">
46
42
  <provider selected="true" editor-type-id="text-editor">
47
- <state relative-caret-position="104">
48
- <caret line="4" column="9" selection-start-line="4" selection-start-column="9" selection-end-line="4" selection-end-column="9" />
43
+ <state>
44
+ <caret column="19" selection-start-column="19" selection-end-column="19" />
45
+ </state>
46
+ </provider>
47
+ </entry>
48
+ </file>
49
+ <file pinned="false" current-in-tab="true">
50
+ <entry file="file://$PROJECT_DIR$/README.md">
51
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
52
+ <state split_layout="SPLIT">
53
+ <first_editor relative-caret-position="1002">
54
+ <caret line="66" column="35" selection-start-line="66" selection-start-column="35" selection-end-line="66" selection-end-column="35" />
55
+ </first_editor>
56
+ <second_editor />
49
57
  </state>
50
58
  </provider>
51
59
  </entry>
52
60
  </file>
53
61
  <file pinned="false" current-in-tab="false">
54
- <entry file="file://$PROJECT_DIR$/lib/comparator.rb">
62
+ <entry file="file://$PROJECT_DIR$/Gemfile">
55
63
  <provider selected="true" editor-type-id="text-editor">
56
- <state relative-caret-position="26">
57
- <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
64
+ <state relative-caret-position="104">
65
+ <caret line="4" column="9" selection-start-line="4" selection-start-column="9" selection-end-line="4" selection-end-column="9" />
58
66
  </state>
59
67
  </provider>
60
68
  </entry>
@@ -65,6 +73,8 @@
65
73
  <findStrings>
66
74
  <find>test.</find>
67
75
  <find>comparator-0.1.0.gem</find>
76
+ <find>patchle</find>
77
+ <find>difference_hash</find>
68
78
  </findStrings>
69
79
  </component>
70
80
  <component name="Git.Settings">
@@ -73,7 +83,6 @@
73
83
  <component name="IdeDocumentHistory">
74
84
  <option name="CHANGED_PATHS">
75
85
  <list>
76
- <option value="$PROJECT_DIR$/lib/comparator.rb" />
77
86
  <option value="$PROJECT_DIR$/Gemfile" />
78
87
  <option value="$PROJECT_DIR$/changelog.md" />
79
88
  <option value="$PROJECT_DIR$/.idea/workspace.xml" />
@@ -81,6 +90,9 @@
81
90
  <option value="$PROJECT_DIR$/lib/comparator/csv.rb" />
82
91
  <option value="$PROJECT_DIR$/lib/comparator/version.rb" />
83
92
  <option value="$PROJECT_DIR$/comparator.gemspec" />
93
+ <option value="$PROJECT_DIR$/lib/comparator.rb" />
94
+ <option value="$PROJECT_DIR$/lib/comparator/array.rb" />
95
+ <option value="$PROJECT_DIR$/README.md" />
84
96
  </list>
85
97
  </option>
86
98
  </component>
@@ -106,7 +118,6 @@
106
118
  <foldersAlwaysOnTop value="true" />
107
119
  </navigator>
108
120
  <panes>
109
- <pane id="Scope" />
110
121
  <pane id="ProjectPane">
111
122
  <subPane>
112
123
  <expand>
@@ -118,9 +129,11 @@
118
129
  <select />
119
130
  </subPane>
120
131
  </pane>
132
+ <pane id="Scope" />
121
133
  </panes>
122
134
  </component>
123
135
  <component name="PropertiesComponent">
136
+ <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
124
137
  <property name="WebServerToolWindowFactoryState" value="false" />
125
138
  <property name="last_opened_file_path" value="$PROJECT_DIR$" />
126
139
  <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
@@ -157,25 +170,22 @@
157
170
  <option name="number" value="Default" />
158
171
  <option name="presentableId" value="Default" />
159
172
  <updated>1571576493007</updated>
160
- <workItem from="1571576494480" duration="13656000" />
173
+ <workItem from="1571576494480" duration="14358000" />
174
+ <workItem from="1571595415456" duration="89000" />
175
+ <workItem from="1571640265057" duration="2863000" />
176
+ <workItem from="1572341614398" duration="2809000" />
161
177
  </task>
162
178
  <servers />
163
179
  </component>
164
180
  <component name="TimeTrackingManager">
165
- <option name="totallyTimeSpent" value="13656000" />
181
+ <option name="totallyTimeSpent" value="20119000" />
166
182
  </component>
167
183
  <component name="ToolWindowManager">
168
184
  <frame x="0" y="23" width="1440" height="831" extended-state="0" />
169
- <editor active="true" />
170
185
  <layout>
171
- <window_info id="Favorites" side_tool="true" />
172
- <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24964234" />
186
+ <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26037195" />
173
187
  <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
174
- <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
175
- <window_info anchor="bottom" id="Database Changes" />
176
- <window_info anchor="bottom" id="Version Control" />
177
- <window_info anchor="bottom" id="Terminal" visible="true" weight="0.38312587" />
178
- <window_info anchor="bottom" id="Event Log" side_tool="true" />
188
+ <window_info id="Favorites" order="2" side_tool="true" />
179
189
  <window_info anchor="bottom" id="Message" order="0" />
180
190
  <window_info anchor="bottom" id="Find" order="1" />
181
191
  <window_info anchor="bottom" id="Run" order="2" weight="0.32918397" />
@@ -183,10 +193,15 @@
183
193
  <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
184
194
  <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
185
195
  <window_info anchor="bottom" id="TODO" order="6" />
186
- <window_info anchor="right" id="Database" />
196
+ <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
197
+ <window_info anchor="bottom" id="Database Changes" order="8" />
198
+ <window_info anchor="bottom" id="Version Control" order="9" />
199
+ <window_info active="true" anchor="bottom" id="Terminal" order="10" visible="true" weight="0.38312587" />
200
+ <window_info anchor="bottom" id="Event Log" order="11" side_tool="true" />
187
201
  <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
188
202
  <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
189
203
  <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
204
+ <window_info anchor="right" id="Database" order="3" />
190
205
  </layout>
191
206
  </component>
192
207
  <component name="TypeScriptGeneratedFilesManager">
@@ -224,19 +239,13 @@
224
239
  </state>
225
240
  </provider>
226
241
  </entry>
227
- <entry file="file://$PROJECT_DIR$/CODE_OF_CONDUCT.md">
228
- <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
229
- <state split_layout="SPLIT">
230
- <first_editor relative-caret-position="-1014" />
231
- <second_editor />
232
- </state>
233
- </provider>
234
- </entry>
235
- <entry file="file://$PROJECT_DIR$/README.md">
236
- <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
237
- <state split_layout="SPLIT">
238
- <first_editor relative-caret-position="-726" />
239
- <second_editor />
242
+ <entry file="file://$PROJECT_DIR$/CODE_OF_CONDUCT.md" />
243
+ <entry file="file://$PROJECT_DIR$/test.rb" />
244
+ <entry file="file://$PROJECT_DIR$/comparator-0.1.0.gem" />
245
+ <entry file="file://$PROJECT_DIR$/lib/comparator/version.rb">
246
+ <provider selected="true" editor-type-id="text-editor">
247
+ <state>
248
+ <caret column="17" selection-start-column="17" selection-end-column="17" />
240
249
  </state>
241
250
  </provider>
242
251
  </entry>
@@ -247,43 +256,57 @@
247
256
  </state>
248
257
  </provider>
249
258
  </entry>
250
- <entry file="file://$PROJECT_DIR$/test.rb">
259
+ <entry file="file://$PROJECT_DIR$/comparator.gemspec">
251
260
  <provider selected="true" editor-type-id="text-editor">
252
- <state relative-caret-position="130">
253
- <caret line="5" column="13" lean-forward="true" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
261
+ <state relative-caret-position="156">
262
+ <caret line="6" column="20" selection-start-line="6" selection-start-column="20" selection-end-line="6" selection-end-column="20" />
254
263
  </state>
255
264
  </provider>
256
265
  </entry>
257
- <entry file="file://$PROJECT_DIR$/lib/comparator.rb">
266
+ <entry file="file://$PROJECT_DIR$/bin/setup">
267
+ <provider selected="true" editor-type-id="text-editor" />
268
+ </entry>
269
+ <entry file="file://$PROJECT_DIR$/bin/console">
270
+ <provider selected="true" editor-type-id="text-editor" />
271
+ </entry>
272
+ <entry file="file://$PROJECT_DIR$/lib/comparator/csv.rb">
258
273
  <provider selected="true" editor-type-id="text-editor">
259
- <state relative-caret-position="26">
260
- <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
274
+ <state relative-caret-position="910">
275
+ <caret line="35" lean-forward="true" selection-start-line="35" selection-end-line="35" />
261
276
  </state>
262
277
  </provider>
263
278
  </entry>
264
- <entry file="file://$PROJECT_DIR$/comparator-0.1.0.gem">
279
+ <entry file="file://$PROJECT_DIR$/lib/comparator.rb">
265
280
  <provider selected="true" editor-type-id="text-editor">
266
- <state relative-caret-position="-1341" />
281
+ <state>
282
+ <caret column="19" selection-start-column="19" selection-end-column="19" />
283
+ </state>
267
284
  </provider>
268
285
  </entry>
269
- <entry file="file://$PROJECT_DIR$/lib/comparator/csv.rb">
286
+ <entry file="file://$USER_HOME$/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/comparator-0.1.1/lib/comparator/array.rb">
270
287
  <provider selected="true" editor-type-id="text-editor">
271
- <state relative-caret-position="-501">
272
- <caret line="24" selection-start-line="24" selection-end-line="24" />
288
+ <state relative-caret-position="138">
289
+ <caret line="11" selection-start-line="11" selection-end-line="11" />
273
290
  </state>
274
291
  </provider>
275
292
  </entry>
276
- <entry file="file://$PROJECT_DIR$/lib/comparator/version.rb">
293
+ <entry file="file://$PROJECT_DIR$/lib/comparator/array.rb">
277
294
  <provider selected="true" editor-type-id="text-editor">
278
- <state relative-caret-position="78">
279
- <caret line="3" selection-start-line="3" selection-end-line="3" />
295
+ <state relative-caret-position="219">
296
+ <caret line="13" column="24" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="24" />
280
297
  </state>
281
298
  </provider>
282
299
  </entry>
283
- <entry file="file://$PROJECT_DIR$/comparator.gemspec">
284
- <provider selected="true" editor-type-id="text-editor">
285
- <state relative-caret-position="176">
286
- <caret line="12" column="25" selection-start-line="12" selection-start-column="25" selection-end-line="12" selection-end-column="25" />
300
+ <entry file="file://$PROJECT_DIR$/comparator-0.1.1.gem">
301
+ <provider selected="true" editor-type-id="text-editor" />
302
+ </entry>
303
+ <entry file="file://$PROJECT_DIR$/README.md">
304
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
305
+ <state split_layout="SPLIT">
306
+ <first_editor relative-caret-position="1002">
307
+ <caret line="66" column="35" selection-start-line="66" selection-start-column="35" selection-end-line="66" selection-end-column="35" />
308
+ </first_editor>
309
+ <second_editor />
287
310
  </state>
288
311
  </provider>
289
312
  </entry>
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- comparator (0.1.0)
4
+ comparator (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Comparator
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/comparator`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ A CSV file comparator which will returns a hash which contains column name as key with a list of missing data as value after comparing both csv files and an array comparator that will return a hash after comparing two or more arrays that are passed as arguments.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,17 +20,56 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ```
24
+ require "comparator"
25
+ ```
26
+
27
+ Now, create an instance for Comparator to compare 2 csv file as
28
+
29
+ ```
30
+ comparator = Comparator::CompareCSV.new(to_be_compared_file_path, compared_with_file_path)
31
+ ```
32
+
33
+ `to_be_compared_file_path` - first argument should be a file path to get miss match of data comparing with the other csv file.
26
34
 
27
- ## Development
35
+ `compared_with_file_path` - second argument should be a file path of other csv file which will be compared.
28
36
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
37
 
31
- 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).
38
+ **Note: Both file should follow same header names and column data order**
39
+
40
+ ```
41
+ Example Format file1.csv:
42
+ Column1,Column2
43
+ a,1
44
+ b,2
45
+
46
+ Example Format file2.csv:
47
+ Column1,Column2
48
+ c,1
49
+ b,50
50
+
51
+ comparator = Comparator::CompareCSV.new(file1.csv, file2.csv)
52
+ puts comparator.csv_file_comparator
53
+ # {"Column1"=>["a"],"Column2"=>["2"]}
54
+ ```
55
+
56
+ Create an instance for Comparator to compare arrays as
57
+
58
+ ```
59
+ comparator = Comparator::CompareArray.new
60
+ ```
61
+
62
+ and then pass arrays to be compared as arguments to the following method
63
+
64
+ ```
65
+ difference_in_array = comparator.array_comparator([21,32,[43,32,["numbers"]]],["an","array","of","words"],["an","array",["of","and"],"words",[21,32]])
66
+ puts difference_in_array
67
+ # {"difference"=>[43, "numbers"]}
68
+ ```
32
69
 
33
70
  ## Contributing
34
71
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/comparator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
72
+ Bug reports and pull requests are welcome on GitHub at https://github.com/gowsik-ragunath/comparator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
73
 
37
74
  ## License
38
75
 
@@ -1,5 +1,6 @@
1
1
  require "comparator/version"
2
2
  require "comparator/csv"
3
+ require "comparator/array"
3
4
 
4
5
  module Comparator
5
6
  class Error < StandardError; end
@@ -0,0 +1,26 @@
1
+ module Comparator
2
+ class CompareArray
3
+
4
+ class ArrayInitializeError < StandardError
5
+ def message
6
+ "Pass more than one array"
7
+ end
8
+ end
9
+
10
+ def does_it_work?
11
+ true
12
+ end
13
+
14
+ def array_comparator(*args)
15
+ if args.length > 1
16
+ difference_hash = {}
17
+ evaluation_array = args[0..-2].flatten
18
+ compare_array = args.last.flatten
19
+ difference_hash["difference"] = evaluation_array.difference(compare_array)
20
+ else
21
+ raise ArrayInitializeError
22
+ end
23
+ difference_hash
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module Comparator
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comparator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gowsik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-20 00:00:00.000000000 Z
11
+ date: 2019-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,6 +60,12 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - ".idea/.rakeTasks"
64
+ - ".idea/comparator.iml"
65
+ - ".idea/inspectionProfiles/Project_Default.xml"
66
+ - ".idea/misc.xml"
67
+ - ".idea/modules.xml"
68
+ - ".idea/vcs.xml"
63
69
  - ".idea/workspace.xml"
64
70
  - ".rspec"
65
71
  - ".travis.yml"
@@ -73,6 +79,7 @@ files:
73
79
  - changelog.md
74
80
  - comparator.gemspec
75
81
  - lib/comparator.rb
82
+ - lib/comparator/array.rb
76
83
  - lib/comparator/csv.rb
77
84
  - lib/comparator/version.rb
78
85
  homepage: https://github.com/gowsik-ragunath/data_comparator