login_records 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/ext/extconf.rb +2 -10
- data/ext/login_records.c +11 -0
- data/lib/login_records.rb +0 -1
- data/lib/login_records/version.rb +1 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 525b0722e48134d49e8969071eb68c4d469ca14b3aaa3f20c4a27956a4e23220
|
|
4
|
+
data.tar.gz: 537d0d3d0caa769ec0b5aa4e252c098a85e73101c476e6ae908bdf42d80583bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b42995ff8dc3b5006d4b6d319921be51e3d5d08b11173fa1b4e0c93e96ffaebd3a47f5506eb9bbb60c2af086f8d39594756ffc0ab280fca8ba514d453e6b21e4
|
|
7
|
+
data.tar.gz: b6f18e04c6731c859c1c1099743d235056f03bf1aa7fdf780ad3974ea6ca5b48a61960cdd321345318f7fd58299f73c3c6f8f5a4815d8e3936c75e965dbf5a23
|
data/ext/extconf.rb
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
require 'mkmf'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
unless have_const('linux') || RbConfig::CONFIG['arch'].to_s[/linux/]
|
|
6
|
-
abort('Platform is not linux')
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
unless have_header('utmpx.h') && have_header('ruby.h')
|
|
10
|
-
abort("Your system doesn't have utmpx.h.")
|
|
11
|
-
end
|
|
12
|
-
|
|
3
|
+
abort('Platform is not linux') unless have_const('linux') || RbConfig::CONFIG['arch'].to_s[/linux/]
|
|
4
|
+
abort("Your system doesn't have utmpx.h.") unless have_header('utmpx.h') && have_header('ruby.h')
|
|
13
5
|
create_makefile 'login_records/login_records'
|
data/ext/login_records.c
CHANGED
|
@@ -97,10 +97,21 @@ VALUE btmp(VALUE obj) {
|
|
|
97
97
|
return ary ;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
VALUE parse(VALUE obj, VALUE file) {
|
|
101
|
+
VALUE ary = rb_ary_new() ;
|
|
102
|
+
char *c_f = StringValuePtr(file) ;
|
|
103
|
+
read_log(ary, c_f) ;
|
|
104
|
+
return ary ;
|
|
105
|
+
}
|
|
106
|
+
|
|
100
107
|
void Init_login_records() {
|
|
101
108
|
VALUE _login_records = rb_define_module("LoginRecords") ;
|
|
109
|
+
rb_define_const(_login_records, "PATH_WTMP", rb_str_new_cstr(_PATH_WTMP)) ;
|
|
110
|
+
rb_define_const(_login_records, "PATH_UTMP", rb_str_new_cstr(_PATH_UTMP)) ;
|
|
111
|
+
rb_define_const(_login_records, "PATH_BTMP", rb_str_new_cstr(_PATH_BTMP)) ;
|
|
102
112
|
|
|
103
113
|
rb_define_module_function(_login_records, "wtmp", wtmp, 0) ;
|
|
104
114
|
rb_define_module_function(_login_records, "utmp", utmp, 0) ;
|
|
105
115
|
rb_define_module_function(_login_records, "btmp", btmp, 0) ;
|
|
116
|
+
rb_define_module_function(_login_records, "parse", parse, 1) ;
|
|
106
117
|
}
|
data/lib/login_records.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: login_records
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sourav Goswami
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-01-
|
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Using utmpx.h, LoginRecords Allows you to parse UTMP, WMTP and BTMP files
|
|
14
14
|
on Linux
|