code-ruby 0.14.3 → 0.14.4
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 +4 -4
 - data/.github/dependabot.yml +12 -12
 - data/.github/workflows/ci.yml +9 -2
 - data/Gemfile.lock +4 -4
 - data/README.md +1 -1
 - data/bin/test +5 -0
 - data/lib/code/object/json.rb +3 -5
 - data/lib/code/version.rb +1 -1
 - data/spec/code_spec.rb +2 -2
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7a52b2959095228434649a676508dbbf549a6a466363ca25b3ce95c1d5a13de9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ad2e7947f6d959923e36cecc48816586575f1caee9bfdbbc2da44ca1de9c284a
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 6516b0072e0958d93bec52c9c43e138298d03a594f606598ca5572ecf2c02f8343f90b8834287c9a1d6651c8cea350791acbb29df9e57c0c0cdad0bb1e71e06d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d9ae4f2cca4194d68215c547d632bc21ac64a99d968d511e502a8efce7a6b435dfb2e7d877e3e431ed0320ccca256729121aee6805352588414d29544cc9f094
         
     | 
    
        data/.github/dependabot.yml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            version: 2
         
     | 
| 
       3 
3 
     | 
    
         
             
            updates:
         
     | 
| 
       4 
     | 
    
         
            -
            - directory: "/"
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            - directory: "/"
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
            - directory: "/"
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
      
 4 
     | 
    
         
            +
              - directory: "/"
         
     | 
| 
      
 5 
     | 
    
         
            +
                package-ecosystem: github-actions
         
     | 
| 
      
 6 
     | 
    
         
            +
                schedule:
         
     | 
| 
      
 7 
     | 
    
         
            +
                  interval: daily
         
     | 
| 
      
 8 
     | 
    
         
            +
              - directory: "/"
         
     | 
| 
      
 9 
     | 
    
         
            +
                package-ecosystem: npm
         
     | 
| 
      
 10 
     | 
    
         
            +
                schedule:
         
     | 
| 
      
 11 
     | 
    
         
            +
                  interval: daily
         
     | 
| 
      
 12 
     | 
    
         
            +
              - directory: "/"
         
     | 
| 
      
 13 
     | 
    
         
            +
                package-ecosystem: bundler
         
     | 
| 
      
 14 
     | 
    
         
            +
                schedule:
         
     | 
| 
      
 15 
     | 
    
         
            +
                  interval: daily
         
     | 
    
        data/.github/workflows/ci.yml
    CHANGED
    
    | 
         @@ -11,7 +11,7 @@ jobs: 
     | 
|
| 
       11 
11 
     | 
    
         
             
                      bundler-cache: true
         
     | 
| 
       12 
12 
     | 
    
         
             
                  - run: bin/bundler-audit check --update
         
     | 
| 
       13 
13 
     | 
    
         
             
              rspec:
         
     | 
| 
       14 
     | 
    
         
            -
                name:  
     | 
| 
      
 14 
     | 
    
         
            +
                name: Test
         
     | 
| 
       15 
15 
     | 
    
         
             
                runs-on: ubuntu-latest
         
     | 
| 
       16 
16 
     | 
    
         
             
                steps:
         
     | 
| 
       17 
17 
     | 
    
         
             
                  - uses: actions/checkout@v4
         
     | 
| 
         @@ -19,7 +19,7 @@ jobs: 
     | 
|
| 
       19 
19 
     | 
    
         
             
                    with:
         
     | 
| 
       20 
20 
     | 
    
         
             
                      ruby-version: 3.3.0
         
     | 
| 
       21 
21 
     | 
    
         
             
                      bundler-cache: true
         
     | 
| 
       22 
     | 
    
         
            -
                  - run: bin/ 
     | 
| 
      
 22 
     | 
    
         
            +
                  - run: bin/test
         
     | 
| 
       23 
23 
     | 
    
         
             
              rubocop:
         
     | 
| 
       24 
24 
     | 
    
         
             
                name: Rubocop
         
     | 
| 
       25 
25 
     | 
    
         
             
                runs-on: ubuntu-latest
         
     | 
| 
         @@ -29,3 +29,10 @@ jobs: 
     | 
|
| 
       29 
29 
     | 
    
         
             
                    with:
         
     | 
| 
       30 
30 
     | 
    
         
             
                      bundler-cache: true
         
     | 
| 
       31 
31 
     | 
    
         
             
                  - run: bin/rubocop
         
     | 
| 
      
 32 
     | 
    
         
            +
              yarn-audit:
         
     | 
| 
      
 33 
     | 
    
         
            +
                name: Yarn Audit
         
     | 
| 
      
 34 
     | 
    
         
            +
                runs-on: ubuntu-latest
         
     | 
| 
      
 35 
     | 
    
         
            +
                steps:
         
     | 
| 
      
 36 
     | 
    
         
            +
                  - uses: actions/checkout@v4
         
     | 
| 
      
 37 
     | 
    
         
            +
                  - uses: actions/setup-node@v4
         
     | 
| 
      
 38 
     | 
    
         
            +
                  - run: yarn audit
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                code-ruby (0.14. 
     | 
| 
      
 4 
     | 
    
         
            +
                code-ruby (0.14.4)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  activesupport (~> 7)
         
     | 
| 
       6 
6 
     | 
    
         
             
                  bigdecimal (~> 3)
         
     | 
| 
       7 
7 
     | 
    
         
             
                  did-you-mean (~> 0)
         
     | 
| 
         @@ -82,10 +82,10 @@ GEM 
     | 
|
| 
       82 
82 
     | 
    
         
             
                rubocop-minitest (0.35.0)
         
     | 
| 
       83 
83 
     | 
    
         
             
                  rubocop (>= 1.61, < 2.0)
         
     | 
| 
       84 
84 
     | 
    
         
             
                  rubocop-ast (>= 1.31.1, < 2.0)
         
     | 
| 
       85 
     | 
    
         
            -
                rubocop-performance (1. 
     | 
| 
      
 85 
     | 
    
         
            +
                rubocop-performance (1.21.0)
         
     | 
| 
       86 
86 
     | 
    
         
             
                  rubocop (>= 1.48.1, < 2.0)
         
     | 
| 
       87 
     | 
    
         
            -
                  rubocop-ast (>= 1. 
     | 
| 
       88 
     | 
    
         
            -
                rubocop-rails (2.24. 
     | 
| 
      
 87 
     | 
    
         
            +
                  rubocop-ast (>= 1.31.1, < 2.0)
         
     | 
| 
      
 88 
     | 
    
         
            +
                rubocop-rails (2.24.1)
         
     | 
| 
       89 
89 
     | 
    
         
             
                  activesupport (>= 4.2.0)
         
     | 
| 
       90 
90 
     | 
    
         
             
                  rack (>= 1.1)
         
     | 
| 
       91 
91 
     | 
    
         
             
                  rubocop (>= 1.33.0, < 2.0)
         
     | 
    
        data/README.md
    CHANGED
    
    
    
        data/lib/code/object/json.rb
    CHANGED
    
    | 
         @@ -8,11 +8,9 @@ class Code 
     | 
|
| 
       8 
8 
     | 
    
         
             
                      json
         
     | 
| 
       9 
9 
     | 
    
         
             
                    elsif json.is_a?(::Hash)
         
     | 
| 
       10 
10 
     | 
    
         
             
                      Dictionary.new(
         
     | 
| 
       11 
     | 
    
         
            -
                        json 
     | 
| 
       12 
     | 
    
         
            -
                          Json.to_code(key)
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
                          Json.to_code(value)
         
     | 
| 
       15 
     | 
    
         
            -
                        end
         
     | 
| 
      
 11 
     | 
    
         
            +
                        json
         
     | 
| 
      
 12 
     | 
    
         
            +
                          .transform_keys { |key| Json.to_code(key) }
         
     | 
| 
      
 13 
     | 
    
         
            +
                          .transform_values { |value| Json.to_code(value) }
         
     | 
| 
       16 
14 
     | 
    
         
             
                      )
         
     | 
| 
       17 
15 
     | 
    
         
             
                    elsif json.is_a?(::Array)
         
     | 
| 
       18 
16 
     | 
    
         
             
                      List.new(json.map { |element| Json.to_code(element) })
         
     | 
    
        data/lib/code/version.rb
    CHANGED
    
    
    
        data/spec/code_spec.rb
    CHANGED
    
    | 
         @@ -273,10 +273,10 @@ RSpec.describe Code do 
     | 
|
| 
       273 
273 
     | 
    
         
             
                %w[1.1.to_json '"1.1"'],
         
     | 
| 
       274 
274 
     | 
    
         
             
                ["a = {} a.merge!(a: 1) a", "{a: 1}"],
         
     | 
| 
       275 
275 
     | 
    
         
             
                ["a = {} a.merge(a: 1) a", "{}"],
         
     | 
| 
       276 
     | 
    
         
            -
                [ 
     | 
| 
      
 276 
     | 
    
         
            +
                %w[1&.even? false],
         
     | 
| 
       277 
277 
     | 
    
         
             
                ["nothing&.even? || 1", "1"],
         
     | 
| 
       278 
278 
     | 
    
         
             
                ["nothing&.even? && 1", "nothing"],
         
     | 
| 
       279 
     | 
    
         
            -
                [ 
     | 
| 
      
 279 
     | 
    
         
            +
                %w[2&.even? true],
         
     | 
| 
       280 
280 
     | 
    
         
             
                ["a = 1 a&.even?", "false"],
         
     | 
| 
       281 
281 
     | 
    
         
             
                ["a = 2 a&.even?", "true"],
         
     | 
| 
       282 
282 
     | 
    
         
             
                ["a = nothing a&.even?", "nothing"],
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: code-ruby
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.14. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.14.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Dorian Marié
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024-03 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-04-03 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activesupport
         
     | 
| 
         @@ -118,6 +118,7 @@ files: 
     | 
|
| 
       118 
118 
     | 
    
         
             
            - bin/console
         
     | 
| 
       119 
119 
     | 
    
         
             
            - bin/rspec
         
     | 
| 
       120 
120 
     | 
    
         
             
            - bin/rubocop
         
     | 
| 
      
 121 
     | 
    
         
            +
            - bin/test
         
     | 
| 
       121 
122 
     | 
    
         
             
            - code-ruby.gemspec
         
     | 
| 
       122 
123 
     | 
    
         
             
            - lib/code-ruby.rb
         
     | 
| 
       123 
124 
     | 
    
         
             
            - lib/code.rb
         
     |