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

files examples in specification reference have extra spaces #279

Closed
demurgos opened this issue Feb 16, 2021 · 1 comment
Closed

files examples in specification reference have extra spaces #279

demurgos opened this issue Feb 16, 2021 · 1 comment

Comments

@demurgos
Copy link

I was reading the examples for the files field in the specification reference and was confused by the extra spaces:

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rake&#39;</span>
<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">files</span> = <span class="ruby-constant">FileList</span>[<span class="ruby-string">&#39;lib .rb&#39;</span>,
<span class="ruby-string">&#39;bin/*&#39;</span>,
<span class="ruby-string">&#39;[A-Z]*&#39;</span>,
<span class="ruby-string">&#39;test/ *&#39;</span>].<span class="ruby-identifier">to_a</span>
<span class="ruby-comment"># or without Rake...</span>
<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-string">&#39;lib/ *.rb&#39;</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Dir</span>[<span class="ruby-string">&#39;bin/*&#39;</span>]
<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">files</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Dir</span>[<span class="ruby-string">&#39;[A-Z]*&#39;</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Dir</span>[<span class="ruby-string">&#39;test/**/*&#39;</span>]
<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">fn</span><span class="ruby-operator">|</span> <span class="ruby-identifier">fn</span>.<span class="ruby-identifier">include?</span> <span class="ruby-string">&quot;CVS&quot;</span> }
</pre>

Rendered:

require 'rake' 
 spec.files = FileList['lib     .rb', 
                       'bin/*', 
                       '[A-Z]*', 
                       'test/   *'].to_a 
  
 # or without Rake... 
 spec.files = Dir['lib/   *.rb'] + Dir['bin/*'] 
 spec.files += Dir['[A-Z]*'] + Dir['test/**/*'] 
 spec.files.reject! { |fn| fn.include? "CVS" } 
 

These spaces were already present before and removed in 19948c7, but introduced back again in 2ca58b0.

The spaces are an issue themselves, but the fact that this issue was already fixed in the past and then regressed due to a rebuild suggests that it should be fixed somewhere else too in order to fix it once and for all.

@deivid-rodriguez
Copy link
Member

This has been fixed by 9276fa2, which I committed accidentally to the gh-pages branch without going through a PR (oops 😳).

I did check that rebuilding the file does not undo the fix, so it should be fine now 👍.

Thanks for reporting this!

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

No branches or pull requests

2 participants