rouge icon indicating copy to clipboard operation
rouge copied to clipboard

Reduce Ruby warnings further

Open pyrmont opened this issue 6 years ago • 11 comments

This commit reduces to zero all warnings generated internally by Rouge when Ruby is run with warnings enabled.

pyrmont avatar Jun 26 '19 20:06 pyrmont

Wow!! This is AWESOME, @pyrmont !! :clap: :clap: Just one thought though: "Is there a way that instance_eval(File.read(File.join(__dir__, <keyword-source>))) could be converted into a method and work as it does currently..?"

ashmaroli avatar Jun 26 '19 21:06 ashmaroli

@ashmaroli Thanks :) You and @pocke made it a lot easier by clearing up almost all the regular expression warnings.

"Is there a way that instance_eval(File.read(File.join(__dir__, <keyword-source>))) could be converted into a method and work as it does currently..?"

I'm not sure I follow. instance_eval is a method and each call is wrapped in a memoised method. Could you explain in a bit more detail what you meant?

pyrmont avatar Jun 26 '19 21:06 pyrmont

Could you explain in a bit more detail what you meant?

I was thinking of something along the following lines:

module Rouge
  def self.get_kewords(source)
    instance_eval(File.read(File.join(__dir__, source)))
  end
end
class FooLexer < Rouge::RegexLexer
  def self.keywords
    @keywords ||= Rouge.get_keywords('foo/keywords.rb")
  end
end

But nevermind.., I tested it. Won't work..!!

ashmaroli avatar Jun 26 '19 21:06 ashmaroli

@pyrmont Can you push the correction to the profiler_memory task separately to master and then update this branch..? The reason I ask is comparing the memory usage on master and this PR isn't giving concrete results..

ashmaroli avatar Jul 02 '19 09:07 ashmaroli

@ashmaroli So submit a separate PR, merge the PR and then update this branch against master? The last strep shouldn't be necessary, right? This PR already incorporates the change.

pyrmont avatar Jul 02 '19 09:07 pyrmont

You don't have to submit a PR. You can push the fix directly, can't you? This branch should be updated after wards so that a new build is triggered on Travis

ashmaroli avatar Jul 02 '19 09:07 ashmaroli

@ashmaroli I can push directly to master but for documentary purposes have avoided doing this. Thanks for submitting #1243 :)

pyrmont avatar Jul 03 '19 03:07 pyrmont

Conflicts galore on this branch..

ashmaroli avatar Aug 05 '19 06:08 ashmaroli

MathWorks have made it so that the webpage with the MatLab functions requires JavaScript… >_<

pyrmont avatar Aug 09 '19 17:08 pyrmont

This is dependent on PR #1300.

pyrmont avatar Aug 10 '19 00:08 pyrmont

The dependency PR has been merged, so I think this can now move forward.

I can help with the rebase, but I don't think I can update this PR. Meanwhile, I'll add some review notes.

hugopeixoto avatar Sep 07 '20 13:09 hugopeixoto