mylookup 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6df5e23e938ab44b1a4d53673d026e0fdaff92c7
4
- data.tar.gz: bb99cfeb12c152352182413d0701b826fb9ccfd9
3
+ metadata.gz: 0b66a31f1c4f242162e28b152c4f6014b630c534
4
+ data.tar.gz: e4803ecb8c4a3ac6f54b7284b9feb016a4505abf
5
5
  SHA512:
6
- metadata.gz: 66804dde9c2b78e9bc8150f22db849b207abf0f1a11145b85228691431d0717c865ce65a4057c0e1f50793d6b6402b0e34600909bb65f93b40d3d24c9ba0c5c9
7
- data.tar.gz: 64e59f7c8c00f324e411cf9d61bcf66fce63a34e8123790fb139cc01cf6ce303318a5629550991ff9e60052248eb5d1800f13b3a8a1eba6d1f435b62f6eb3339
6
+ metadata.gz: c484fb91cfa8dd7a30c74e34a0721b8f78b1ed071ef6ce1213697317a26da2d3daeaaf0da6bdc8c0ecf35524e81e2c9520ae26ce45b39ac8d82ff265e3298bed
7
+ data.tar.gz: e3844d8bb4f6dc85ef411d3b2abfc0a563919aedfe0602ffcbb3950e85b50d994874190b2c4585d8e1b0419840df087cc77c53705fbdd37cd1f104095a224904
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Mylookup
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: mylookup
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
  - jeyaraj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-18 00:00:00.000000000 Z
11
+ date: 2017-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler