0.0
No release in over a year
Adds a rake task that accepts a view partial file name and outputs the render chain along with best guesses as to the routes used to render the partial.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.3.4
>= 0
>= 12.3.3
~> 3.0

Runtime

 Project Readme

PartialFinder

As Rails apps grow, partial usage and templates get increasingly complicated. PartialFinder adds rake tasks to your Rails app to help you track down the various ways that a given parial may be rendered. You can provide it a partial path and it will output all of the routes and controllers that serve it, along with the intermediate files.

Usage: rake partial_finder:find\['path/to/_partial.html.erb'\]

Installation

Add this line to your application's Gemfile under the development group:

gem 'partial_finder', "~> 0.1"

And then execute:

$ bundle install

Usage

To view this help manual outside of the README, run bundle exec rake partial_finder:help.

PartialFinder adds two rake tasks to help track down partial usage:

Task: Find Usage: rake partial_finder:find\['path/to/_partial.html.erb'\] Outputs all render chains and tries to match each partial with any controllers and routes that eventually render it.

Task: Debug Usage: rake partial_finder:debug\['path/to/_partial.html.erb'\] Contains the same output as Find but with additional intermediate steps that can be used to help validate the final results.

Here's an example output when running rake partial_finder:find\["app/views/order_product_links/_description_block.html.erb"\]:

example_results

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Negotiatus/Partial-Finder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the PartialFinder project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.