oxidized-script 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: cce118871517c73f04d3cdfde78e7168a08de6e5
4
- data.tar.gz: 8b15d4ecd969244355ee857e293eaa6ddd85d690
3
+ metadata.gz: da3237c4e0c473a12f3986aa33b2a346a5aedd50
4
+ data.tar.gz: 83343c64205b147900da58464d14fb566452ed4b
5
5
  SHA512:
6
- metadata.gz: e8c59caec173aaa5e63e49538d1e3d633262896eb92fb410ee13b42df9a3c8d7b1fc7b66f17cfa9eb8e89f656f8878f3b7d2672ce7f08a7baff62386e51e36e9
7
- data.tar.gz: 99920e328550ae9250f0de81b81284acc8961b958947ca5d735fadbbe1bcf5298989cb345b3d84c580664fde6c9929f12fd42fa9cf3faf0f429b7e5a5f2756b2
6
+ metadata.gz: adba2dfd0f966f7183c6a43f08f2d878f9afb882474a8cbe898525d0c02d225333c6967220ba06342fbab92e74ca32cc04db664e1f6540662d3bf1ed1d7ad9a4
7
+ data.tar.gz: e8e2c3f3f6dc9a455f766bea7051069414271ebc459c6a51c96958ac708dd4f1e02fc4e197f64d6a2b5d3c7897366c8a0d64b75ccf49b34009b59cfd632b290f
data/CHANGELOG.md CHANGED
@@ -1,2 +1,5 @@
1
+ # 0.1.2
2
+ - BUGFIX: fix for oxidized refactored code
3
+
1
4
  # 0.1.1
2
5
  - BUGFIX: initialize manager only once
data/bin/oxs CHANGED
@@ -5,5 +5,5 @@ begin
5
5
  puts Oxidized::Script::CLI.new.run
6
6
  rescue => error
7
7
  warn "#{error}"
8
- raise if Oxidized::CFG.debug
8
+ raise if Oxidized.config.debug
9
9
  end
@@ -1,6 +1,7 @@
1
1
  module Oxidized
2
2
  require_relative 'script'
3
3
  require 'slop'
4
+
4
5
  class Script
5
6
  class CLI
6
7
  attr_accessor :cmd_class
@@ -20,7 +21,10 @@ module Oxidized
20
21
 
21
22
  def initialize
22
23
  @args, @opts = opts_parse load_dynamic
23
- CFG.debug = true if @opts[:debug]
24
+
25
+ Config.load(@opts)
26
+ Oxidized.setup_logger
27
+
24
28
  if @cmd_class
25
29
  @cmd_class.run :args=>@args, :opts=>@opts, :host=>@host, :cmd=>@cmd
26
30
  exit 0
@@ -19,7 +19,8 @@ module Oxidized
19
19
  def cmd command
20
20
  out = ''
21
21
  out += "## OXS - #{command}\n" if @verbose
22
- out += @model.cmd command
22
+ cmd_out = @model.cmd command
23
+ out += cmd_out if cmd_out
23
24
  out
24
25
  end
25
26
 
@@ -53,7 +54,7 @@ module Oxidized
53
54
  enable = opts.delete :enable
54
55
  community = opts.delete :community
55
56
  @verbose = opts.delete :verbose
56
- CFG.input.default = opts.delete :protocols if opts[:protocols]
57
+ Oxidized.config.input.default = opts.delete :protocols if opts[:protocols]
57
58
  raise InvalidOption, "#{opts} not recognized" unless opts.empty?
58
59
 
59
60
  @@oxi ||= false
@@ -80,8 +81,8 @@ module Oxidized
80
81
  end
81
82
  @node.auth[:username] = username if username
82
83
  @node.auth[:password] = password if password
83
- CFG.vars.enable = enable if enable
84
- CFG.timeout = timeout if timeout
84
+ Oxidized.config.vars.enable = enable if enable
85
+ Oxidized.config.timeout = timeout if timeout
85
86
  @model = @node.model
86
87
  @input = nil
87
88
  connect
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'oxidized-script'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
  s.licenses = %w( Apache-2.0 )
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = [ 'Saku Ytti' ]
@@ -13,6 +13,6 @@ Gem::Specification.new do |s|
13
13
  s.executables = %w( oxs )
14
14
  s.require_path = 'lib'
15
15
 
16
- s.add_runtime_dependency 'oxidized', '~> 0.2'
16
+ s.add_runtime_dependency 'oxidized', '~> 0.11'
17
17
  s.add_runtime_dependency 'slop', '~> 3.5'
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized-script
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-12 00:00:00.000000000 Z
11
+ date: 2016-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oxidized
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.11'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: '0.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: slop
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project: oxidized-script
83
- rubygems_version: 2.2.2
83
+ rubygems_version: 2.4.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: cli + library for scripting network devices