ionis 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -29,7 +29,7 @@ In a nutshell:
29
29
 
30
30
  hNetsoul = IONIS::Netsoul.new
31
31
  puts hNetsoul.getUser 'meyer_t'
32
- puts hNetsoul.getUser 'adam_p'
32
+ puts hNetsoul.online? 'adam_p'
33
33
  rescue IONIS::Exception::HostNotFound => e
34
34
  puts e.reason
35
35
  rescue IONIS::Exception::ConnectionRefused => e
@@ -10,6 +10,11 @@ module IONIS
10
10
  @tmpDir = nil
11
11
  @lstStudent = nil
12
12
 
13
+ # Instance of Authentication - sshUserName and sshUserPass are needed to update IONIS Auth. file from IONIS Server.
14
+ # @param [String] sshUserName IONIS Login
15
+ # @param [String] sshUserPass Unix password
16
+ # @param [Boolean] forceUpdate Force update of IONIS Auth. files
17
+ # @return [Authentication] A new instance of Authentication
13
18
  def initialize sshUserName, sshUserPass, forceUpdate = false
14
19
  @tmpDir = File.join Dir.tmpdir, 'ionis_auth/'
15
20
  @lstStudent = Hash.new
@@ -68,12 +73,19 @@ module IONIS
68
73
  hFile.close
69
74
  end
70
75
 
76
+ # Check PPP Password of given user
77
+ # @param [String] userName IONIS Login
78
+ # @param [String] userPass PPP Password
79
+ # @return [Mixed] Informations about given user in Array if password if correct. Otherwize: false
71
80
  def chkPass userName, userPass
72
81
  false if @lstStudent == nil
73
82
  return @lstStudent[userName] if BCrypt::Engine.hash_secret(userPass , @lstStudent[userName][:password]) == @lstStudent[userName][:password]
74
83
  false
75
84
  end
76
85
 
86
+ # Get informations about one user
87
+ # @param [String] userName IONIS Login
88
+ # @return [Hash] Information about given user in Array. If User doesn't exist, the returned array will be empty
77
89
  def getUser userName
78
90
  false if @lstStudent == nil
79
91
  return @lstStudent[userName]
data/lib/ionisnetsoul.rb CHANGED
@@ -8,6 +8,8 @@ module IONIS
8
8
  @tmpDir = nil
9
9
  @usrData = nil
10
10
 
11
+ # Instance of Netsoul
12
+ # @return [Netsoul] A new instance of Netsoul
11
13
  def initialize
12
14
  @tmpDir = File.join Dir.tmpdir, 'ionis_auth'
13
15
  Dir.mkdir @tmpDir if !File.directory? @tmpDir
@@ -43,20 +45,30 @@ module IONIS
43
45
  end
44
46
  end
45
47
 
48
+ # Get informations about given connected user
49
+ # @param [String] login IONIS Login
50
+ # @return [Hash] Information about given user in Array. If User doesn't exist, the returned array will be empty
46
51
  def getUser login
47
52
  return false if !@usrData
48
53
  @usrData[login]
49
54
  end
50
55
 
56
+ # Get number of connected user(s)
57
+ # @return [fixnum] Number of connected user(s)
51
58
  def size
52
59
  return @usrData.size
53
60
  end
54
61
 
62
+ # Get informations about all connected user
63
+ # @return [Hash] Information about given user in Array. If no-one was connected, the returned array will be empty
55
64
  def getAllOnlineUsers
56
65
  return false if !@usrData
57
66
  @usrData[login]
58
67
  end
59
68
 
69
+ # Check if user is connected
70
+ # @param [String] login IONIS Login
71
+ # @return [Boolean] True if user is Online, otherwize: false
60
72
  def online? login
61
73
  return false if !@usrData
62
74
  return true if @usrData[login]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ionis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-05 00:00:00.000000000 Z
12
+ date: 2012-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
16
- requirement: &13778440 !ruby/object:Gem::Requirement
16
+ requirement: &7571320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13778440
24
+ version_requirements: *7571320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: net-scp
27
- requirement: &13777680 !ruby/object:Gem::Requirement
27
+ requirement: &6113080 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *13777680
35
+ version_requirements: *6113080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bcrypt-ruby
38
- requirement: &13776380 !ruby/object:Gem::Requirement
38
+ requirement: &5403240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 3.0.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *13776380
46
+ version_requirements: *5403240
47
47
  description: A Ruby set of Classes to get informations about students in Ionis group
48
48
  email: meyer.thibault@hotmail.fr
49
49
  executables: []
@@ -62,7 +62,7 @@ rdoc_options:
62
62
  - --line-numbers
63
63
  - --inline-source
64
64
  - --title
65
- - Net-scp
65
+ - IONIS
66
66
  - --main
67
67
  - README.rdoc
68
68
  require_paths: