Skip to content

Commit

Permalink
Merge f71a71b into 40e973a
Browse files Browse the repository at this point in the history
  • Loading branch information
e2 committed Dec 15, 2014
2 parents 40e973a + f71a71b commit 59eaa6e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
20 changes: 10 additions & 10 deletions Gemfile
Expand Up @@ -4,20 +4,14 @@ gemspec unless ENV["USE_INSTALLED_GUARD"] == "1"

gem "rake"

group :development, :test do
# This plugin is required in the tests!
gem "guard-rspec", require: false
gem "rspec", ">= 3.0.0", require: false
gem "rubocop", "~> 0.26.1", require: false
gem "guard-rubocop", require: false
gem "guard-cucumber", require: false
gem "aruba", require: false
end

# The development group will not be
# installed on Travis CI.

group :development do

gem "rubocop", "~> 0.26.1", require: false
gem "guard-rubocop", require: false

gem "yard", require: false, platform: :mri
gem "redcarpet", require: false, platform: :mri
gem "guard-ronn", require: false, platform: :mri
Expand All @@ -32,7 +26,13 @@ end
# installed on Travis CI
#
group :test do
# Both guard-rspec and guard-cucumber are used by cucumber features
gem "guard-cucumber", require: false
gem "guard-rspec", require: false

gem "coveralls", require: false
gem "rspec", ">= 3.0.0", require: false
gem "aruba", require: false
end

# Needed for Travis
Expand Down
6 changes: 4 additions & 2 deletions guard.gemspec
Expand Up @@ -23,8 +23,10 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "formatador", ">= 0.2.4"
s.add_runtime_dependency "nenv", "~> 0.1"

s.files = Dir.glob("{bin,images,lib}/**/*") \
+ %w(CHANGELOG.md LICENSE man/guard.1 man/guard.1.html README.md)
s.files = `git ls-files -z`.split("\x0").select do |f|
/^(?:bin|images|lib)\/.*$/ =~ f
end + %w(CHANGELOG.md LICENSE man/guard.1 man/guard.1.html README.md)

s.executable = "guard"
s.require_path = "lib"
end
6 changes: 5 additions & 1 deletion lib/guard/internals/session.rb
Expand Up @@ -80,9 +80,13 @@ def guardfile_scope(scope)
# TODO: create a EvaluatorResult class?
attr_reader :guardfile_group_scope
attr_reader :guardfile_plugin_scope
attr_accessor :guardfile_ignore
attr_accessor :guardfile_ignore_bang

attr_reader :guardfile_ignore
def guardfile_ignore=(ignores)
@guardfile_ignore += Array(ignores).flatten
end

def clearing(on)
@clear = on
end
Expand Down
10 changes: 10 additions & 0 deletions spec/lib/guard/dsl_spec.rb
Expand Up @@ -48,6 +48,16 @@
evaluator.call(contents)
end
end

context "with multiple ignore calls" do
let(:contents) { "ignore(/foo/); ignore(/bar/)" }

it "adds all ignored regexps to the listener" do
expect(session).to receive(:guardfile_ignore=).with([/foo/]).once
expect(session).to receive(:guardfile_ignore=).with([/bar/]).once
evaluator.call(contents)
end
end
end

describe "#ignore!" do
Expand Down
8 changes: 8 additions & 0 deletions spec/lib/guard/internals/session_spec.rb
Expand Up @@ -123,6 +123,14 @@
specify { expect(subject.guardfile_ignore).to eq([/foo/]) }
end

context "when set multiple times from guardfile" do
before do
subject.guardfile_ignore = [/foo/]
subject.guardfile_ignore = [/bar/]
end
specify { expect(subject.guardfile_ignore).to eq([/foo/, /bar/]) }
end

context "when unset" do
specify { expect(subject.guardfile_ignore).to eq([]) }
end
Expand Down

0 comments on commit 59eaa6e

Please sign in to comment.