{"id":16813056,"url":"https://github.com/ivanvc/lunetas","last_synced_at":"2025-04-11T01:44:36.366Z","repository":{"id":1022007,"uuid":"849815","full_name":"ivanvc/lunetas","owner":"ivanvc","description":"Rack micro framework intended for APIs","archived":false,"fork":false,"pushed_at":"2010-12-03T04:03:30.000Z","size":239,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T22:51:21.350Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivanvc.png","metadata":{"files":{"readme":"README.md","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":"2010-08-19T21:06:15.000Z","updated_at":"2022-05-06T18:05:31.000Z","dependencies_parsed_at":"2022-08-16T11:50:26.765Z","dependency_job_id":null,"html_url":"https://github.com/ivanvc/lunetas","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2Flunetas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2Flunetas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2Flunetas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanvc%2Flunetas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanvc","download_url":"https://codeload.github.com/ivanvc/lunetas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953106,"owners_count":21023947,"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-13T10:24:29.155Z","updated_at":"2025-04-11T01:44:36.345Z","avatar_url":"https://github.com/ivanvc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Lunetas](http://dulcemexico.com/productos/lunetasgrand.jpg)\n\nLunetas\n=======\n\nA Rack based micro framework. \n\nStructure\n---------\n\nIt is a class-url based framework. It means, that every class describes a route using\na Regular Expression. It may respond to one or many HTTP methods. These responses are\ndefined overwritting the methods get, put, post, delete, trace, head, etc.. It can\nalso handle other non-native HTTP methods, using overwritting other_verb.\n\nWhat does all these means? Checkout an example. (You can also take a look at the\nexamples folder).\n\nUsage\n-----\n\nIf you are going to use Lunetas as a stand alone Rack application. In order to get it\nrunning, you just need to add `run Lunetas::Bag` in your config.ru file. \n\nIf you are going to use Lunetas behind a framework like Rails. You just need to add\nthe gem, `require 'lunetas'` in your metal, and you are ready to go.\n\nNow with support for public assets, and templates. Check out the example under\n/examples/stand_alone_app, to see how it works!\n\nExamples\n--------\n\n### Simple example\n\n    require 'lunetas'\n    \n    class Testing\n      include Lunetas::Candy\n      matches '/hello/(\\w+)', :name\n    \n      def before\n        @name = @name.capitalize\n      end\n    \n      def get\n        \"Hello #{@name}! #{params[:chunky]}\"\n      end\n    \n      def post\n        \"Hey #{@name}, I see you're testing the POST method :)\"\n      end\n    end\n    \n    class AnotherTest\n      include Lunetas::Candy\n      matches '^/(\\d+)$', :number\n    \n      def get\n        \"Is #{@number} your lucky number?\"\n      end\n    \n      def other_verb(verb)\n        if verb == 'TEAPOT'\n          \"I ain't a teapot!\"\n        end\n      end\n    end\n\n### Defining a custom ContentType\n\n    require 'lunetas'\n    require 'json'\n    \n    class JaySon\n      include Lunetas::Candy\n      matches '^/something\\.json$'\n      set_content_type 'application/json'\n    \n      def get\n        { :test =\u003e true, 'json' =\u003e \"Yes, JSON\", :amount =\u003e 1}.to_json\n      end\n    end\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanvc%2Flunetas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanvc%2Flunetas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanvc%2Flunetas/lists"}