equitrac-utilities 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile.lock +5 -5
- data/README.md +12 -5
- data/bin/console +1 -1
- data/examples/{server-sample.yml → connection-sample.yml} +0 -0
- data/examples/create_users.rb +16 -6
- data/lib/equitrac/{server.rb → connection.rb} +1 -1
- data/lib/equitrac/utilities/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7f0e1249ce701862a767dc3eb80e99d87ad972b65dd2dc8e4315e123786ad6b
|
4
|
+
data.tar.gz: 036cc0288a6633a616ce86e26f3e1a8a98f3409c445ef5106ddd0a071ab88f15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fe7955ed1561f34150af21ec5d45e7dc43fcb7005abc5aeb27ef7684055b0d36dac9c545e6d3933fbab6b6dea594a1e8bf4bddc5ebbe30e0a39b5975431c761
|
7
|
+
data.tar.gz: 8b8ad70ee6325cb2842a5aae861dbfc10d2a9801f259728713a49ecec14b21d9300ad91c10bf6c52ea680c6fdbaff960d0578afd575a208cbe49be6d5730d2ef
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
equitrac-utilities (0.
|
4
|
+
equitrac-utilities (0.2.0)
|
5
5
|
net-ssh (~> 4.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,13 +9,13 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
codacy-coverage (1.1.8)
|
11
11
|
simplecov
|
12
|
-
docile (1.
|
12
|
+
docile (1.3.0)
|
13
13
|
json (2.1.0)
|
14
14
|
minitest (5.11.3)
|
15
15
|
net-ssh (4.2.0)
|
16
|
-
rake (12.3.
|
17
|
-
simplecov (0.
|
18
|
-
docile (~> 1.1
|
16
|
+
rake (12.3.1)
|
17
|
+
simplecov (0.16.1)
|
18
|
+
docile (~> 1.1)
|
19
19
|
json (>= 1.8, < 3)
|
20
20
|
simplecov-html (~> 0.10.0)
|
21
21
|
simplecov-html (0.10.2)
|
data/README.md
CHANGED
@@ -4,6 +4,13 @@
|
|
4
4
|
|
5
5
|
Equitrac utilities help you run any EQCmd command within ruby. It use SSH by default so make sure you windows server is setup for ssh.
|
6
6
|
|
7
|
+
## CHANGE LOG
|
8
|
+
|
9
|
+
* 0.2.0 - not compatible with 0.1.0
|
10
|
+
- rename Server Class to Connection Class be consistent a with a suite of account management gems
|
11
|
+
|
12
|
+
* 0.1.0 - initial gem
|
13
|
+
|
7
14
|
## Installation
|
8
15
|
|
9
16
|
Add this line to your application's Gemfile:
|
@@ -28,7 +35,7 @@ Or install it yourself as:
|
|
28
35
|
require 'equitrac-utilities'
|
29
36
|
|
30
37
|
# With variables
|
31
|
-
server = Equitrac::
|
38
|
+
server = Equitrac::Connection.new "host.exemple.com", "admin", "server-name", "password"
|
32
39
|
|
33
40
|
# OR with environment variables
|
34
41
|
|
@@ -37,7 +44,7 @@ ENV['EQUITRAC_USER'] = "admin"
|
|
37
44
|
ENV['EQUITRAC_SERVICE_NAME'] = "server-name"
|
38
45
|
ENV['EQUITRAC_HOST_PASSWORD'] = "password"
|
39
46
|
|
40
|
-
server = Equitrac::
|
47
|
+
server = Equitrac::Connection.new
|
41
48
|
```
|
42
49
|
|
43
50
|
if you want to use key based authentication just ignore the password.
|
@@ -64,11 +71,11 @@ cmd = Equitrac::Utilities::User.add( min_user_params )
|
|
64
71
|
```ruby
|
65
72
|
# with key authentication do:
|
66
73
|
|
67
|
-
# server object = Equitrac::
|
74
|
+
# server object = Equitrac::Connection.new "host.exemple.com", "admin", "server-name"
|
68
75
|
server.execute(cmd)
|
69
76
|
|
70
77
|
# if the password is define in the object, it will be included automatically into the options.
|
71
|
-
# server object = Equitrac::
|
78
|
+
# server object = Equitrac::Connection.new "host.exemple.com", "admin", "server-name", "password"
|
72
79
|
server.execute(cmd, {verify_host_key: false})
|
73
80
|
```
|
74
81
|
|
@@ -95,4 +102,4 @@ Pull requests need tests.
|
|
95
102
|
|
96
103
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
97
104
|
|
98
|
-
All rights on
|
105
|
+
All rights on Equitrac are owned by [Nuance Communications, Inc.](https://www.nuance.com/index.html)
|
data/bin/console
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
4
|
require "equitrac/utilities"
|
5
|
-
require "equitrac/
|
5
|
+
require "equitrac/connection"
|
6
6
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
File without changes
|
data/examples/create_users.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby -w
|
2
2
|
|
3
|
+
# run using:
|
4
|
+
# ./create_users.rb
|
5
|
+
|
6
|
+
require 'equitrac/connection'
|
3
7
|
require 'equitrac/utilities'
|
4
|
-
require 'equitrac/server'
|
5
8
|
require 'yaml'
|
6
9
|
|
7
|
-
#
|
10
|
+
# CONNECTION #
|
8
11
|
##########
|
9
|
-
srv_file = '
|
10
|
-
srv_file = '
|
12
|
+
srv_file = 'connection-sample.yml' if File.file?('connection-sample.yml')
|
13
|
+
srv_file = 'connection.yml' if File.file?('connection.yml') # real
|
11
14
|
srv_file ||= nil
|
12
15
|
#
|
13
16
|
srv_info = nil
|
@@ -21,10 +24,10 @@ srv_info ||= { hostname: 'equitrac.example.com', # remote server hostname
|
|
21
24
|
username: 'remote', # remote login username
|
22
25
|
eq_service: 'eq56', # equitrac SERVICE name
|
23
26
|
}
|
24
|
-
# File.write("
|
27
|
+
# File.write("connection-sample.yml",srv_info.to_yaml)
|
25
28
|
puts "\nSRV_INFO: #{srv_info}"
|
26
29
|
|
27
|
-
server = Equitrac::
|
30
|
+
server = Equitrac::Connection.new( srv_info[:hostname],
|
28
31
|
srv_info[:username],
|
29
32
|
srv_info[:eq_service]
|
30
33
|
) unless srv_info.nil?
|
@@ -53,6 +56,13 @@ end unless users_file.nil?
|
|
53
56
|
puts "\nUSERS:"
|
54
57
|
pp users
|
55
58
|
|
59
|
+
# add is this what you expect?
|
60
|
+
puts "Review the user data \nEnter 'Y' to create eq56 accounts"
|
61
|
+
answer = gets.chomp.downcase
|
62
|
+
puts "aborting account creation" unless answer.eql? 'y'
|
63
|
+
exit unless answer.eql? 'y'
|
64
|
+
puts "creating eq56 accounts ..."
|
65
|
+
|
56
66
|
# CREATE #
|
57
67
|
##########
|
58
68
|
puts "\nEQ56 Commands:"
|
@@ -11,7 +11,7 @@ module Equitrac
|
|
11
11
|
# @return [String] The path where Equitrac utilities is installed
|
12
12
|
# @!attribute [r] service_name
|
13
13
|
# @return [String] The name of the Equitrac service.
|
14
|
-
class
|
14
|
+
class Connection
|
15
15
|
attr_reader :service_name, :eqcmd_path
|
16
16
|
|
17
17
|
# @note Host, User and Service name are required
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: equitrac-utilities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliott Hebert
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
@@ -100,10 +100,10 @@ files:
|
|
100
100
|
- bin/console
|
101
101
|
- bin/setup
|
102
102
|
- equitrac-utilities.gemspec
|
103
|
+
- examples/connection-sample.yml
|
103
104
|
- examples/create_users.rb
|
104
|
-
- examples/server-sample.yml
|
105
105
|
- examples/users-sample.yml
|
106
|
-
- lib/equitrac/
|
106
|
+
- lib/equitrac/connection.rb
|
107
107
|
- lib/equitrac/utilities.rb
|
108
108
|
- lib/equitrac/utilities/user.rb
|
109
109
|
- lib/equitrac/utilities/version.rb
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.7.
|
130
|
+
rubygems_version: 2.7.6
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: A gem to interact with equitrac 5.6
|