From 659d5f3e9b0cd769db0d9254c15c2a4a9c918a8d Mon Sep 17 00:00:00 2001 From: Gabe Date: Thu, 14 Nov 2019 16:57:05 -0700 Subject: [PATCH] Rename library to openscap_results_parser - openscap_parser has a connotation that this library is performing as a SCAP validator, content scanner, and/or check engine. This PR removes that incorrect connotation. --- Dockerfile | 6 ++--- Gemfile | 2 +- README.md | 18 +++++++-------- bin/console | 2 +- lib/openscap_parser.rb | 22 ------------------- lib/openscap_results_parser.rb | 22 +++++++++++++++++++ .../benchmark.rb | 10 ++++----- .../benchmarks.rb | 2 +- .../datastream_file.rb | 4 ++-- .../profile.rb | 0 .../profiles.rb | 2 +- .../rule.rb | 6 ++--- .../rule_identifier.rb | 0 .../rule_reference.rb | 0 .../rule_references.rb | 4 ++-- .../rule_result.rb | 0 .../rule_results.rb | 2 +- .../rules.rb | 2 +- .../tailoring.rb | 0 .../tailoring_file.rb | 0 .../tailorings.rb | 2 +- .../test_result.rb | 2 +- .../test_result_file.rb | 0 .../test_results.rb | 2 +- .../util.rb | 0 .../version.rb | 0 .../xml_file.rb | 2 +- .../xml_node.rb | 0 lib/railtie.rb | 4 ++-- ...gemspec => openscap_results_parser.gemspec | 6 ++--- .../profiles_test.rb | 0 .../test_result_file_test.rb | 0 .../xml_file_test.rb | 0 test/test_helper.rb | 2 +- 34 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 lib/openscap_parser.rb create mode 100644 lib/openscap_results_parser.rb rename lib/{openscap_parser => openscap_results_parser}/benchmark.rb (77%) rename lib/{openscap_parser => openscap_results_parser}/benchmarks.rb (91%) rename lib/{openscap_parser => openscap_results_parser}/datastream_file.rb (79%) rename lib/{openscap_parser => openscap_results_parser}/profile.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/profiles.rb (92%) rename lib/{openscap_parser => openscap_results_parser}/rule.rb (89%) rename lib/{openscap_parser => openscap_results_parser}/rule_identifier.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/rule_reference.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/rule_references.rb (89%) rename lib/{openscap_parser => openscap_results_parser}/rule_result.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/rule_results.rb (89%) rename lib/{openscap_parser => openscap_results_parser}/rules.rb (92%) rename lib/{openscap_parser => openscap_results_parser}/tailoring.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/tailoring_file.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/tailorings.rb (90%) rename lib/{openscap_parser => openscap_results_parser}/test_result.rb (96%) rename lib/{openscap_parser => openscap_results_parser}/test_result_file.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/test_results.rb (88%) rename lib/{openscap_parser => openscap_results_parser}/util.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/version.rb (100%) rename lib/{openscap_parser => openscap_results_parser}/xml_file.rb (80%) rename lib/{openscap_parser => openscap_results_parser}/xml_node.rb (100%) rename openscap_parser.gemspec => openscap_results_parser.gemspec (92%) rename test/{openscap_parser => openscap_results_parser}/profiles_test.rb (100%) rename test/{openscap_parser => openscap_results_parser}/test_result_file_test.rb (100%) rename test/{openscap_parser => openscap_results_parser}/xml_file_test.rb (100%) diff --git a/Dockerfile b/Dockerfile index 286d547..8b60120 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -# docker build . -t openscap_parser # build the container image -# docker run -itv $PWD:/app:z openscap_parser rake # run tests -# docker run -itv $PWD:/app:z openscap_parser pry --gem # console +# docker build . -t openscap_results_parser # build the container image +# docker run -itv $PWD:/app:z openscap_results_parser rake # run tests +# docker run -itv $PWD:/app:z openscap_results_parser pry --gem # console FROM ruby:2.5 diff --git a/Gemfile b/Gemfile index 7c260b2..24836fa 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source "https://rubygems.org" -# Specify your gem's dependencies in openscap_parser.gemspec +# Specify your gem's dependencies in openscap_results_parser.gemspec gemspec diff --git a/README.md b/README.md index b148984..789e8ab 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# OpenscapParser +# Openscap Results Parser -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/openscap_parser`. To experiment with that code, run `bin/console` for an interactive prompt. +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/openscap_results_parser`. To experiment with that code, run `bin/console` for an interactive prompt. ## Installation Add this line to your application's Gemfile: ```ruby -gem 'openscap_parser' +gem 'openscap_results_parser' ``` And then execute: @@ -16,7 +16,7 @@ And then execute: Or install it yourself as: - $ gem install openscap_parser + $ gem install openscap_results_parser ## Usage @@ -58,14 +58,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To A Dockerfile is provided to allow a containerized development environment: ``` -docker build . -t openscap_parser # build the container image -docker run -itv $PWD:/app:z openscap_parser rake # run tests -docker run -itv $PWD:/app:z openscap_parser pry --gem # console +docker build . -t openscap_results_parser # build the container image +docker run -itv $PWD:/app:z openscap_results_parser rake # run tests +docker run -itv $PWD:/app:z openscap_results_parser pry --gem # console ``` ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/elobato/openscap_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on GitHub at https://github.com/elobato/openscap_results_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License @@ -73,4 +73,4 @@ The gem is available as open source under the terms of the [MIT License](https:/ ## Code of Conduct -Everyone interacting in the OpenscapParser project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/elobato/openscap_parser/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the OpenscapParser project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/elobato/openscap_results_parser/blob/master/CODE_OF_CONDUCT.md). diff --git a/bin/console b/bin/console index 87a3e4a..7108e39 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require "bundler/setup" -require "openscap_parser" +require "openscap_results_parser" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. diff --git a/lib/openscap_parser.rb b/lib/openscap_parser.rb deleted file mode 100644 index 63f5c59..0000000 --- a/lib/openscap_parser.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require 'openscap_parser/version' -require 'openscap_parser/util' -require 'openscap_parser/benchmarks' -require 'openscap_parser/test_results' -require 'openscap_parser/profiles' -require 'openscap_parser/rules' -require 'openscap_parser/rule_results' -require 'openscap_parser/tailorings' - -require 'openscap_parser/xml_file' -require 'openscap_parser/datastream_file' -require 'openscap_parser/test_result_file' -require 'openscap_parser/tailoring_file' - -require 'date' -require 'railtie' if defined?(Rails) - -module OpenscapParser - class Error < StandardError; end -end diff --git a/lib/openscap_results_parser.rb b/lib/openscap_results_parser.rb new file mode 100644 index 0000000..262ef48 --- /dev/null +++ b/lib/openscap_results_parser.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'openscap_results_parser/version' +require 'openscap_results_parser/util' +require 'openscap_results_parser/benchmarks' +require 'openscap_results_parser/test_results' +require 'openscap_results_parser/profiles' +require 'openscap_results_parser/rules' +require 'openscap_results_parser/rule_results' +require 'openscap_results_parser/tailorings' + +require 'openscap_results_parser/xml_file' +require 'openscap_results_parser/datastream_file' +require 'openscap_results_parser/test_result_file' +require 'openscap_results_parser/tailoring_file' + +require 'date' +require 'railtie' if defined?(Rails) + +module OpenscapParser + class Error < StandardError; end +end diff --git a/lib/openscap_parser/benchmark.rb b/lib/openscap_results_parser/benchmark.rb similarity index 77% rename from lib/openscap_parser/benchmark.rb rename to lib/openscap_results_parser/benchmark.rb index 42ce033..e0449eb 100644 --- a/lib/openscap_parser/benchmark.rb +++ b/lib/openscap_results_parser/benchmark.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true -require 'openscap_parser/util' -require 'openscap_parser/xml_file' -require 'openscap_parser/rules' -require 'openscap_parser/profiles' -require 'openscap_parser/rule_references' +require 'openscap_results_parser/util' +require 'openscap_results_parser/xml_file' +require 'openscap_results_parser/rules' +require 'openscap_results_parser/profiles' +require 'openscap_results_parser/rule_references' # Mimics openscap-ruby Benchmark interface module OpenscapParser diff --git a/lib/openscap_parser/benchmarks.rb b/lib/openscap_results_parser/benchmarks.rb similarity index 91% rename from lib/openscap_parser/benchmarks.rb rename to lib/openscap_results_parser/benchmarks.rb index 58065c6..0214f1b 100644 --- a/lib/openscap_parser/benchmarks.rb +++ b/lib/openscap_results_parser/benchmarks.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/benchmark' +require 'openscap_results_parser/benchmark' module OpenscapParser # Methods related to saving profiles and finding which hosts diff --git a/lib/openscap_parser/datastream_file.rb b/lib/openscap_results_parser/datastream_file.rb similarity index 79% rename from lib/openscap_parser/datastream_file.rb rename to lib/openscap_results_parser/datastream_file.rb index 8de0f4e..c11b373 100644 --- a/lib/openscap_parser/datastream_file.rb +++ b/lib/openscap_results_parser/datastream_file.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/xml_file' -require 'openscap_parser/benchmarks' +require 'openscap_results_parser/xml_file' +require 'openscap_results_parser/benchmarks' module OpenscapParser # A class to represent a datastream (-ds.xml) XmlFile diff --git a/lib/openscap_parser/profile.rb b/lib/openscap_results_parser/profile.rb similarity index 100% rename from lib/openscap_parser/profile.rb rename to lib/openscap_results_parser/profile.rb diff --git a/lib/openscap_parser/profiles.rb b/lib/openscap_results_parser/profiles.rb similarity index 92% rename from lib/openscap_parser/profiles.rb rename to lib/openscap_results_parser/profiles.rb index bc2084a..daf556a 100644 --- a/lib/openscap_parser/profiles.rb +++ b/lib/openscap_results_parser/profiles.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/profile' +require 'openscap_results_parser/profile' module OpenscapParser # Methods related to saving profiles and finding which hosts diff --git a/lib/openscap_parser/rule.rb b/lib/openscap_results_parser/rule.rb similarity index 89% rename from lib/openscap_parser/rule.rb rename to lib/openscap_results_parser/rule.rb index 719cb51..490efcd 100644 --- a/lib/openscap_parser/rule.rb +++ b/lib/openscap_results_parser/rule.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'openscap_parser/rule_identifier' -require 'openscap_parser/rule_references' -require 'openscap_parser/xml_file' +require 'openscap_results_parser/rule_identifier' +require 'openscap_results_parser/rule_references' +require 'openscap_results_parser/xml_file' # Mimics openscap-ruby Rule interface module OpenscapParser diff --git a/lib/openscap_parser/rule_identifier.rb b/lib/openscap_results_parser/rule_identifier.rb similarity index 100% rename from lib/openscap_parser/rule_identifier.rb rename to lib/openscap_results_parser/rule_identifier.rb diff --git a/lib/openscap_parser/rule_reference.rb b/lib/openscap_results_parser/rule_reference.rb similarity index 100% rename from lib/openscap_parser/rule_reference.rb rename to lib/openscap_results_parser/rule_reference.rb diff --git a/lib/openscap_parser/rule_references.rb b/lib/openscap_results_parser/rule_references.rb similarity index 89% rename from lib/openscap_parser/rule_references.rb rename to lib/openscap_results_parser/rule_references.rb index 2fda4ad..7d2a894 100644 --- a/lib/openscap_parser/rule_references.rb +++ b/lib/openscap_results_parser/rule_references.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'openscap_parser/xml_file' -require 'openscap_parser/rule_reference' +require 'openscap_results_parser/xml_file' +require 'openscap_results_parser/rule_reference' module OpenscapParser # Methods related to finding and saving rule references diff --git a/lib/openscap_parser/rule_result.rb b/lib/openscap_results_parser/rule_result.rb similarity index 100% rename from lib/openscap_parser/rule_result.rb rename to lib/openscap_results_parser/rule_result.rb diff --git a/lib/openscap_parser/rule_results.rb b/lib/openscap_results_parser/rule_results.rb similarity index 89% rename from lib/openscap_parser/rule_results.rb rename to lib/openscap_results_parser/rule_results.rb index b775a9a..64ddece 100644 --- a/lib/openscap_parser/rule_results.rb +++ b/lib/openscap_results_parser/rule_results.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/rule_result' +require 'openscap_results_parser/rule_result' module OpenscapParser module RuleResults diff --git a/lib/openscap_parser/rules.rb b/lib/openscap_results_parser/rules.rb similarity index 92% rename from lib/openscap_parser/rules.rb rename to lib/openscap_results_parser/rules.rb index f91d11b..e1293cb 100644 --- a/lib/openscap_parser/rules.rb +++ b/lib/openscap_results_parser/rules.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/rule' +require 'openscap_results_parser/rule' module OpenscapParser # Methods related to parsing rules diff --git a/lib/openscap_parser/tailoring.rb b/lib/openscap_results_parser/tailoring.rb similarity index 100% rename from lib/openscap_parser/tailoring.rb rename to lib/openscap_results_parser/tailoring.rb diff --git a/lib/openscap_parser/tailoring_file.rb b/lib/openscap_results_parser/tailoring_file.rb similarity index 100% rename from lib/openscap_parser/tailoring_file.rb rename to lib/openscap_results_parser/tailoring_file.rb diff --git a/lib/openscap_parser/tailorings.rb b/lib/openscap_results_parser/tailorings.rb similarity index 90% rename from lib/openscap_parser/tailorings.rb rename to lib/openscap_results_parser/tailorings.rb index 23b7479..ab1f6aa 100644 --- a/lib/openscap_parser/tailorings.rb +++ b/lib/openscap_results_parser/tailorings.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/tailoring' +require 'openscap_results_parser/tailoring' module OpenscapParser # Methods related to parsing Xccdf Tailoring types diff --git a/lib/openscap_parser/test_result.rb b/lib/openscap_results_parser/test_result.rb similarity index 96% rename from lib/openscap_parser/test_result.rb rename to lib/openscap_results_parser/test_result.rb index 789607d..6bcacf6 100644 --- a/lib/openscap_parser/test_result.rb +++ b/lib/openscap_results_parser/test_result.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/rule_results' +require 'openscap_results_parser/rule_results' module OpenscapParser class TestResult < XmlNode diff --git a/lib/openscap_parser/test_result_file.rb b/lib/openscap_results_parser/test_result_file.rb similarity index 100% rename from lib/openscap_parser/test_result_file.rb rename to lib/openscap_results_parser/test_result_file.rb diff --git a/lib/openscap_parser/test_results.rb b/lib/openscap_results_parser/test_results.rb similarity index 88% rename from lib/openscap_parser/test_results.rb rename to lib/openscap_results_parser/test_results.rb index ce01340..eefbb82 100644 --- a/lib/openscap_parser/test_results.rb +++ b/lib/openscap_results_parser/test_results.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'openscap_parser/test_result' +require 'openscap_results_parser/test_result' module OpenscapParser module TestResults diff --git a/lib/openscap_parser/util.rb b/lib/openscap_results_parser/util.rb similarity index 100% rename from lib/openscap_parser/util.rb rename to lib/openscap_results_parser/util.rb diff --git a/lib/openscap_parser/version.rb b/lib/openscap_results_parser/version.rb similarity index 100% rename from lib/openscap_parser/version.rb rename to lib/openscap_results_parser/version.rb diff --git a/lib/openscap_parser/xml_file.rb b/lib/openscap_results_parser/xml_file.rb similarity index 80% rename from lib/openscap_parser/xml_file.rb rename to lib/openscap_results_parser/xml_file.rb index b56b0cf..0ae30c7 100644 --- a/lib/openscap_parser/xml_file.rb +++ b/lib/openscap_results_parser/xml_file.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'nokogiri' -require 'openscap_parser/xml_node' +require 'openscap_results_parser/xml_node' module OpenscapParser class XmlFile < XmlNode diff --git a/lib/openscap_parser/xml_node.rb b/lib/openscap_results_parser/xml_node.rb similarity index 100% rename from lib/openscap_parser/xml_node.rb rename to lib/openscap_results_parser/xml_node.rb diff --git a/lib/railtie.rb b/lib/railtie.rb index 7c077e1..b89383f 100644 --- a/lib/railtie.rb +++ b/lib/railtie.rb @@ -1,10 +1,10 @@ # lib/railtie.rb -require 'openscap_parser' +require 'openscap_results_parser' if defined?(Rails) module OpenscapParser class Railtie < Rails::Railtie - railtie_name :openscap_parser + railtie_name :openscap_results_parser rake_tasks do path = File.expand_path(__dir__) diff --git a/openscap_parser.gemspec b/openscap_results_parser.gemspec similarity index 92% rename from openscap_parser.gemspec rename to openscap_results_parser.gemspec index bdf8374..205b246 100644 --- a/openscap_parser.gemspec +++ b/openscap_results_parser.gemspec @@ -1,17 +1,17 @@ lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "openscap_parser/version" +require "openscap_results_parser/version" Gem::Specification.new do |spec| - spec.name = 'openscap_parser' + spec.name = 'openscap_results_parser' spec.version = OpenscapParser::VERSION spec.authors = ['Daniel Lobato Garcia', 'Andrew Kofink'] spec.email = ['me@daniellobato.me', 'ajkofink@gmail.com'] spec.summary = %q{Parse OpenSCAP content} spec.description = %q{This gem is a Ruby interface into SCAP content. It can parse SCAP datastream files (i.e. ssg-rhel7-ds.xml), scan result files output by oscap eval, and tailoring files.} - spec.homepage = 'https://github.com/dLobatog/openscap_parser' + spec.homepage = 'https://github.com/dLobatog/openscap_results_parser' spec.license = 'MIT' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' diff --git a/test/openscap_parser/profiles_test.rb b/test/openscap_results_parser/profiles_test.rb similarity index 100% rename from test/openscap_parser/profiles_test.rb rename to test/openscap_results_parser/profiles_test.rb diff --git a/test/openscap_parser/test_result_file_test.rb b/test/openscap_results_parser/test_result_file_test.rb similarity index 100% rename from test/openscap_parser/test_result_file_test.rb rename to test/openscap_results_parser/test_result_file_test.rb diff --git a/test/openscap_parser/xml_file_test.rb b/test/openscap_results_parser/xml_file_test.rb similarity index 100% rename from test/openscap_parser/xml_file_test.rb rename to test/openscap_results_parser/xml_file_test.rb diff --git a/test/test_helper.rb b/test/test_helper.rb index bfcc8ab..acfcc5f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,5 +1,5 @@ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) -require "openscap_parser" +require "openscap_results_parser" require 'pathname' require "minitest/autorun"