mylookup 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 +4 -4
- data/lib/mylookup/processor.rb +14 -1
- data/lib/mylookup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b66a31f1c4f242162e28b152c4f6014b630c534
|
4
|
+
data.tar.gz: e4803ecb8c4a3ac6f54b7284b9feb016a4505abf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c484fb91cfa8dd7a30c74e34a0721b8f78b1ed071ef6ce1213697317a26da2d3daeaaf0da6bdc8c0ecf35524e81e2c9520ae26ce45b39ac8d82ff265e3298bed
|
7
|
+
data.tar.gz: e3844d8bb4f6dc85ef411d3b2abfc0a563919aedfe0602ffcbb3950e85b50d994874190b2c4585d8e1b0419840df087cc77c53705fbdd37cd1f104095a224904
|
data/lib/mylookup/processor.rb
CHANGED
@@ -4,6 +4,8 @@ require 'mylookup/writer'
|
|
4
4
|
#= class containing the functionalities of handling the whole show
|
5
5
|
class Processor
|
6
6
|
|
7
|
+
attr_reader :unmatched
|
8
|
+
|
7
9
|
def initialize(opts)
|
8
10
|
@l_db, @l_tbl, @l_on = opts[:left], opts[:leftsheet], opts[:lefton]
|
9
11
|
@r_db, @r_tbl, @r_on = opts[:right], opts[:rightsheet], opts[:righton]
|
@@ -23,6 +25,7 @@ class Processor
|
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
28
|
+
# Executes reading, lookup and writing the unmatched
|
26
29
|
def process
|
27
30
|
puts "Processing initiating..."
|
28
31
|
read_data
|
@@ -30,6 +33,14 @@ class Processor
|
|
30
33
|
write_unmatched unless @unmatched.empty?
|
31
34
|
end
|
32
35
|
|
36
|
+
# Processes [Reading and Lookup] without writing the unmatched
|
37
|
+
def process_without_writing
|
38
|
+
puts "Processing initiating..."
|
39
|
+
read_data
|
40
|
+
mylookup
|
41
|
+
end
|
42
|
+
|
43
|
+
# Filters out the unmatched data
|
33
44
|
def mylookup
|
34
45
|
puts "Executing mylookup..."
|
35
46
|
@unmatched = @l_data - @r_data
|
@@ -39,11 +50,13 @@ class Processor
|
|
39
50
|
puts "Matched: #{(@matched.size.to_f*100/@l_data.size.to_f).round(2)}%"
|
40
51
|
end
|
41
52
|
|
53
|
+
# Writes the unmatched data
|
42
54
|
def write_unmatched
|
43
55
|
writer = FileWriter::Excel.new('unmatched.xlsx', @unmatched, @l_on)
|
44
56
|
writer.write
|
45
57
|
end
|
46
58
|
|
59
|
+
# Reads the Source data
|
47
60
|
def read_data
|
48
61
|
puts "Reading Left Table data..."
|
49
62
|
l_comment = @l_reader.read
|
@@ -56,6 +69,6 @@ class Processor
|
|
56
69
|
end
|
57
70
|
|
58
71
|
private :read_data, :mylookup, :write_unmatched
|
59
|
-
public :process
|
72
|
+
public :process, :process_without_writing
|
60
73
|
|
61
74
|
end
|
data/lib/mylookup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mylookup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeyaraj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|