BidManagerLoggerGem 0.0.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 +7 -0
- data/lib/GemLoggerBidManager.rb +54 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9f63b16d22e9e088dfe5348d006bcc6fba3ba017
|
4
|
+
data.tar.gz: 85b26a8585a05a8435c1de21ca164d917f254cf6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2941ecd51b19140f5cbb3d955b435173b7b835df4d6480f561e29ced17bd3aa17c63b33c9122de887b13635be05e7a550da2ecd303a99e6296f19c505ddf4af6
|
7
|
+
data.tar.gz: 4c5b6f8d9d79bf610ede5d77618d2337aa2f58566f86a8b8c48a784b4c3d912638fe4df295797b706c4048cf67714d9badcdba8248ee152c9d8047eafbaf2ff4
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#require 'singleton'
|
2
|
+
require 'csv'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
class GemLoggerBidManager
|
6
|
+
attr_accessor :log
|
7
|
+
def initialize(filename)
|
8
|
+
path = File.join('public','data','users',filename)
|
9
|
+
@log = File.open(path,'a')
|
10
|
+
#@log = File.new(File.join('public','data','users',"jobid.txt"),"a")
|
11
|
+
end
|
12
|
+
def loggerMsg(bidvalue,writeremail)
|
13
|
+
|
14
|
+
time1 = Time.now
|
15
|
+
@log.puts("#{jobid},#{email}")
|
16
|
+
time2 = Time.now-time1
|
17
|
+
@log.puts("#{time2} units of time to save article.")
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
class UpdateDatabase
|
24
|
+
attr_accessor :location
|
25
|
+
def initialize
|
26
|
+
#do nothing
|
27
|
+
end
|
28
|
+
def self.updateData(filename,bidvalue,writeremail)
|
29
|
+
path = File.join('public','data','users',filename)
|
30
|
+
@location = path
|
31
|
+
if (!File.exists?(@location))
|
32
|
+
FileUtils.touch(@location)
|
33
|
+
end
|
34
|
+
datasource = CSV.parse(File.read(@location))
|
35
|
+
if(datasource.find{|msg| msg[1]=~/#{email}/})
|
36
|
+
return true
|
37
|
+
else
|
38
|
+
time1 = Time.now
|
39
|
+
entry = "#{jobid},#{email}"
|
40
|
+
arr1 = entry.split(',')
|
41
|
+
csv = CSV.open(@location,'a')
|
42
|
+
csv<<arr1
|
43
|
+
time2 = Time.now-time1
|
44
|
+
arr2 = time2.split(',')
|
45
|
+
csv<<arr2
|
46
|
+
return false
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
#out = GemLogger.instance
|
54
|
+
#out.loggerMsg(3,"a@gmail.com","jobid.txt")
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: BidManagerLoggerGem
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Aayush
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A simple gem
|
14
|
+
email: sethaayush@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/GemLoggerBidManager.rb
|
20
|
+
homepage: http://rubygems.org/gems/BidManagerLoggerGem
|
21
|
+
licenses: []
|
22
|
+
metadata: {}
|
23
|
+
post_install_message:
|
24
|
+
rdoc_options: []
|
25
|
+
require_paths:
|
26
|
+
- lib
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
requirements: []
|
38
|
+
rubyforge_project:
|
39
|
+
rubygems_version: 2.2.2
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: Test to create log file for jobs added
|
43
|
+
test_files: []
|