fradium 0.1.3 → 0.1.4

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: 7ac78d78887194303b1eb5146c87e0a2ed739cc4ebc7436302a1f03fa010df86
4
- data.tar.gz: 0bdd1b2862746b1f27fce9b6627d8762a697c6ba73f4f8f7b5298d3af25cec5e
3
+ metadata.gz: bc847a2fd50ec41c6b638b9128e0dc1c8eb4ccb101444d8e7cccbb9b37f44645
4
+ data.tar.gz: b546a2697ad3e5fb0acccaa3c25b8bb5c29f6138904e15cd55d22c3d3990cb93
5
5
  SHA512:
6
- metadata.gz: b612f965e45f3f213aadb8636034c88c8f058175865c2e01d6192084833af4a32baee6dfd66ce670e37e938ce635f68da7bf8c8ad7de7e7085d7162d9cac4d28
7
- data.tar.gz: e7709e202d1fc585cce9597554e5a79bfe700ec443ca7909308f74bd5a2569a38d9378b17be04f2945d993d1c94079cb8610b1ef71fd5a09418fede51838b735
6
+ metadata.gz: 63d9d10815e69db4e1083ebfa908a17134cfbf477badd4258575d475b9be1ad49563bd625ce93a8fb67c175e83efaaf2bd09233e3279c03e8cdeefadf6eaaae7
7
+ data.tar.gz: c3f8548a02f040b28698c0a03bac5674897f6c171b6f96dede8ae6be913d0d2895ab16858df32c2ea938ceab44e62f8f87aaf68c7a17d2c249b8c7626abb7f02
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fradium (0.1.3)
4
+ fradium (0.1.4)
5
5
  mysql2 (~> 0.5)
6
6
  pg (~> 1.1)
7
7
  sequel (~> 5.23)
@@ -32,7 +32,7 @@ GEM
32
32
  diff-lcs (>= 1.2.0, < 2.0)
33
33
  rspec-support (~> 3.8.0)
34
34
  rspec-support (3.8.2)
35
- sequel (5.24.0)
35
+ sequel (5.26.0)
36
36
  sqlite3 (1.4.1)
37
37
 
38
38
  PLATFORMS
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fradium - FreeRADIUS User Manager
2
2
 
3
- Fradium comes from **F**ree**RADIU**S **U**ser **M**anager. Quick and easy tool to manage user database of FreeRADIUS.
3
+ Fradium comes from **F**ree**RADI**US **U**ser **M**anager. Quick and easy tool to manage user database of FreeRADIUS.
4
4
 
5
5
  ## License
6
6
  This software is licensed under the MIT license.
@@ -67,4 +67,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
67
67
 
68
68
  ## Contributing
69
69
 
70
- Bug reports and pull requests are welcome on GitHub at https://github.com/metalefty/fradium.
70
+ Bug reports and pull requests are welcome on GitHub at https://github.com/metalefty/rubygem-fradium.
data/exe/fradium CHANGED
@@ -37,7 +37,7 @@ usage:
37
37
  #{File.basename $0} [--profile=profile] subcommand ...
38
38
 
39
39
  subcommands as follows:
40
- create <username> # create new user with password
40
+ create <username> [expiry date] # create new user with password
41
41
  show <username> # show password for username
42
42
  showall # show all users
43
43
  showvalid # show valid(not expired) users
@@ -48,10 +48,15 @@ subcommands as follows:
48
48
  setexpire <username> <expiry date> # set expiry date (date must be parseable by Time#parse)
49
49
  modify <username> # generate new password for username
50
50
  dbconsole # enter database console
51
+ version # show version
51
52
  EOD
52
53
  exit
53
54
  end
54
55
 
56
+ def show_version
57
+ puts "fradium v#{Fradium::VERSION}"
58
+ end
59
+
55
60
  def show_user(username)
56
61
  user = @f.find_user(username).first
57
62
  printf "%s %s\n", user[:username], user[:value]
@@ -76,7 +81,18 @@ case ARGV[0]
76
81
 
77
82
  when 'create'
78
83
  show_help if ARGV[1]&.empty?
84
+ expiry_date = nil
85
+ if ARGV.count >= 2 # when expiry given
86
+ begin
87
+ expiry_date = Time.parse(ARGV[2])
88
+ rescue
89
+ $stderr.puts "ERROR: could not parse expiry date"
90
+ exit
91
+ end
92
+ else
93
+ end
79
94
  @f.create_user(ARGV[1])
95
+ @f.set_expiration(ARGV[1], expiry_date) if expiry_date
80
96
  show_user(ARGV[1])
81
97
 
82
98
  when 'dbconsole'
@@ -127,6 +143,9 @@ when 'modify' # change user password
127
143
  @f.modify_user(ARGV[1])
128
144
  show_user(ARGV[1])
129
145
 
146
+ when 'version'
147
+ show_version
148
+
130
149
  else # unknown subcommand
131
150
  show_help
132
151
  end
@@ -1,3 +1,3 @@
1
1
  class Fradium
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fradium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichiro IWAO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-03 00:00:00.000000000 Z
11
+ date: 2019-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler