tl1 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5d35537d6f1a429423399d4835dc3e4eb7144519
4
- data.tar.gz: e56e4cb71b67810347750b224514e6ac07055d66
2
+ SHA256:
3
+ metadata.gz: 4064651754fc2db620598b78faf1692f04c1d9e355805d6d49562b9f589d1126
4
+ data.tar.gz: 837e3e1c7f4d4059e0b95ecafab8534cc8bc8c57e82d392672887caeef489f2f
5
5
  SHA512:
6
- metadata.gz: ce8b5e1ed68c32d5e257143a6e4315e015db30561bcf82e29e979eb0962516e95ec3b04539ffa1fe1bc49677b7a8bdfc8087d127d39ef8be43979ac7090925a6
7
- data.tar.gz: 2e91ebdc27d97f2ca8fe5385e14b3fd504a6666b5d458840bc33f6c5ce4c3954fb6878c62888cee32d3227e6d6c97cf0f980f28ab2a0d1f9e8906a0086efbf33
6
+ metadata.gz: eea6f6297fc224ffb1c890ba7d50171bc1d92c13a3c81711e8bacd23929e30f0ce77add62ad54f9cd779c1e4f60ce1ecdc2f1cca6dd2126207dde04aed0af8df
7
+ data.tar.gz: 239749dfb981ef8afc69b89be5ef6741fe2190e3640ff26552778de5ae6fc41d7b4f888ddd3757cd9a882743a7204264b7a5b4988ed943decc0c1410b4997692
@@ -0,0 +1,38 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ pull_request:
7
+ branches: [ "master" ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ ruby-version:
18
+ - '2.3'
19
+ - '2.4'
20
+ - '2.5'
21
+ - '2.6'
22
+ - '2.7'
23
+ - '3.0'
24
+ - '3.1'
25
+ - jruby-9.1.17.0
26
+ - jruby-9.2.21.0
27
+ - jruby-9.3.6.0
28
+
29
+ steps:
30
+ - uses: actions/checkout@v3
31
+ - name: Set up Ruby
32
+ # https://github.com/ruby/setup-ruby#versioning
33
+ uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby-version }}
36
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
37
+ - name: Run tests
38
+ run: bundle exec rake
data/.rubocop.yml CHANGED
@@ -16,11 +16,18 @@ Metrics/MethodLength:
16
16
 
17
17
  Metrics/ModuleLength:
18
18
  Exclude:
19
+ - 'lib/tl1/platforms/bti.rb'
19
20
  - 'spec/**/*'
20
21
 
21
22
  Metrics/LineLength:
22
23
  Exclude:
23
24
  - 'spec/tl1/command_spec.rb'
24
25
 
26
+ Naming/HeredocDelimiterNaming:
27
+ Enabled: false
28
+
29
+ Style/CommentedKeyword:
30
+ Enabled: false
31
+
25
32
  Style/BlockDelimiters:
26
33
  Enabled: false
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source 'https://rubygems.org'
3
4
 
4
5
  gemspec
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # Tl1
1
+ # TL1
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/tl1.svg)](https://rubygems.org/gems/tl1)
4
+ [![Build Status](https://travis-ci.org/bjmllr/tl1.svg)](https://travis-ci.org/bjmllr/tl1)
2
5
 
3
6
  The TL1 protocol is used by network operators to manage optical and other
4
7
  networking equipment produced by multiple vendors. Although it is has a terse
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'bundler/gem_tasks'
3
4
  require 'rspec/core/rake_task'
4
5
 
data/lib/tl1/ast.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'strscan'
3
4
 
4
5
  module TL1
@@ -33,14 +34,14 @@ module TL1
33
34
 
34
35
  module_function def split(string, delimiter)
35
36
  scanner = StringScanner.new(string)
36
- array = [String.new]
37
+ array = [+'']
37
38
 
38
39
  loop do
39
40
  return array if scanner.eos?
40
41
  char = scanner.getch
41
42
  case char
42
43
  when delimiter
43
- array << String.new
44
+ array << +''
44
45
  when '"'
45
46
  array.last << split_quoted(scanner)
46
47
  else
@@ -50,7 +51,7 @@ module TL1
50
51
  end
51
52
 
52
53
  module_function def split_quoted(scanner)
53
- string = String.new('"')
54
+ string = +'"'
54
55
 
55
56
  loop do
56
57
  raise 'Unexpected end of quoted string' if scanner.eos?
data/lib/tl1/command.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'strscan'
3
4
 
4
5
  module TL1
@@ -75,7 +76,7 @@ module TL1
75
76
  end
76
77
 
77
78
  def scan_record(scanner)
78
- record = String.new
79
+ record = +''
79
80
 
80
81
  scan_characters(scanner) do |char|
81
82
  case char
@@ -95,7 +96,7 @@ module TL1
95
96
  end
96
97
 
97
98
  def scan_record_quoted_string(scanner)
98
- record = String.new
99
+ record = +''
99
100
 
100
101
  scan_characters(scanner) do |char|
101
102
  case char
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module TL1
3
4
  # A format for an input message.
4
5
  class InputFormat
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module TL1
3
4
  # A format for records appearing in output messages.
4
5
  class OutputFormat
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # rubocop: disable Metrics/ModuleLength
4
3
  module TL1
5
4
  module Platforms
6
5
  module BTI
data/lib/tl1/session.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module TL1
3
4
  # A wrapper around an IO-like object representing a connection to a
4
5
  # TL1-capable network element.
data/lib/tl1/test_io.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module TL1
3
4
  # A simple IO-like object that accepts a hash of string inputs and
4
5
  # corresponding outputs, useful for testing.
data/lib/tl1/version.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Tl1
3
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
4
5
  end
data/lib/tl1.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'tl1/ast'
3
4
  require 'tl1/command'
4
5
  require 'tl1/input_format'
data/tl1.gemspec CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
- lib = File.expand_path('../lib', __FILE__)
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'tl1/version'
5
6
 
@@ -20,7 +21,7 @@ Gem::Specification.new do |spec|
20
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
22
  spec.require_paths = ['lib']
22
23
 
23
- spec.add_development_dependency 'bundler', '~> 1.14'
24
- spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'rake'
25
25
  spec.add_development_dependency 'rspec', '~> 3.0'
26
+ spec.add_development_dependency 'rubocop', '~> 0.54' if RUBY_VERSION > '2.1'
26
27
  end
metadata CHANGED
@@ -1,67 +1,67 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tl1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Miller
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-12 00:00:00.000000000 Z
11
+ date: 2022-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: '0'
20
20
  type: :development
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: '1.14'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: rubocop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '0.54'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
55
- description:
54
+ version: '0.54'
55
+ description:
56
56
  email:
57
57
  - bmiller@rackspace.com
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".github/workflows/ruby.yml"
62
63
  - ".gitignore"
63
64
  - ".rubocop.yml"
64
- - ".travis.yml"
65
65
  - CODE_OF_CONDUCT.md
66
66
  - Gemfile
67
67
  - LICENSE.txt
@@ -83,7 +83,7 @@ homepage: https://github.com/bjmllr/tl1
83
83
  licenses:
84
84
  - GPL-3.0
85
85
  metadata: {}
86
- post_install_message:
86
+ post_install_message:
87
87
  rdoc_options: []
88
88
  require_paths:
89
89
  - lib
@@ -98,9 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubyforge_project:
102
- rubygems_version: 2.6.11
103
- signing_key:
101
+ rubygems_version: 3.3.7
102
+ signing_key:
104
103
  specification_version: 4
105
104
  summary: Define, send, and receive TL1 messages
106
105
  test_files: []
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- - 2.3.4
6
- before_install: gem install bundler -v 1.14.6