diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cdc2de3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +name: CI + +on: + - push + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby-version: + - 2.7 + - '3.0' + - 3.1 + - 3.2 + - 3.3 + rails-version: + - '6.0' + - 6.1 + - '7.0' + - 7.1 + - 7.2 + exclude: + - ruby-version: 2.7 + rails-version: 7.1 + - ruby-version: 2.7 + rails-version: 7.2 + - ruby-version: 3.0 + rails-version: 6.0 + - ruby-version: 3.0 + rails-version: 7.1 + - ruby-version: 3.0 + rails-version: 7.2 + - ruby-version: 3.1 + rails-version: 6.0 + - ruby-version: 3.1 + rails-version: 6.1 + - ruby-version: 3.2 + rails-version: 6.0 + - ruby-version: 3.2 + rails-version: 6.1 + - ruby-version: 3.2 + rails-version: 7.0 + - ruby-version: 3.3 + rails-version: 6.0 + - ruby-version: 3.3 + rails-version: 6.1 + - ruby-version: 3.3 + rails-version: 7.0 + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby-version }}" + bundler-cache: true + - run: bundle exec rake diff --git a/Appraisals b/Appraisals index 0e811ee..043e0f9 100644 --- a/Appraisals +++ b/Appraisals @@ -1,19 +1,22 @@ -appraise "rails-5.0" do - gem "activesupport", "~> 5.0.0" +appraise "rails-6.0" do + gem "activesupport", "~> 6.0.0" + gem 'concurrent-ruby', '1.3.4' end -appraise "rails-5.1" do - gem "activesupport", "~> 5.1.0" +appraise "rails-6.1" do + gem "activesupport", "~> 6.1.0" + gem 'concurrent-ruby', '1.3.4' end -appraise "rails-5.2" do - gem "activesupport", "~> 5.2.0" +appraise "rails-7.0" do + gem "activesupport", "~> 7.0.0" + gem 'concurrent-ruby', '1.3.4' end -appraise "rails-6.0" do - gem "activesupport", "~> 6.0.0" +appraise "rails-7.1" do + gem "activesupport", "~> 7.1.0" end -appraise "rails-6.1" do - gem "activesupport", "~> 6.1.0" +appraise "rails-7.2" do + gem "activesupport", "~> 7.2.0" end diff --git a/gemfiles/rails_5.0.gemfile.lock b/gemfiles/rails_5.0.gemfile.lock deleted file mode 100644 index 8d2faa5..0000000 --- a/gemfiles/rails_5.0.gemfile.lock +++ /dev/null @@ -1,69 +0,0 @@ -PATH - remote: .. - specs: - qbxml (0.4.0) - activesupport (>= 5.0.0) - builder (~> 3.0) - nokogiri (~> 1.5) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (5.0.7.2) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - appraisal (2.3.0) - bundler - rake - thor (>= 0.14.0) - builder (3.2.4) - coderay (1.1.3) - concurrent-ruby (1.1.7) - diff-lcs (1.4.4) - i18n (1.8.5) - concurrent-ruby (~> 1.0) - method_source (0.9.2) - mini_portile2 (2.4.0) - minitest (5.14.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-nav (0.3.0) - pry (>= 0.9.10, < 0.13.0) - rake (13.0.1) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.0) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.8) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activesupport (~> 5.0.0) - appraisal - pry - pry-nav - qbxml! - rake - rspec - -BUNDLED WITH - 2.1.4 diff --git a/gemfiles/rails_5.1.gemfile.lock b/gemfiles/rails_5.1.gemfile.lock deleted file mode 100644 index 3e74d53..0000000 --- a/gemfiles/rails_5.1.gemfile.lock +++ /dev/null @@ -1,69 +0,0 @@ -PATH - remote: .. - specs: - qbxml (0.4.0) - activesupport (>= 5.0.0) - builder (~> 3.0) - nokogiri (~> 1.5) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (5.1.7) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - appraisal (2.3.0) - bundler - rake - thor (>= 0.14.0) - builder (3.2.4) - coderay (1.1.3) - concurrent-ruby (1.1.7) - diff-lcs (1.4.4) - i18n (1.8.5) - concurrent-ruby (~> 1.0) - method_source (0.9.2) - mini_portile2 (2.4.0) - minitest (5.14.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-nav (0.3.0) - pry (>= 0.9.10, < 0.13.0) - rake (13.0.1) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.0) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.8) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activesupport (~> 5.1.0) - appraisal - pry - pry-nav - qbxml! - rake - rspec - -BUNDLED WITH - 2.1.4 diff --git a/gemfiles/rails_5.2.gemfile.lock b/gemfiles/rails_5.2.gemfile.lock deleted file mode 100644 index 86428f8..0000000 --- a/gemfiles/rails_5.2.gemfile.lock +++ /dev/null @@ -1,69 +0,0 @@ -PATH - remote: .. - specs: - qbxml (0.4.0) - activesupport (>= 5.0.0) - builder (~> 3.0) - nokogiri (~> 1.5) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (5.2.4.4) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - appraisal (2.3.0) - bundler - rake - thor (>= 0.14.0) - builder (3.2.4) - coderay (1.1.3) - concurrent-ruby (1.1.7) - diff-lcs (1.4.4) - i18n (1.8.5) - concurrent-ruby (~> 1.0) - method_source (0.9.2) - mini_portile2 (2.4.0) - minitest (5.14.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-nav (0.3.0) - pry (>= 0.9.10, < 0.13.0) - rake (13.0.1) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.0) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.8) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activesupport (~> 5.2.0) - appraisal - pry - pry-nav - qbxml! - rake - rspec - -BUNDLED WITH - 2.1.4 diff --git a/gemfiles/rails_6.0.gemfile b/gemfiles/rails_6.0.gemfile index c6e3091..cac0fde 100644 --- a/gemfiles/rails_6.0.gemfile +++ b/gemfiles/rails_6.0.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "activesupport", "~> 6.0.0" +gem "concurrent-ruby", "1.3.4" gemspec path: "../" diff --git a/gemfiles/rails_6.0.gemfile.lock b/gemfiles/rails_6.0.gemfile.lock index 128e653..b01c8f5 100644 --- a/gemfiles/rails_6.0.gemfile.lock +++ b/gemfiles/rails_6.0.gemfile.lock @@ -1,8 +1,9 @@ PATH remote: .. specs: - qbxml (0.4.0) - activesupport (>= 5.0.0) + qbxml (0.5.0) + activesupport (>= 6.0.0) + bigdecimal builder (~> 3.0) nokogiri (~> 1.5) @@ -19,36 +20,25 @@ GEM bundler rake thor (>= 0.14.0) - builder (3.2.4) + bigdecimal (3.2.1) + builder (3.3.0) coderay (1.1.3) - concurrent-ruby (1.1.7) - diff-lcs (1.4.4) + concurrent-ruby (1.3.4) i18n (1.8.5) concurrent-ruby (~> 1.0) method_source (0.9.2) - mini_portile2 (2.4.0) + mini_portile2 (2.8.9) minitest (5.14.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) + nokogiri (1.15.7) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-nav (0.3.0) pry (>= 0.9.10, < 0.13.0) + racc (1.8.1) rake (13.0.1) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.0) thor (1.0.1) thread_safe (0.3.6) tzinfo (1.2.8) @@ -61,11 +51,11 @@ PLATFORMS DEPENDENCIES activesupport (~> 6.0.0) appraisal + concurrent-ruby (= 1.3.4) pry pry-nav qbxml! rake - rspec BUNDLED WITH 2.1.4 diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile index 116012a..366d5df 100644 --- a/gemfiles/rails_6.1.gemfile +++ b/gemfiles/rails_6.1.gemfile @@ -3,5 +3,6 @@ source "https://rubygems.org" gem "activesupport", "~> 6.1.0" +gem "concurrent-ruby", "1.3.4" gemspec path: "../" diff --git a/gemfiles/rails_6.1.gemfile.lock b/gemfiles/rails_6.1.gemfile.lock index b11bdaa..033944c 100644 --- a/gemfiles/rails_6.1.gemfile.lock +++ b/gemfiles/rails_6.1.gemfile.lock @@ -1,8 +1,9 @@ PATH remote: .. specs: - qbxml (0.4.0) - activesupport (>= 5.0.0) + qbxml (0.5.0) + activesupport (>= 6.0.0) + bigdecimal builder (~> 3.0) nokogiri (~> 1.5) @@ -19,52 +20,39 @@ GEM bundler rake thor (>= 0.14.0) + bigdecimal (3.2.1) builder (3.2.4) coderay (1.1.3) - concurrent-ruby (1.1.7) - diff-lcs (1.4.4) + concurrent-ruby (1.3.4) i18n (1.8.5) concurrent-ruby (~> 1.0) method_source (0.9.2) - mini_portile2 (2.4.0) minitest (5.14.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) + nokogiri (1.15.7-x86_64-linux) + racc (~> 1.4) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-nav (0.3.0) pry (>= 0.9.10, < 0.13.0) + racc (1.8.1) rake (13.0.1) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.0) thor (1.0.1) tzinfo (2.0.3) concurrent-ruby (~> 1.0) zeitwerk (2.4.2) PLATFORMS - ruby + x86_64-linux DEPENDENCIES activesupport (~> 6.1.0) appraisal + concurrent-ruby (= 1.3.4) pry pry-nav qbxml! rake - rspec BUNDLED WITH - 2.1.4 + 2.3.27 diff --git a/gemfiles/rails_5.1.gemfile b/gemfiles/rails_7.0.gemfile similarity index 59% rename from gemfiles/rails_5.1.gemfile rename to gemfiles/rails_7.0.gemfile index a218404..70ce46c 100644 --- a/gemfiles/rails_5.1.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -2,6 +2,7 @@ source "https://rubygems.org" -gem "activesupport", "~> 5.1.0" +gem "activesupport", "~> 7.0.0" +gem "concurrent-ruby", "1.3.4" gemspec path: "../" diff --git a/gemfiles/rails_7.0.gemfile.lock b/gemfiles/rails_7.0.gemfile.lock new file mode 100644 index 0000000..7f042a4 --- /dev/null +++ b/gemfiles/rails_7.0.gemfile.lock @@ -0,0 +1,56 @@ +PATH + remote: .. + specs: + qbxml (0.5.0) + activesupport (>= 6.0.0) + bigdecimal + builder (~> 3.0) + nokogiri (~> 1.5) + +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.0.8.7) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + bigdecimal (3.2.1) + builder (3.3.0) + coderay (1.1.3) + concurrent-ruby (1.3.4) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + method_source (1.1.0) + minitest (5.25.5) + nokogiri (1.15.7-x86_64-linux) + racc (~> 1.4) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-nav (1.0.0) + pry (>= 0.9.10, < 0.15) + racc (1.8.1) + rake (13.3.0) + thor (1.3.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + activesupport (~> 7.0.0) + appraisal + concurrent-ruby (= 1.3.4) + pry + pry-nav + qbxml! + rake + +BUNDLED WITH + 2.3.27 diff --git a/gemfiles/rails_5.0.gemfile b/gemfiles/rails_7.1.gemfile similarity index 74% rename from gemfiles/rails_5.0.gemfile rename to gemfiles/rails_7.1.gemfile index df19fea..802ac8e 100644 --- a/gemfiles/rails_5.0.gemfile +++ b/gemfiles/rails_7.1.gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" -gem "activesupport", "~> 5.0.0" +gem "activesupport", "~> 7.1.0" gemspec path: "../" diff --git a/gemfiles/rails_7.1.gemfile.lock b/gemfiles/rails_7.1.gemfile.lock new file mode 100644 index 0000000..7d6aab6 --- /dev/null +++ b/gemfiles/rails_7.1.gemfile.lock @@ -0,0 +1,72 @@ +PATH + remote: .. + specs: + qbxml (0.5.0) + activesupport (>= 6.0.0) + bigdecimal + builder (~> 3.0) + nokogiri (~> 1.5) + +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.1.5.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.2.1) + builder (3.3.0) + coderay (1.1.3) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) + drb (2.2.3) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + logger (1.7.0) + method_source (1.1.0) + mini_portile2 (2.8.9) + minitest (5.25.5) + mutex_m (0.3.0) + nokogiri (1.17.2) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-nav (1.0.0) + pry (>= 0.9.10, < 0.15) + racc (1.8.1) + rake (13.3.0) + securerandom (0.3.2) + thor (1.3.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + ruby + +DEPENDENCIES + activesupport (~> 7.1.0) + appraisal + pry + pry-nav + qbxml! + rake + +BUNDLED WITH + 2.3.27 diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_7.2.gemfile similarity index 74% rename from gemfiles/rails_5.2.gemfile rename to gemfiles/rails_7.2.gemfile index 61c3cca..7debc90 100644 --- a/gemfiles/rails_5.2.gemfile +++ b/gemfiles/rails_7.2.gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" -gem "activesupport", "~> 5.2.0" +gem "activesupport", "~> 7.2.0" gemspec path: "../" diff --git a/gemfiles/rails_7.2.gemfile.lock b/gemfiles/rails_7.2.gemfile.lock new file mode 100644 index 0000000..ab08c95 --- /dev/null +++ b/gemfiles/rails_7.2.gemfile.lock @@ -0,0 +1,68 @@ +PATH + remote: .. + specs: + qbxml (0.5.0) + activesupport (>= 6.0.0) + bigdecimal + builder (~> 3.0) + nokogiri (~> 1.5) + +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.2.1) + builder (3.3.0) + coderay (1.1.3) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) + drb (2.2.3) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + logger (1.7.0) + method_source (1.1.0) + minitest (5.25.5) + nokogiri (1.18.8-x86_64-linux-gnu) + racc (~> 1.4) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-nav (1.0.0) + pry (>= 0.9.10, < 0.15) + racc (1.8.1) + rake (13.3.0) + securerandom (0.4.1) + thor (1.3.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + activesupport (~> 7.2.0) + appraisal + pry + pry-nav + qbxml! + rake + +BUNDLED WITH + 2.6.9 diff --git a/lib/qbxml.rb b/lib/qbxml.rb index 1974cf4..ab4206e 100644 --- a/lib/qbxml.rb +++ b/lib/qbxml.rb @@ -1,8 +1,10 @@ require "qbxml/version" require 'nokogiri' +require 'active_support' require 'active_support/builder' require 'active_support/core_ext/string' +require 'active_support/core_ext/object/blank.rb' class Qbxml; end diff --git a/lib/qbxml/hash.rb b/lib/qbxml/hash.rb index dfe8cf7..900f42f 100644 --- a/lib/qbxml/hash.rb +++ b/lib/qbxml/hash.rb @@ -4,6 +4,7 @@ # https://github.com/rails/rails/blob/master/activesupport/lib/active_support/xml_mini/nokogiri.rb # # + class Qbxml::Hash < ::Hash include Qbxml::Types diff --git a/lib/qbxml/types.rb b/lib/qbxml/types.rb index aa13339..6843c56 100644 --- a/lib/qbxml/types.rb +++ b/lib/qbxml/types.rb @@ -1,3 +1,5 @@ +require 'bigdecimal' + module Qbxml::Types XML_DIRECTIVES = { diff --git a/qbxml.gemspec b/qbxml.gemspec index b28070e..5890008 100644 --- a/qbxml.gemspec +++ b/qbxml.gemspec @@ -17,9 +17,10 @@ Gem::Specification.new do |gem| gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] - gem.add_dependency('activesupport', '>= 5.0.0') + gem.add_dependency('activesupport', '>= 6.0.0') gem.add_dependency('nokogiri', '~> 1.5') gem.add_dependency('builder', '~> 3.0') + gem.add_dependency('bigdecimal') gem.add_development_dependency('pry') gem.add_development_dependency('pry-nav')