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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f274799ebf478a248cd69c80c08fef6ae1ace4b2e0e465511c584f40fed8f420
4
- data.tar.gz: 2563fdaf7705cd8eac96be961391352a8e088f06f7ea0c32ebcd59b3feafe022
3
+ metadata.gz: 525b0722e48134d49e8969071eb68c4d469ca14b3aaa3f20c4a27956a4e23220
4
+ data.tar.gz: 537d0d3d0caa769ec0b5aa4e252c098a85e73101c476e6ae908bdf42d80583bf
5
5
  SHA512:
6
- metadata.gz: 9c9821002c5a5d38515725a47077f96a1aefc75ee0fbc8b4c54f70e323bb140ace21c9cfacb5122a747b9c57b91f54964f3ddd1b9ca5098f51be75a3eeca0ba2
7
- data.tar.gz: deae6d466c7d042bcdae08997ca495d287b3beea9860e3e7c6f8b83d1cd391a662cb979cb963b2c9496b4ee679e1db561461804e384ef53bc50c0366eaa9e2fc
6
+ metadata.gz: b42995ff8dc3b5006d4b6d319921be51e3d5d08b11173fa1b4e0c93e96ffaebd3a47f5506eb9bbb60c2af086f8d39594756ffc0ab280fca8ba514d453e6b21e4
7
+ data.tar.gz: b6f18e04c6731c859c1c1099743d235056f03bf1aa7fdf780ad3974ea6ca5b48a61960cdd321345318f7fd58299f73c3c6f8f5a4815d8e3936c75e965dbf5a23
@@ -1,13 +1,5 @@
1
1
  require 'mkmf'
2
2
 
3
- $CFLAGS << ' -O3'
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'
@@ -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
  }
@@ -1,3 +1,2 @@
1
- # frozen_string_literal: true
2
1
  require_relative "login_records/version"
3
2
  require 'login_records/login_records'
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module LoginRecords
4
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
5
3
  end
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.2
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-26 00:00:00.000000000 Z
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