Skip to content

Improve how gemspec's files are defined #1212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2024
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Nov 22, 2024

Currently, the gemspec's files are defined by hand, which is error-prone.

For example: #1211

This commit uses Dir.glob where possible to reduce the risk of that happening again.

  • Additional files added with this approach:

    # This should have been added by only captured by this commit
    lib/rdoc/parser/prism_ruby.rb
    
    # These are folders and can be included/ignored either way
    # gems using Dir.glob in gemspec usually have them included
    lib/rdoc/generator/template/darkfish
    lib/rdoc/generator/template/darkfish/css
    lib/rdoc/generator/template/darkfish/fonts
    lib/rdoc/generator/template/darkfish/images
    lib/rdoc/generator/template/darkfish/js
    lib/rdoc/generator/template/json_index
    lib/rdoc/generator/template/json_index/js
    
  • Files that are ignored after this change:

    # They make no difference on documentation generation
    # Probably can be removed
    lib/rdoc/generator/template/darkfish/.document
    lib/rdoc/generator/template/json_index/.document
    

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Spelling.)

@st0012 st0012 force-pushed the improve-gemspec-files branch from b83411c to fdc321b Compare November 22, 2024 21:58
@st0012
Copy link
Member Author

st0012 commented Nov 22, 2024

@olleolleolle Thanks, updated 👍

@st0012 st0012 added the bug label Nov 22, 2024
@st0012 st0012 force-pushed the improve-gemspec-files branch from fdc321b to 487e121 Compare November 23, 2024 10:54
@st0012 st0012 requested a review from nobu November 23, 2024 10:55
@colby-swandale
Copy link
Member

@hsbt Does this Pull Request impact any processes used for ruby-src?

@st0012
Copy link
Member Author

st0012 commented Nov 27, 2024

@colby-swandale If you're talking about sync_default_gems, it won't be affected because it doesn't rely on the files gemspec defines.

Currently, the gemspec's files are defined by hand, which is error-prone.

For example: #1211

This commit uses `Dir.glob` where possible to reduce the risk of that
happening again.

- Additional files added with this approach:

    ```
    # This should have been added by only captured by this commit
    lib/rdoc/parser/prism_ruby.rb

    # These are folders and can be included/ignored either way
    lib/rdoc/generator/template/darkfish
    lib/rdoc/generator/template/darkfish/css
    lib/rdoc/generator/template/darkfish/fonts
    lib/rdoc/generator/template/darkfish/images
    lib/rdoc/generator/template/darkfish/js
    lib/rdoc/generator/template/json_index
    lib/rdoc/generator/template/json_index/js
    ```

- Files that are ignored after this change:

    ```
    # They make no difference on documentation generation
    # Probably can be removed
    lib/rdoc/generator/template/darkfish/.document
    lib/rdoc/generator/template/json_index/.document
    ```
@st0012 st0012 force-pushed the improve-gemspec-files branch from 487e121 to b80dc95 Compare November 27, 2024 16:46
@hsbt
Copy link
Member

hsbt commented Nov 28, 2024

I don't like Dir.glob in gemspec because it caused accidentally publishing debug, garbage code.

But we can use trusted publisher now, it provides clean build and publish environments for us. I'm okay to this change.

@colby-swandale
Copy link
Member

:shipit:

@st0012 st0012 merged commit ac2a151 into master Nov 28, 2024
51 checks passed
@st0012 st0012 deleted the improve-gemspec-files branch November 28, 2024 12:18
matzbot pushed a commit to ruby/ruby that referenced this pull request Nov 28, 2024
(ruby/rdoc#1212)

Currently, the gemspec's files are defined by hand, which is error-prone.

For example: ruby/rdoc#1211

This commit uses `Dir.glob` where possible to reduce the risk of that
happening again.

- Additional files added with this approach:

    ```
    # This should have been added by only captured by this commit
    lib/rdoc/parser/prism_ruby.rb

    # These are folders and can be included/ignored either way
    lib/rdoc/generator/template/darkfish
    lib/rdoc/generator/template/darkfish/css
    lib/rdoc/generator/template/darkfish/fonts
    lib/rdoc/generator/template/darkfish/images
    lib/rdoc/generator/template/darkfish/js
    lib/rdoc/generator/template/json_index
    lib/rdoc/generator/template/json_index/js
    ```

- Files that are ignored after this change:

    ```
    # They make no difference on documentation generation
    # Probably can be removed
    lib/rdoc/generator/template/darkfish/.document
    lib/rdoc/generator/template/json_index/.document
    ```

ruby/rdoc@ac2a151f10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants