Skip to content

Commit

Permalink
Bump minimal ruby to 2.3
Browse files Browse the repository at this point in the history
 net-ssh to 5, rubocop to 0.65 (ytti#1718)

Supporting 2.0 is becoming a chore due to increasingly newest versions of dependent packages are not supporting 2.0. We chose 2.3 because that seems next release that some relevant distributions are shipping with and because 2.3 comes with safe navigation operator ?.
  • Loading branch information
wk authored and ytti committed Mar 3, 2019
1 parent a28300e commit a82f9b0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 35 deletions.
8 changes: 2 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
inherit_from: .rubocop_todo.yml

# Do not attempt to police vendored code
AllCops:
Include:
- Rakefile

# Do not attempt to police vendored code, and exclude special cases
AllCops:
#TargetRubyVersion: 2.0
TargetRubyVersion: 2.3
Exclude:
- 'vendor/**/*'

Expand Down
38 changes: 30 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-02-04 23:25:43 +0200 using RuboCop version 0.63.1.
# on 2019-03-02 20:02:35 +0100 using RuboCop version 0.65.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Configuration parameters: Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'oxidized.gemspec'

# Offense count: 680
Lint/AmbiguousRegexpLiteral:
Enabled: false
Expand Down Expand Up @@ -111,11 +104,32 @@ Style/DoubleNegation:
- 'lib/oxidized/cli.rb'
- 'lib/oxidized/hook/exec.rb'

# Offense count: 171
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: when_needed, always, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 1
Style/IfUnlessModifierOfIfUnless:
Exclude:
- 'lib/oxidized/input/ssh.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/oxidized/hook/exec.rb'
- 'lib/oxidized/hook/githubrepo.rb'
- 'lib/oxidized/model/aricentiss.rb'
- 'lib/oxidized/model/dellx.rb'
- 'lib/oxidized/model/powerconnect.rb'
- 'lib/oxidized/worker.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/Proc:
Expand All @@ -129,6 +143,14 @@ Style/Proc:
Style/RegexpLiteral:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist.
# Whitelist: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'lib/oxidized/input/http.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowAsExpressionSeparator.
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ before_install:
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
- gem install bundler -v '< 2'
rvm:
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* FEATURE: add raisecom RAX model (@vitalisator)
* FEATURE: add huawei smartax model (@nyash)
* MISC: prompt updates in siklu, netonix, netscaler models
* MISC: minimal supported ruby is now 2.3, net-ssh dependency ~> 5, rubocop ~> 0.65.0

## 0.25.0

Expand Down
26 changes: 10 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU#t=3h
* [FreeBSD](#freebsd)
* [Build from Git](#build-from-git)
* [Docker](#running-with-docker)
* [Installing Ruby 2.1.2 using RVM](#installing-ruby-212-using-rvm)
* [Installing Ruby 2.3 using RVM](#installing-ruby-23-using-rvm)
3. [Initial Configuration](#configuration)
4. [Configuration](docs/Configuration.md)
* [Debugging](docs/Configuration.md#debugging)
Expand Down Expand Up @@ -98,15 +98,9 @@ gem install oxidized-script oxidized-web # If you don't install oxidized-web, en

### CentOS, Oracle Linux, Red Hat Linux

On CentOS 6 / RHEL 6, begin by installing Ruby 2.0 or greater. For Ruby 2.1.2 installation instructions see [Installing Ruby 2.1.2 using RVM](#installing-ruby-212-using-rvm).
On CentOS 6 and 7 / RHEL 6 and 7, begin by installing Ruby 2.3 or greater by following the instructions at [Installing Ruby 2.3 using RVM](#installing-ruby-23-using-rvm).

If you've installed Ruby 2.0 or greater via a 3rd party package rather than the RVM instructions, additional dependencies will be required:

```shell
yum install make cmake which sqlite-devel openssl-devel libssh2-devel ruby gcc ruby-devel libicu-devel gcc-c++
```

RHEL 7 / CentOS 7 will work out of the box with the following package list:
If you've installed Ruby 2.3 or greater via a 3rd party package rather than the RVM instructions, additional dependencies will be required:

```shell
yum install make cmake which sqlite-devel openssl-devel libssh2-devel ruby gcc ruby-devel libicu-devel gcc-c++
Expand All @@ -121,7 +115,7 @@ gem install oxidized-script oxidized-web # if you don't install oxidized-web, ma

### FreeBSD

[Use RVM to install Ruby v2.1.2](#installing-ruby-212-using-rvm), then install all required packages and gems:
[Use RVM to install Ruby v2.3](#installing-ruby-23-using-rvm), then install all required packages and gems:

```shell
pkg install cmake pkgconf
Expand Down Expand Up @@ -225,9 +219,9 @@ If you need to use an internal CA (e.g. to connect to an private github instance
docker run -v /etc/oxidized:/root/.config/oxidized -v /path/to/MY-CA.crt:/usr/local/share/ca-certificates/MY-CA.crt -p 8888:8888/tcp -e UPDATE_CA_CERTIFICATES=true -t oxidized/oxidized:latest
```

### Installing Ruby 2.1.2 using RVM
### Installing Ruby 2.3 using RVM

Install Ruby 2.1.2 build dependencies
Install Ruby 2.3 build dependencies

```shell
yum install curl gcc-c++ patch readline readline-devel zlib zlib-devel
Expand All @@ -241,12 +235,12 @@ Install RVM
curl -L get.rvm.io | bash -s stable
```

Setup RVM environment and compile and install Ruby 2.1.2 and set it as default
Setup RVM environment and compile and install Ruby 2.3 and set it as default

```shell
source /etc/profile.d/rvm.sh
rvm install 2.1.2
rvm use --default 2.1.2
rvm install 2.3
rvm use --default 2.3
```

## Configuration
Expand Down Expand Up @@ -286,7 +280,7 @@ Oxidized supports [CSV](docs/Configuration.md#source-csv), [SQLite](docs/Config

Possible outputs are either [File](docs/Configuration.md#output-file), [GIT](docs/Configuration.md#output-git), [GIT-Crypt](docs/Configuration.md#output-git-crypt) and [HTTP](docs/Configuration.md#output-http). The file backend takes a destination directory as argument and will keep a file per device, with most recent running version of a device. The GIT backend (recommended) will initialize an empty GIT repository in the specified path and create a new commit on every configuration change. The GIT-Crypt backend will also initialize a GIT repository but every configuration push to it will be encrypted on the fly by using `git-crypt` tool. Take a look at the [Configuration](docs/Configuration.md) for more details.

Maps define how to map a model's fields to model [model fields](https://github.com/ytti/oxidized/tree/master/lib/oxidized/model). Most of the settings should be self explanatory, log is ignored if `use_syslog`(requires Ruby >= 2.0) is set to `true`.
Maps define how to map a model's fields to model [model fields](https://github.com/ytti/oxidized/tree/master/lib/oxidized/model). Most of the settings should be self explanatory, log is ignored if `use_syslog` is set to `true`.

First create the directory where the CSV `output` is going to store device configs and start Oxidized once.

Expand Down
6 changes: 3 additions & 3 deletions oxidized.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Gem::Specification.new do |s|
s.executables = %w[oxidized]
s.require_path = 'lib'

s.required_ruby_version = '>= 2.0.0'
s.required_ruby_version = '>= 2.3'
s.add_runtime_dependency 'asetus', '~> 0.1'
s.add_runtime_dependency 'net-ssh', '~> 4.1.0'
s.add_runtime_dependency 'net-ssh', '~> 5'
s.add_runtime_dependency 'net-telnet', '~> 0.1.1'
s.add_runtime_dependency 'rugged', '~> 0.21', '>= 0.21.4'
s.add_runtime_dependency 'slop', '~> 3.5'
Expand All @@ -31,6 +31,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'mocha', '~> 1.1'
s.add_development_dependency 'pry', '~> 0'
s.add_development_dependency 'rake', '~> 10.0'
s.add_development_dependency 'rubocop', '~> 0.57.1'
s.add_development_dependency 'rubocop', '~> 0.65.0'
s.add_development_dependency 'simplecov'
end

0 comments on commit a82f9b0

Please sign in to comment.