1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Add simple Guardfile

This commit is contained in:
Ryan Fitzgerald 2012-09-08 20:27:41 -07:00
parent e7d350b47d
commit 981f12ddc2
4 changed files with 58 additions and 2 deletions

View file

@ -1,2 +1,10 @@
source :rubygems
gemspec
# For Guard
case RUBY_PLATFORM
when /linux/i
gem 'rb-inotify'
when /darwin/i
gem 'rb-fsevent'
end

44
Guardfile Normal file
View file

@ -0,0 +1,44 @@
require 'guard/guard'
module ::Guard
class Bacon < Guard
def run_all
system "bundle exec bacon -Itest -q -a"
puts
true
end
def run_spec(path)
if File.exists?(path)
system "bundle exec bacon -Itest -q #{path}"
puts
end
end
def file_changed(path)
run_spec(path)
end
def run_on_changes(paths)
paths.delete(:all)
paths.each do |path|
file_changed(path)
end
run_all
end
end
end
guard 'bacon' do
# Example of mapping a lib file to one or more test files
watch('lib/pry/indent.rb') { 'test/test_indent.rb' }
# If no such mapping exists, just run all of them
watch(%r{^lib/}) { :all }
# If we modified one test file, run it
watch(%r{^test.*/test_.+\.rb$})
end

View file

@ -24,7 +24,8 @@ def apply_spec_defaults(s)
s.add_dependency('method_source','~> 0.8')
s.add_development_dependency('bacon', '~> 1.1')
s.add_development_dependency('open4', '~> 1.3')
s.add_development_dependency('rake', '~> 0.9')
s.add_development_dependency('rake', '~> 0.9')
s.add_development_dependency('guard', '~> 1.3.2')
# TODO: make this a plain dependency:
s.add_development_dependency('bond', '~> 0.4.2')
end

View file

@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["John Mair (banisterfiend)", "Conrad Irwin", "Ryan Fitzgerald"]
s.date = "2012-09-07"
s.date = "2012-09-08"
s.description = "An IRB alternative and runtime developer console"
s.email = ["jrmair@gmail.com", "conrad.irwin@gmail.com", "rwfitzge@gmail.com"]
s.executables = ["pry"]
@ -27,6 +27,7 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<bacon>, ["~> 1.1"])
s.add_development_dependency(%q<open4>, ["~> 1.3"])
s.add_development_dependency(%q<rake>, ["~> 0.9"])
s.add_development_dependency(%q<guard>, ["~> 1.3.2"])
s.add_development_dependency(%q<bond>, ["~> 0.4.2"])
else
s.add_dependency(%q<coderay>, ["~> 1.0.5"])
@ -35,6 +36,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<bacon>, ["~> 1.1"])
s.add_dependency(%q<open4>, ["~> 1.3"])
s.add_dependency(%q<rake>, ["~> 0.9"])
s.add_dependency(%q<guard>, ["~> 1.3.2"])
s.add_dependency(%q<bond>, ["~> 0.4.2"])
end
else
@ -44,6 +46,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<bacon>, ["~> 1.1"])
s.add_dependency(%q<open4>, ["~> 1.3"])
s.add_dependency(%q<rake>, ["~> 0.9"])
s.add_dependency(%q<guard>, ["~> 1.3.2"])
s.add_dependency(%q<bond>, ["~> 0.4.2"])
end
end