{"id":16701687,"url":"https://github.com/coryodaniel/merbmax","last_synced_at":"2026-04-21T20:31:37.629Z","repository":{"id":694529,"uuid":"339068","full_name":"coryodaniel/MerbMax","owner":"coryodaniel","description":"A collection of plugins for merb.  Get your SEO on with meta, configure your instances with roles.","archived":false,"fork":false,"pushed_at":"2009-11-05T11:09:03.000Z","size":176,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T10:09:57.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/coryodaniel/merb_max","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coryodaniel.png","metadata":{"files":{"readme":"README","changelog":null,"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":"2009-10-16T00:59:04.000Z","updated_at":"2024-10-17T11:17:55.000Z","dependencies_parsed_at":"2022-07-18T04:00:42.267Z","dependency_job_id":null,"html_url":"https://github.com/coryodaniel/MerbMax","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coryodaniel/MerbMax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2FMerbMax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2FMerbMax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2FMerbMax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2FMerbMax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coryodaniel","download_url":"https://codeload.github.com/coryodaniel/MerbMax/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2FMerbMax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32108672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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:12.396Z","updated_at":"2026-04-21T20:31:37.603Z","avatar_url":"https://github.com/coryodaniel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"MerbMax\n=======\nMerbMax is a collection of little nifty plugins for merb\n\n\nWhy is this one gem?\n===================\nEveryone else is breaking big projects up into a bunch of different gems for ease of swapping things out, so\nwhy am I putting this in one gem?  \n\n_It's easier for me to maintain this way_\n\nPlus, everything in this projects is 'opt-in' so it's no big deal. If the few extra files worry you that you aren't using, you_are_nuts.\n\n\nCurrent Plugins\n===================\n  * Coerce\n    * Helpers\n  * Roles\n    * Helpers\n  * Meta\n\n\nPlugins I'm gutting out of hacks in our local merb branch over the next few days\n==================\n  * Threshold - Track access to controller/action in the seamlessly session, and limit access\n    * Wait - Force a user to 'wait' out threshold exceptions\n    * Recaptcha - Force a user to solve a captcha to continue use beyond threshold\n  * SessionExclusions - Session keys that will be stored as unmarshaled columns for your querying pleasure\n  * SessionNoMarshalMemcached - a MemCache session store that doesn't marshal at all, great for tiny sessions\n  * RepositoryPerResource - Set a DM Repository at the Controller level\n  * EnhancedEnvironments (No static references)\n    * .development?\n    * .production? should test /production/i (in case of productionWww, etc)\n    * merge_env, better name? \u0026 keep track of what was merged into an environment\n    * acts_like?(:development) -\u003e Is this that environment, or was that environment merged in?\n  * Pagination\n  * VokleAPI Pattern (ad nauseam)\n  \n\nUsage\n=====\n\nCoerce\n------\nCoerces values in the params hash before the controller dispatches the action. There are some helpers in coerce/helpers.\n\n    require 'merb_max'\n    require 'merb_max/coerce'\n    require 'merb_max/coerce/helpers'    \n    \n    class People \u003c Merb::Controller # People Controller\n      coerce(:id){|_id_| _id_.to_i } # Will convert that String representation of your ID to a integer\n      \n      # There are a few baked into coerce/helpers\n      coerce_to_i(:id) # as above\n      \n      # Got stupid 'on' and 'true' values from HTML and Flash checkboxes?\n      coerce_str_to_bool(:my_boolean_option)\n      \n      # They also take values to pass to their underlying before filter\n      coerce(:name, :only =\u003e [:show]){|_name| \"Hey, welcome to the 'show' action, #{_name}\"}\n    end\n\n\nRoles\n-----\nAllow merb instances to assume roles, i.e. :www, :api and optimize the provides/filters for that role.  There are a few helpers available in roles/helpers\n\nRole values don't \"mean anything.\" You can call a role :www, or :api, or :duck_crackers or :whatever floats your :boat.\n\nWhere the magic comes in is in your Controllers, because you can optionally call \"before filters\" and interact with Merb's Provides API.\n\nThe point of the 'roles' plugin is to allow you to put all your Web and API code in once project (the models are the same, access is controlled the same way), but\nyou don't necessarily want your WWW servers doing things the way your API servers are doing them, right?\n\nAgain, anything you can do at the Controller level in a controller, you can do in one of 'role_config' blocks and it'll only be handled\nby a server that was booted in that environment role.\n\n    require 'merb_max'\n    require 'merb_max/roles'\n    require 'merb_max/roles/helpers'\n\n    # in development.rb, production.rb, environment.rb, etc\n    # I create alternate environments called productionWww productionApi and set this accordingly.\n    #\n    Merb::Config[:role] = :api # This server should assume the 'api' role\n\n    # in the People Controller\n    class People \u003c Merb::Controller\n      role_config(:api){ \n        no_ui #no_ui is a helper that removes the :edit and :new actions\n        \n        # These could be YOUR before filters, whatevs.\n        before :my_super_secure_verify_api_method\n        before :track_api_usage     \n        \n        only_provides :js # XML is so early turn of the century ;)\n      } \n      \n      role_config(:www){\n        #this is available in the merb_max/meta plugin. CROSS PROMOTION SON!\n        meta(:keywords =\u003e \"This site is full of stunning people\") \n        \n        before :verify_user_is_logged_in\n      }\n      \n      \n    end\n    \n    class AdminPanel \u003c Merb::Controller\n      # Dont respond to requests to /adminpanel for API requests (unsupported is in helpers)\n      role_config(:api){ unsupported } \n    end\n\n\nMeta\n----\nEasy access to keywords, title, and description meta tags from inside an action, so you can get your SEO (search engine optimization) on on a request by request basis.\nProvides meta controller (inheritably) on a controller-by-controller and action-by-action basis\n\n    ### ... from app/controllers/application.rb\n\n    class Application \u003c Merb::Controller\n    meta  :title     =\u003e \"My default page title\",\n      :description  =\u003e \"My default page description\",\n      :keywords     =\u003e \"cool, default keywords, web 2.0\"\n    end\n\n    ### ... from app/views/layout/application.html.erb\n    #       meta tags can be output via 'meta' or 'meta :tagname'\n\n    #       using 'meta' will output all the meta data in html tags like\n    \u003chtml\u003e\n      \u003chead\u003e\n      \u003c%= meta %\u003e\n        \u003c!-- Would render;\n          \u003ctitle\u003eMy default page title\u003c/title\u003e\n          \u003cmeta name=\"keywords\" content=\"cool, default keywords, web 2.0\" /\u003e\n          \u003cmeta name=\"description\" content=\"My default page description\" /\u003e\n        --\u003e\n      \u003c/head\u003e\n    ...\n    \u003c/html\u003e\n\n    #       optionally you can get the value of a particular tag like so:\n    \u003chtml\u003e\n      \u003chead\u003e\n        \u003ctitle\u003e\u003c%= meta :title %\u003e\u003c/title\u003e\n        \u003cmeta name=\"keywords\" content=\"\u003c%= meta :keywords %\u003e\" /\u003e\n        \u003cmeta name=\"description\" content=\"\u003c%= meta :description %\u003e\" /\u003e\n      \u003c/head\u003e\n      \u003cbody\u003e\n        ...\n      \u003c/body\u003e\n    \u003c/html\u003e\n\n    ### ... the tags can be overriden on a per controller or per action basis.\n    class ControllerA \u003c Merb::Controller\n      meta :title =\u003e \"This is controller a\"\n\n      def action_a\n        meta :title =\u003e \"this is action a\", :keywords =\u003e \"action a, action\"\n        render\n        # :title =\u003e \"this is action a\"\n        # :keywords =\u003e \"action a, action\"\n        # :description =\u003e \"My default controller description\"\n      end\n  \n      def action_b\n        render\n        # :title =\u003e \"This is controller a\"\n        # :description =\u003e \"My default page description\"\n        # :keywords =\u003e \"cool, default keywords, web 2.0\"\n      end\n    end\n\n\nDon't Forget\n============\nYou can combine this plugins to do cool things.  Like only threshold your API servers, and only add Meta Tags to your HTML responses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fmerbmax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoryodaniel%2Fmerbmax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fmerbmax/lists"}