-
Notifications
You must be signed in to change notification settings - Fork 741
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
Already initialized constant Rouge::Lexers:Shell::KEYWORDS #296
Comments
Sounds like a use case for Ruby's |
Among others I had replaced these load calls with require relative. I forgot to file a pull request for this. |
@rumpelsepp Thanks. Took your work and made it work for the specs and |
👍 |
This happens in
|
/cc @jneen |
I also have the issue with Jekyll and Kramdown… |
Why did they have the loads in the first place? Also, this is introduced in c8bf4a8 This is an alternative that maintains the diff --git a/lib/rouge/lexers/shell.rb b/lib/rouge/lexers/shell.rb
index 8b7134e..2a7acea 100644
--- a/lib/rouge/lexers/shell.rb
+++ b/lib/rouge/lexers/shell.rb
@@ -17,12 +17,14 @@ module Rouge
text.shebang?(/(ba|z|k)?sh/) ? 1 : 0
end
- KEYWORDS = %w(
+ KEYWORDS = "" unless defined? KEYWORDS
+ KEYWORDS.replace %w(
if fi else while do done for then return function
select continue until esac elif in
).join('|')
- BUILTINS = %w(
+ BUILTINS = "" unless defined? BUILTINS
+ BUILTINS.replace %w(
alias bg bind break builtin caller cd command compgen
complete declare dirs disown echo enable eval exec exit
export false fc fg getopts hash help history jobs kill let |
It winds up loading the same file twice, causing constants to be redefined, which causes warnings to print every time it is run. See rouge-ruby/rouge#296 for more details.
Could this be fixed with a |
Aye, I've dealt with it by disallowing 1.9.1 |
Thanks @JoshCheek I totally did not know we could do what you did in a Gemspec. |
Still getting the issue... during Jekyll generations currently... (on Windows boxes as well -- below). Has @JoshCheek found a workaround? Steps involved?
|
I suspect the loads were used to make the visual test |
Great Ill give it a try, thx. On Thu, Aug 27, 2015, 6:07 PM Stan Hu [email protected] wrote:
|
👍 |
Why is |
Which commit closes this issue please? |
65c69f0. It's fixed as of 1.10.0. |
Thank you! |
Now that GitLab is using Rouge, it appears that Rouge is loading files automatically, causing Rails to warn with errors:
These loads happen twice:
Removing these lines seems to make the warnings go away. Is it possible to remove these automatic loads?
The text was updated successfully, but these errors were encountered: