logfiction 0.1.2 → 0.1.3
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/.gitignore +2 -0
- data/exe/logfiction +7 -4
- data/lib/logfiction/version.rb +1 -1
- data/lib/logfiction.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8991359d9e5068cf4137ed1f6c19bf4011d18437055ecbdd57b62620d6a5d596
|
4
|
+
data.tar.gz: c21de91e9d2d7d7fc72be1ce4baba600ccde388f158c482974ed0d7269f120fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2217fbbb1317e983be4b3032cfd0213a0f2885a2834fba25bc29581f3228b23ab1de3d3386ec365eefb7ac778b823b24cbba198ec3fabecd5c2d67db758dd49
|
7
|
+
data.tar.gz: efc632c1182f07cb96d93d4fdd3fd390b1761e7b501973aca9e9d9f776c7771ace9bfd9318a18d2fccba82f6ef2bf51bc259bfa27d71f92be7b4f57c4405c184
|
data/.gitignore
CHANGED
data/exe/logfiction
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'logfiction'
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
n = 1000
|
6
|
+
filepath='./fictionlog.csv'
|
7
|
+
|
8
|
+
n = ARGV[0] if ARGV[1]
|
9
|
+
filepath = ARGV[1] if ARGV[1]
|
6
10
|
la = Logfiction::AccessLog.new()
|
7
|
-
la.
|
8
|
-
la.export_logfile(filetype='CSV',filepath='./fictionlog.csv')
|
11
|
+
la.export_logfile(n=n, filetype='CSV',filepath=filepath)
|
data/lib/logfiction/version.rb
CHANGED
data/lib/logfiction.rb
CHANGED
@@ -411,8 +411,8 @@ module Logfiction
|
|
411
411
|
output_accesslogs.sort{|a, b| a[:timestamp] <=> b[:timestamp]}[0,n_max]
|
412
412
|
end
|
413
413
|
|
414
|
-
def export_logfile(
|
415
|
-
logs = self.generate_accesslog(
|
414
|
+
def export_logfile(n=10000, filetype='CSV', filepath='./fiction_log.csv')
|
415
|
+
logs = self.generate_accesslog(n)
|
416
416
|
headers = logs.first.keys
|
417
417
|
if filetype == 'CSV'
|
418
418
|
CSV.open(filepath, "wb") do |output|
|