{"id":21597283,"url":"https://github.com/spheresoftware/ivdh","last_synced_at":"2025-03-18T11:22:09.695Z","repository":{"id":138507700,"uuid":"820689","full_name":"SphereSoftware/ivdh","owner":"SphereSoftware","description":"Tool to find Rails 3 deprecations in views. Developed by Sphere Consulting, Inc","archived":false,"fork":false,"pushed_at":"2010-08-06T09:00:21.000Z","size":108,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"gh-pages","last_synced_at":"2025-01-24T17:36:52.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SphereSoftware.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-08-06T04:05:06.000Z","updated_at":"2013-10-07T05:20:48.000Z","dependencies_parsed_at":"2023-03-11T08:46:00.535Z","dependency_job_id":null,"html_url":"https://github.com/SphereSoftware/ivdh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SphereSoftware%2Fivdh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SphereSoftware%2Fivdh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SphereSoftware%2Fivdh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SphereSoftware%2Fivdh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SphereSoftware","download_url":"https://codeload.github.com/SphereSoftware/ivdh/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244208607,"owners_count":20416110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T18:08:38.685Z","updated_at":"2025-03-18T11:22:09.649Z","avatar_url":"https://github.com/SphereSoftware.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n= Instance Variables Deprecation Handler\n\nby Potapov Sergey (aka Blake)\n\n\n== Description\n\nIt is a tool invented to help to remove instance variables from partial templates. Instead it is better to pass all variables in locals hash.\n\nAt the moment the tool parses every template in passed views directory and saves the ouput in output directory which has the same structure as the views directory.\n\nThe meta information what the tool grab is:\n\n* Name of template\n* All instance variables what are used in a template and all subtemplates\n* All partial templates what are used in current template\n* A tree of subtemplates\n* A list of all parent templates where subtemplate is used.\n\n\n== Dependencies\n\nThe tools depends of ruby_parser gem.\nYou should install it if you do not have it yet by command:\n\n  gem install ruby_parser\n\n\n== Usage\n  Usage: ivdh [options]\n      -t, --target-dir DIRECTORY       Directory where views files are located(required)\n      -o, --output-dir DIRECTORY       Path to dir where you want to save output metafiles. Default: ./ivdh_output\n      -l, --log-file                   Log file where all errors message will be logged. Default: ./ivdh.log\n      -q, --quiet                      Quiet mode. Do not print any console output\n      -v, --verbose                    Verbose mode\n      -f, --filters FILE               Specify file with user filters\n      -h, --help                       Show help\n\n\n\n== Examples\n\nThe simplest using:\n  ivdh -t ./app/views\n\nUsing with user filters:\n  ivdh -t ./app/views -f ./user_filter.rb\n\n\n== Examples of user filter file\n\n # Do not process files which begin with \"example\"\n # NOTE: files is array of all template paths\n IVDH::Filters.set_filter(:template_files) do |files|\n   files.reject{|file| File.basename(file) =~ /^example/}\n end\n\n # Lets assume you have a no ordinary Rails application and all your partial\n # templates are located in directory \"app/views/partials\"\n # So you want the tool to find them there.\n # NOTE: data is an instance of IVDH::Filters::PartialFinderData\n IVDH::Filters.set_filter(partial_to_path) do |data|    \n   path = \"partials/\" + data.partial\n   data.paths.find{|p| p =~ path}\n end\n\n\n== Examples of using API\n\nThe next example finds and prints all templates with invalid ruby syntax\n  require 'ivdh'\n  \n  collection = IVDH::TemplateCollection('./app/views')\n  invalid_tpls = collection.find_all{|tpl| !tpl.valid?}\n  puts invalid_tpls.map(\u0026:path)\n\nThe next example finds and prints all partial template which do not have\nparent templates. That probably means they are not used.\n  require 'ivdh'\n  \n  collection = IVDH::TemplateCollection('./app/views')\n  invalid_tpls = collection.find_all{|tpl| tpl.has_no_parent_templates? \u0026\u0026 tpl.partial?}\n  puts invalid_tpls.map(\u0026:path)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspheresoftware%2Fivdh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspheresoftware%2Fivdh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspheresoftware%2Fivdh/lists"}