Skip to content
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

improve lexers/shell.rb #716

Merged
merged 7 commits into from Sep 10, 2019
Merged

improve lexers/shell.rb #716

merged 7 commits into from Sep 10, 2019

Conversation

rindeal
Copy link
Contributor

@rindeal rindeal commented Jul 14, 2017

This patches adds support for Gentoo and Exherbo package build recipes. It also sets proper mime-type to shell files.

@rindeal rindeal closed this Aug 3, 2019
@rindeal rindeal deleted the patch-1 branch August 3, 2019 04:22
@rindeal rindeal restored the patch-1 branch August 3, 2019 04:22
@rindeal rindeal reopened this Sep 9, 2019
@pyrmont pyrmont self-assigned this Sep 9, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Sep 9, 2019

@rindeal Thanks for your work on this! It doesn't look like maintainers have the ability to push code to the relevant branch of your fork so apologies for not being able to make these changes myself.

To get the checks to pass, you need to update the MIME type section of spec/lexers/shell_spec.rb to something like this:

     it 'guesses by mimetype' do
-      assert_guess :mimetype => 'application/x-shellscript'
+      assert_guess :mimetype => 'text/x-sh'
+      assert_guess :mimetype => 'text/x-shellscript'
     end

In addition, if you could update the list of filename globs in lib/rouge/lexers/shell.rb so that it's a bit neater, that'd be great, too. Something like this:

       tag 'shell'
       aliases 'bash', 'zsh', 'ksh', 'sh'
-      filenames '*.sh', '*.bash', '*.zsh', '*.ksh',
-                '.bashrc', '.zshrc', '.kshrc', '.profile', 'APKBUILD', 'PKGBUILD'
+      filenames '*.sh', '*.bash', '*.zsh', '*.ksh', '.bashrc', '.zshrc',
+                '.kshrc', '.profile', 'APKBUILD', 'PKGBUILD', '*.ebuild',
+                '*.eclass', '*.exheres-0', '*.exlib'

Let me know if anything is unclear!

@pyrmont pyrmont added the author-action The PR has been reviewed but action by the author is needed label Sep 9, 2019
Copy link
Contributor

@pyrmont pyrmont left a comment

Choose a reason for hiding this comment

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

Question about the change to the MIME types:

lib/rouge/lexers/shell.rb Show resolved Hide resolved
@pyrmont pyrmont merged commit 3561f49 into rouge-ruby:master Sep 10, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Sep 10, 2019

@rindeal Hey, it took two years but we finally got this one closed! 🎉 Thanks for contributing to Rouge :)

@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label Sep 10, 2019
@rindeal
Copy link
Contributor Author

rindeal commented Sep 10, 2019

Yes, thank you very much.

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

Successfully merging this pull request may close these issues.

None yet

2 participants