Skip to content

Commit

Permalink
Different way of excluding spec files
Browse files Browse the repository at this point in the history
Ensures all test related files are not included.
  • Loading branch information
jnunemaker committed May 12, 2017
1 parent 8070516 commit 6888e53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions httparty.gemspec
Expand Up @@ -20,8 +20,11 @@ Gem::Specification.new do |s|
# If this line is removed, all hard partying will cease.
s.post_install_message = "When you HTTParty, you must party hard!"

s.files = `git ls-files | grep -v ^spec`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
all_files = `git ls-files`.split("\n")
test_files = `git ls-files -- {test,spec,features}/*`.split("\n")

This comment has been minimized.

Copy link
@ahorek

ahorek May 12, 2017

Contributor

@jnunemaker - this doesn't work

test_files = `git ls-files -- {test,spec,features}/*`.split("\n")

This comment has been minimized.

Copy link
@jnunemaker

jnunemaker May 12, 2017

Author Owner

Can you elaborate? I tested locally in irb and it seemed to.

This comment has been minimized.

Copy link
@ahorek

ahorek May 12, 2017

Contributor

hmm, it works in a command line, but it doesn't return any results if it's called in ruby like this

`git ls-files -- {test,spec,features}/*`

This comment has been minimized.

Copy link
@ahorek

ahorek May 12, 2017

Contributor

s.files = all_files - test_files
s.test_files = test_files
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.require_paths = ["lib"]
end

0 comments on commit 6888e53

Please sign in to comment.