ruby_header_parser 0.3.0 → 0.4.0
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/.rubocop.yml +4 -0
- data/CHANGELOG.md +11 -1
- data/CONFIG.md +1 -1
- data/config/{default.yml → default.yml.erb} +13 -0
- data/lib/ruby_header_parser/config.rb +2 -1
- data/lib/ruby_header_parser/parser.rb +6 -3
- data/lib/ruby_header_parser/version.rb +1 -1
- data/lib/ruby_header_parser.rb +1 -0
- data/rbs_collection.lock.yaml +14 -10
- data/rbs_collection.yaml +1 -0
- metadata +18 -7
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e5cef74182520ff38bc515d76abc52f29ea72d902560dd94c22d0b6423ca1ac9
         | 
| 4 | 
            +
              data.tar.gz: 7c74a7fd9ba492d8164a29f6361dc134d40c672914608c1916a9b9f10b3ff650
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c88bb6461bf103497439f4f87088a807a52d297470ac056cb3d673a242ab1e9afa572e16e778f15942997d83b138109361c5a85195cde16df17c857440a43e83
         | 
| 7 | 
            +
              data.tar.gz: d199b28a53eddf355fae53a6ebcd9693b6a724c6fb8911990186f8bc050c72b3be185e7bfacd526bf05007ac8b714c96d65df7530bb3cd69dcc8bf872e242d0f
         | 
    
        data/.rubocop.yml
    CHANGED
    
    | @@ -13,6 +13,10 @@ Layout/HashAlignment: | |
| 13 13 | 
             
              EnforcedColonStyle: table
         | 
| 14 14 | 
             
              EnforcedHashRocketStyle: table
         | 
| 15 15 |  | 
| 16 | 
            +
            Layout/LeadingCommentSpace:
         | 
| 17 | 
            +
              AllowRBSInlineAnnotation: true
         | 
| 18 | 
            +
              AllowSteepAnnotation: true
         | 
| 19 | 
            +
             | 
| 16 20 | 
             
            Layout/SpaceAroundOperators:
         | 
| 17 21 | 
             
              Exclude:
         | 
| 18 22 | 
             
                # Suppress line breaks in spec files (e.g `it { should xxxx }`, `its(:method) { should xxxx }` )
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,15 @@ | |
| 1 1 | 
             
            ## [Unreleased]
         | 
| 2 | 
            -
            [full changelog](http://github.com/ruby-go-gem/ruby_header_parser/compare/v0. | 
| 2 | 
            +
            [full changelog](http://github.com/ruby-go-gem/ruby_header_parser/compare/v0.4.0...main)
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            ## [0.4.0](https://github.com/ruby-go-gem/ruby_header_parser/releases/tag/v0.4.0) - 2025-01-07
         | 
| 5 | 
            +
            [full changelog](http://github.com/ruby-go-gem/ruby_header_parser/compare/v0.3.1...v0.4.0)
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            * Exclude removed methods in Ruby 3.4 and support erb config file https://github.com/ruby-go-gem/ruby_header_parser/pull/29
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            ## [0.3.1](https://github.com/ruby-go-gem/ruby_header_parser/releases/tag/v0.3.1) - 2024-12-15
         | 
| 10 | 
            +
            [full changelog](http://github.com/ruby-go-gem/ruby_header_parser/compare/v0.3.0...v0.3.1)
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            * Change arg of `rb_gc_register_address` and `rb_gc_unregister_address` to in_ref https://github.com/ruby-go-gem/ruby_header_parser/pull/24
         | 
| 3 13 |  | 
| 4 14 | 
             
            ## [0.3.0](https://github.com/ruby-go-gem/ruby_header_parser/releases/tag/v0.3.0) - 2024-11-24
         | 
| 5 15 | 
             
            [full changelog](http://github.com/ruby-go-gem/ruby_header_parser/compare/v0.2.0...v0.3.0)
         | 
    
        data/CONFIG.md
    CHANGED
    
    | @@ -45,7 +45,7 @@ enum: | |
| 45 45 | 
             
            ```
         | 
| 46 46 |  | 
| 47 47 | 
             
            ## Full configuration file
         | 
| 48 | 
            -
            [config/default.yml](config/default.yml) is used by https://github.com/ruby-go-gem/go-gem-wrapper to generate bindings for Go.
         | 
| 48 | 
            +
            [config/default.yml.erb](config/default.yml.erb) is used by https://github.com/ruby-go-gem/go-gem-wrapper to generate bindings for Go.
         | 
| 49 49 |  | 
| 50 50 | 
             
            ## `function.include_name`, `struct.include_name`, `type.include_name`, `enum.include_name`
         | 
| 51 51 | 
             
            Return functions and structures that match the condition with a [RubyHeaderParser::Parser](lib/ruby_header_parser/parser.rb)
         | 
| @@ -68,6 +68,15 @@ function: | |
| 68 68 | 
             
                # FIXME: Workaround for "undefined reference to `rb_class_descendants'" on GitHub Actions (Ubuntu 22.04)
         | 
| 69 69 | 
             
                - rb_class_descendants
         | 
| 70 70 |  | 
| 71 | 
            +
                <% if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("3.4.0") %>
         | 
| 72 | 
            +
                # Removed since ruby 3.4+
         | 
| 73 | 
            +
                - rb_data_object_make
         | 
| 74 | 
            +
                - rb_newobj
         | 
| 75 | 
            +
                - rb_newobj_of
         | 
| 76 | 
            +
                - rb_st_init_existing_table_with_size
         | 
| 77 | 
            +
                - rb_st_replace
         | 
| 78 | 
            +
                <% end %>
         | 
| 79 | 
            +
             | 
| 71 80 | 
             
              pointer_hint:
         | 
| 72 81 | 
             
                RSTRING_PTR:
         | 
| 73 82 | 
             
                  self: raw
         | 
| @@ -110,6 +119,10 @@ function: | |
| 110 119 | 
             
                  4: array
         | 
| 111 120 | 
             
                rb_funcallv_public:
         | 
| 112 121 | 
             
                  4: array
         | 
| 122 | 
            +
                rb_gc_register_address:
         | 
| 123 | 
            +
                  1: in_ref
         | 
| 124 | 
            +
                rb_gc_unregister_address:
         | 
| 125 | 
            +
                  1: in_ref
         | 
| 113 126 | 
             
                rb_get_values_at:
         | 
| 114 127 | 
             
                  5: function
         | 
| 115 128 | 
             
                rb_glob:
         | 
| @@ -11,7 +11,8 @@ module RubyHeaderParser | |
| 11 11 | 
             
                #
         | 
| 12 12 | 
             
                # @note See [CONFIG.md](../file.CONFIG.html) for config file details
         | 
| 13 13 | 
             
                def initialize(config_file)
         | 
| 14 | 
            -
                   | 
| 14 | 
            +
                  erb = File.read(config_file)
         | 
| 15 | 
            +
                  yaml = ERB.new(erb).result
         | 
| 15 16 | 
             
                  @data = YAML.safe_load(yaml, aliases: true, permitted_classes: [Regexp])
         | 
| 16 17 | 
             
                end
         | 
| 17 18 |  | 
| @@ -30,7 +30,7 @@ module RubyHeaderParser | |
| 30 30 | 
             
                # @param include_paths [Array<String>]
         | 
| 31 31 | 
             
                # @param dist_preprocessed_header_file [String,nil] Destination path to the output of preprocessed ruby.h.
         | 
| 32 32 | 
             
                #                                      (default: `"#{Dir.tmpdir}/ruby_preprocessed.h"`)
         | 
| 33 | 
            -
                # @param config_file [String,nil] Path to config file (default: `config/default.yml`)
         | 
| 33 | 
            +
                # @param config_file [String,nil] Path to config file (default: `config/default.yml.erb`)
         | 
| 34 34 | 
             
                #
         | 
| 35 35 | 
             
                # @note `dist_preprocessed_header_file` is used as the output destination for temporary files when the parser
         | 
| 36 36 | 
             
                #       is executed
         | 
| @@ -42,7 +42,7 @@ module RubyHeaderParser | |
| 42 42 | 
             
                  @include_paths = include_paths
         | 
| 43 43 | 
             
                  @dist_preprocessed_header_file = dist_preprocessed_header_file || File.join(Dir.tmpdir, "ruby_preprocessed.h")
         | 
| 44 44 |  | 
| 45 | 
            -
                  config_file ||= File.expand_path("../../config/default.yml", __dir__.to_s)
         | 
| 45 | 
            +
                  config_file ||= File.expand_path("../../config/default.yml.erb", __dir__.to_s)
         | 
| 46 46 | 
             
                  @config = Config.new(config_file)
         | 
| 47 47 | 
             
                end
         | 
| 48 48 |  | 
| @@ -93,8 +93,11 @@ module RubyHeaderParser | |
| 93 93 | 
             
                def extract_enum_definitions
         | 
| 94 94 | 
             
                  stdout = execute_ctags("--c-kinds=e --fields=+n")
         | 
| 95 95 |  | 
| 96 | 
            +
                  # Workaround for Ruby::UnannotatedEmptyCollection on steep 1.9.0+
         | 
| 97 | 
            +
                  name_to_definition = {} #: Hash[String, RubyHeaderParser::EnumDefinition]
         | 
| 98 | 
            +
             | 
| 96 99 | 
             
                  name_to_definitions =
         | 
| 97 | 
            -
                    stdout.each_line.with_object( | 
| 100 | 
            +
                    stdout.each_line.with_object(name_to_definition) do |line, hash|
         | 
| 98 101 | 
             
                      parts = line.split("\t")
         | 
| 99 102 |  | 
| 100 103 | 
             
                      enum_name = Util.find_field(parts, "enum")
         | 
    
        data/lib/ruby_header_parser.rb
    CHANGED
    
    
    
        data/rbs_collection.lock.yaml
    CHANGED
    
    | @@ -6,7 +6,7 @@ gems: | |
| 6 6 | 
             
              source:
         | 
| 7 7 | 
             
                type: git
         | 
| 8 8 | 
             
                name: ruby/gem_rbs_collection
         | 
| 9 | 
            -
                revision:  | 
| 9 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 10 10 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 11 11 | 
             
                repo_dir: gems
         | 
| 12 12 | 
             
            - name: binding_of_caller
         | 
| @@ -14,7 +14,7 @@ gems: | |
| 14 14 | 
             
              source:
         | 
| 15 15 | 
             
                type: git
         | 
| 16 16 | 
             
                name: ruby/gem_rbs_collection
         | 
| 17 | 
            -
                revision:  | 
| 17 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 18 18 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 19 19 | 
             
                repo_dir: gems
         | 
| 20 20 | 
             
            - name: dbm
         | 
| @@ -26,9 +26,13 @@ gems: | |
| 26 26 | 
             
              source:
         | 
| 27 27 | 
             
                type: git
         | 
| 28 28 | 
             
                name: ruby/gem_rbs_collection
         | 
| 29 | 
            -
                revision:  | 
| 29 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 30 30 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 31 31 | 
             
                repo_dir: gems
         | 
| 32 | 
            +
            - name: erb
         | 
| 33 | 
            +
              version: '0'
         | 
| 34 | 
            +
              source:
         | 
| 35 | 
            +
                type: stdlib
         | 
| 32 36 | 
             
            - name: fileutils
         | 
| 33 37 | 
             
              version: '0'
         | 
| 34 38 | 
             
              source:
         | 
| @@ -42,7 +46,7 @@ gems: | |
| 42 46 | 
             
              source:
         | 
| 43 47 | 
             
                type: git
         | 
| 44 48 | 
             
                name: ruby/gem_rbs_collection
         | 
| 45 | 
            -
                revision:  | 
| 49 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 46 50 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 47 51 | 
             
                repo_dir: gems
         | 
| 48 52 | 
             
            - name: parser
         | 
| @@ -50,7 +54,7 @@ gems: | |
| 50 54 | 
             
              source:
         | 
| 51 55 | 
             
                type: git
         | 
| 52 56 | 
             
                name: ruby/gem_rbs_collection
         | 
| 53 | 
            -
                revision:  | 
| 57 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 54 58 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 55 59 | 
             
                repo_dir: gems
         | 
| 56 60 | 
             
            - name: pstore
         | 
| @@ -66,7 +70,7 @@ gems: | |
| 66 70 | 
             
              source:
         | 
| 67 71 | 
             
                type: git
         | 
| 68 72 | 
             
                name: ruby/gem_rbs_collection
         | 
| 69 | 
            -
                revision:  | 
| 73 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 70 74 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 71 75 | 
             
                repo_dir: gems
         | 
| 72 76 | 
             
            - name: rake
         | 
| @@ -74,7 +78,7 @@ gems: | |
| 74 78 | 
             
              source:
         | 
| 75 79 | 
             
                type: git
         | 
| 76 80 | 
             
                name: ruby/gem_rbs_collection
         | 
| 77 | 
            -
                revision:  | 
| 81 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 78 82 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 79 83 | 
             
                repo_dir: gems
         | 
| 80 84 | 
             
            - name: regexp_parser
         | 
| @@ -82,7 +86,7 @@ gems: | |
| 82 86 | 
             
              source:
         | 
| 83 87 | 
             
                type: git
         | 
| 84 88 | 
             
                name: ruby/gem_rbs_collection
         | 
| 85 | 
            -
                revision:  | 
| 89 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 86 90 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 87 91 | 
             
                repo_dir: gems
         | 
| 88 92 | 
             
            - name: rspec-parameterized-core
         | 
| @@ -98,7 +102,7 @@ gems: | |
| 98 102 | 
             
              source:
         | 
| 99 103 | 
             
                type: git
         | 
| 100 104 | 
             
                name: ruby/gem_rbs_collection
         | 
| 101 | 
            -
                revision:  | 
| 105 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 102 106 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 103 107 | 
             
                repo_dir: gems
         | 
| 104 108 | 
             
            - name: rubocop-ast
         | 
| @@ -106,7 +110,7 @@ gems: | |
| 106 110 | 
             
              source:
         | 
| 107 111 | 
             
                type: git
         | 
| 108 112 | 
             
                name: ruby/gem_rbs_collection
         | 
| 109 | 
            -
                revision:  | 
| 113 | 
            +
                revision: '09beb2100db10cbf4773ed0e71ddf79280a2f275'
         | 
| 110 114 | 
             
                remote: https://github.com/ruby/gem_rbs_collection.git
         | 
| 111 115 | 
             
                repo_dir: gems
         | 
| 112 116 | 
             
            - name: tmpdir
         | 
    
        data/rbs_collection.yaml
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ruby_header_parser
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.4.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - sue445
         | 
| 8 | 
            -
            autorequire:
         | 
| 9 8 | 
             
            bindir: exe
         | 
| 10 9 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 10 | 
            +
            date: 2025-01-06 00:00:00.000000000 Z
         | 
| 12 11 | 
             
            dependencies:
         | 
| 13 12 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 13 | 
             
              name: rake
         | 
| @@ -24,6 +23,20 @@ dependencies: | |
| 24 23 | 
             
                - - ">="
         | 
| 25 24 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 25 | 
             
                    version: '0'
         | 
| 26 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 27 | 
            +
              name: rbs
         | 
| 28 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 29 | 
            +
                requirements:
         | 
| 30 | 
            +
                - - ">="
         | 
| 31 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 32 | 
            +
                    version: 3.7.0
         | 
| 33 | 
            +
              type: :development
         | 
| 34 | 
            +
              prerelease: false
         | 
| 35 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 36 | 
            +
                requirements:
         | 
| 37 | 
            +
                - - ">="
         | 
| 38 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 39 | 
            +
                    version: 3.7.0
         | 
| 27 40 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 41 | 
             
              name: rspec
         | 
| 29 42 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -152,7 +165,7 @@ files: | |
| 152 165 | 
             
            - README.md
         | 
| 153 166 | 
             
            - Rakefile
         | 
| 154 167 | 
             
            - Steepfile
         | 
| 155 | 
            -
            - config/default.yml
         | 
| 168 | 
            +
            - config/default.yml.erb
         | 
| 156 169 | 
             
            - lib/ruby_header_parser.rb
         | 
| 157 170 | 
             
            - lib/ruby_header_parser/argument_definition.rb
         | 
| 158 171 | 
             
            - lib/ruby_header_parser/config.rb
         | 
| @@ -185,7 +198,6 @@ metadata: | |
| 185 198 | 
             
              changelog_uri: https://github.com/ruby-go-gem/ruby_header_parser/blob/main/CHANGELOG.md
         | 
| 186 199 | 
             
              documentation_uri: https://ruby-go-gem.github.io/ruby_header_parser/
         | 
| 187 200 | 
             
              rubygems_mfa_required: 'true'
         | 
| 188 | 
            -
            post_install_message:
         | 
| 189 201 | 
             
            rdoc_options: []
         | 
| 190 202 | 
             
            require_paths:
         | 
| 191 203 | 
             
            - lib
         | 
| @@ -200,8 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 200 212 | 
             
                - !ruby/object:Gem::Version
         | 
| 201 213 | 
             
                  version: '0'
         | 
| 202 214 | 
             
            requirements: []
         | 
| 203 | 
            -
            rubygems_version: 3. | 
| 204 | 
            -
            signing_key:
         | 
| 215 | 
            +
            rubygems_version: 3.6.2
         | 
| 205 216 | 
             
            specification_version: 4
         | 
| 206 217 | 
             
            summary: Parser for ruby.h
         | 
| 207 218 | 
             
            test_files: []
         |