{"id":16701685,"url":"https://github.com/coryodaniel/warningshot","last_synced_at":"2025-04-10T04:12:10.731Z","repository":{"id":434002,"uuid":"54782","full_name":"coryodaniel/warningshot","owner":"coryodaniel","description":"Dependency Resolution Framework","archived":false,"fork":false,"pushed_at":"2009-02-27T01:40:54.000Z","size":580,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T22:38:05.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://warningshot.lighthouseapp.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coryodaniel.png","metadata":{"files":{"readme":"README","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-09-21T02:52:21.000Z","updated_at":"2019-08-13T13:35:48.000Z","dependencies_parsed_at":"2022-07-14T13:01:08.091Z","dependency_job_id":null,"html_url":"https://github.com/coryodaniel/warningshot","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/coryodaniel%2Fwarningshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fwarningshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fwarningshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fwarningshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coryodaniel","download_url":"https://codeload.github.com/coryodaniel/warningshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154994,"owners_count":21056543,"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-10-12T18:45:11.417Z","updated_at":"2025-04-10T04:12:10.701Z","avatar_url":"https://github.com/coryodaniel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"WarningShot Dependency Resolution Framework\n * Additional documentation @ http://github.com/coryodaniel/warningshot/wikis/\n\n==== Note on RSpecs\n\tCurrently the PermissionResolver RSpecs will probably fail that is because\n\tI am not sure what the best way is to write them in regards to users \u0026 groups\n\tthat may or may not be on a remote machine.  I wrote the specs, and they work on\n\tmy laptop (given that I have the groups/users) mentioned in the tests.\n\tSee: ./test/spec/unit/resolvers/permission_resolver_spec.rb\n\n==== Installing WarningShot\n  WarningShot installs a little differently than most gems.  WarningShot itself has NO gem dependencies.  Gems become\n  a dependency based on what Plugins/Resolvers you have installed.  By default WarningShot will not install any additional gems.\n  When using WarningShot if a gem is missing that is needed for a feature you are using you will receive a warning that the gem\n  is missing.  Optionally you can list and build all of warningshots dependencies from the command line.\n  \n  sudo gem install warningshot\n  warningshot --list-deps (list all resolvers and their dependencies)\n  warningshot --build-deps (install all gems that resolvers are dependent on)\n  \n  This method provides a minimalist WarningShot.  WarningShot's dependencies essentially change depending on what you use\n  it for.  Thats neat, not a lot of extra gems that you don't need installed being installed.\n  \n\n==== Terminology\n  * Resolver\n    A class that includes WarningShot::Resolver.  It should have the ability to test and resolve a type\n    of dependency\n      \n  * Configuration\n    The current configuration the WarningShot instance is running under.\n    Configurations can be created with WarningShot::Config\n    \n  * Dependency\n    A dependency is an entry in a recipe.  A dependency should consist of some means of identifying the\n    dependency and optionally (but suggested) have some way of describing how it should be resolved.\n      Ex: File Dependencies specify where the file should be located, and where WarningShot can download it if it\n          does not exist\n  \n  * Test\n    Tests are blocks that are registered in resolver.  They are a means of determining if a dependency is met.  Multiple tests\n    can be written, and may also have conditions as to whether they should run or not (a test could be environment\n    specific for instance).  WarningShot will run the first test that it can based on any conditions provided.  \n    Tests should always return a Boolean value\n  \n  * Resolution\n    Resolutions are like tests in every way except instead of determine if a dependency has been met, they actually\n    repair or resolve the dependency.  The gem resolver can install missing gems and the file resolver can download\n    missing files\n  \n  * Recipes / Application Recipes\n    A recipe is one or more dependency branches, the default file type is YAML, but that is configurable\n    within warningshot.  A recipe can consist of one or more dependency branches.\n\n\t\tExample:  warningshot --templates will create a separate recipe for each branch supported.\n    In the wiki (http://github.com/coryodaniel/warningshot/wikis/example-merbnginx-app-recipe-once-aptquality-dependencies-are-supported)\n    is an example of a recipe that specifies dependencies of files, gems, apt binaries, etc.  Essentially all the dependencies needed for\n\t\tthe web server role.\n    \n  * DependencyTree\n    After WarningShot locates all of the Machine Recipes they are parsed into the dependency tree.  The dependency\n    tree is a large hash of branch names to raw hashes parsed from the Machine Recipes (YAML).\n    \n  * DependencyBranch\n    A specific type of dependency within the dependency tree.  Examples include, :file, :gem, :directory\n  \n==== How it works\n  * WarningShot - Factory class that creates and runs DependencyResolver\n  * DependencyResolver - Locates Resolver classes, creates a dependency tree, and matches resolvers to resolution branches\n  * Resolver - Class that can be included to create plugins.  Composed of tests and resolutions that can determine if a dependency was met, and if not, how to fix it\n  \n==== Command Line Examples\nFor a list of all flags do: warningshot --help\n\n\t- Details on Resolvers\n\t\twarningshot --version\n\t\t\n\t- Loading specific resolvers\n\t\twarningshot --oload=gem,file \t\t\t\t\t\t\t\t\t\t\t\t# =\u003e Only gem and file resolvers will be run\n\t\twarningshot --pload=directory,file \t\t\t\t\t\t\t\t\t# =\u003e Only loads specified gems and loads in specified order\n\t\twarningshot --resolvers=/path/to/my/resolvers/*.rb \t# =\u003e Glob to find additional resolvers\n\n\t- Creating Recipe templates\n\t\twarningshot --templates=./path/to/where/you/want/templates\n\t\t\n\t- Warningshot's Dependencies\n\t\twarningshot --list-deps\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# =\u003e Depedencies per Resolver\n\t\twarningshot --build-deps\t\t\t\t\t\t\t\t\t\t\t\t\t\t# =\u003e Installs everything a full fledged warningshot needs\n\n\n==== Ruby API\n\n  - Configuring WarningShot\n  config = WarningShot::Config.create do |c|\n    c[:environment]  = 'development'\n    c[:resolve]      = false\n    c[:config_paths] = ['.'  / 'config' / 'warningshot']\n    c[:application]  = '.'\n    c[:log_path]     = '.' / 'log' / 'warningshot.log'\n    c[:log_level]    = :debug\n    c[:growl]        = false\n    c[:verbose]      = true\n    c[:]\n  end\n  \n  - Interfacing with a DependencyResolver\n  dependency_resolver = WarningShot.fire!(config)\n  dependency_resolver.stats                       # =\u003e Hash of statistics\n  \n  dependency_resolver.resolvers                   # =\u003e Array of all executed resolvers\n  \n  dependency_resolver.resolvers.first.dependencies #=\u003e Set of all loaded dependencies\n  \n  dependency_resolver.resolver.first.passed     # =\u003e Array of passed dependencies\n  dependency_resolver.resolver.first.failed     # =\u003e Array of failed dependencies\n  dependency_resolver.resolver.first.unresolved # =\u003e Array of unresolved dependencies\n  dependency_resolver.resolver.first.resolved   # =\u003e Array of resolved dependencies\n  \n  - Callbacks\n  WarningShot.before do \n    puts 'this would run before the DepenencyResolver was created in #fire!'\n  end\n  \n  WarningShot.after do\n    puts 'this would run after the DepenencyResolver was processed in #fire!'\n  end\n  \n  WarningShot::AnyResolverYouWant.before :test do\n    puts 'this would run before the #test! method on the chosen resolver'\n  end\n  \n  WarningShot::AnotherFunResolver.after :test do\n    puts 'this would run after the #test! method'\n  end\n  \n  WarningShot::AnotherResolver.before :resolution do\n    puts 'this would run before the #resolve! method'\n  end\n  \n  WarningShot::AnotherResolver.after :resolution do\n    puts 'this would run after the #resolve! method'\n  end\n  \n==== Components\n * Ruby API\n * Resolvers\n * Config Files\n \n \n==== Using Machine Recipes\n * Coming Soon\n\n \n==== How the dependency tree works\n * Coming Soon\n\n\n==== Extending WarningShot\n * Writing a Resolver (Coming Soon)\n    * Kernel#require vs Resolver#add_dependency\n * Modifying Resolvers at run-time (Coming Soon)\n\n\n==== Contributing\n * Source available @: \n    https://github.com/coryodaniel/warningshot/tree\n \n * Bug reports / feature requests @:\n    http://warningshot.lighthouseapp.com/projects/17241-warningshot/overview\n \n * Online Documentation available @:\n    http://github.com/coryodaniel/warningshot/wikis\n    \n * RubyForge Project @:\n    http://rubyforge.org/projects/warning-shot/\n \n * All modifications should also have applicable rpsecs\n    http://rspec.info/\n    \n * A dummy gem has been created for testing the GemResolver\n    https://rubyforge.org/projects/ws-dummy/\n    http://github.com/coryodaniel/ws-dummy/tree/master\n    gem install ws-dummy\n \n * All code should be documented using YARD\n    http://yard.rubyforge.org/\n    A template is available file://./yardoc_template.txt\n    Generate Yardoc with: yardoc --output-dir ./doc/yard --private --protected --readme README","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fwarningshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoryodaniel%2Fwarningshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fwarningshot/lists"}