Sha256: 49463d16e1a78444d41cfe3aeb84e694e4ab0ba86dcf8629c3c40e83dd74e880

Contents?: true

Size: 1.01 KB

Versions: 15

Compression:

Stored size: 1.01 KB

Contents

guard "bundler" do
  watch("Gemfile")
end

group :red_green_refactor, :halt_on_fail => true do
  guard "rspec", :cmd => "bundle exec rspec" do
    watch(%r{^spec/.+_spec\.rb$})
    watch(%r{^spec/cassettes/.+.yml$}) { "spec" }
    watch(%r{^lib/(.+)\.rb$}) do |m|
      # Split up the file path into an Array
      path_parts = []
      remaining_path = m[1]
      while File.dirname(remaining_path) != '.'
        remaining_path, file = File.split(remaining_path)
        path_parts << file
      end
      path_parts << remaining_path
      path_parts.reverse!

      # Specs don't contain an oembed subdir
      path_parts.shift
      # Special case for formatter specs
      if path_parts.include?('formatter') && path_parts.include?('backends')
        path_parts.delete('backends')
        path_parts.last.gsub!(/$/, "_backend")
      end
      # Add on the _spec.rb postfix
      path_parts.last.gsub!(/$/, "_spec.rb")

      f = File.join("spec", *path_parts)
      puts "#{m.inspect} => #{f.inspect}"
      f
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
ruby-oembed-0.18.1 Guardfile
ruby-oembed-0.18.0 Guardfile
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/ruby-oembed-0.17.0/Guardfile
ruby-oembed-0.17.0 Guardfile
ruby-oembed-0.16.1 Guardfile
ruby-oembed-0.16.0 Guardfile
ruby-oembed-0.15.0 Guardfile
ruby-oembed-0.14.1 Guardfile
ruby-oembed-0.14.0 Guardfile
ruby-oembed-0.13.1 Guardfile
ruby-oembed-0.13.0 Guardfile
ruby-oembed-0.12.0 Guardfile
ruby-oembed-0.11.0 Guardfile
ruby-oembed-0.10.1 Guardfile
ruby-oembed-0.10.0 Guardfile