Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evanwalsh/license
A license key generator and validator
https://github.com/evanwalsh/license
Last synced: about 2 months ago
JSON representation
A license key generator and validator
- Host: GitHub
- URL: https://github.com/evanwalsh/license
- Owner: evanwalsh
- License: mit
- Created: 2009-04-18T19:04:31.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2010-03-08T02:03:24.000Z (almost 15 years ago)
- Last Synced: 2024-11-21T18:42:20.548Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 85 KB
- Stars: 12
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= License
License is a gem that can generate and validate license keys. This can powered paid/shareware apps written in Ruby.
== Installation
To install, use these commands:
gem sources -a http://rubygems.org # you only need to run this if you're not using the latest RubyGems
sudo gem install license
=== Using with Rails 2.XTo use this in your Rails app, add this to your config/environment.rb:
Rails::Initializer.run do |config|
config.gem 'license'
end
=== Using with Rails 3.XI won't code or test with Rails 3 until it has been officially released.
== UsageFor a new license, call the License.new method with the name, email, and product name as the arguments
@license = License.new("Evan Walsh","[email protected]","License Gem Test")
Then, you can generate a key using the generate method@license.generate # returns 3F7B-D428-ED3A-3636
To check if a key is valid, use the validate method with they key as the argument@license.validate("3F7B-D428-ED3A-3636") # returns true
== Notes
Please note that this is not a bulletproof copy-protection solution. It's based on more of an honor system.
== Copyright
Copyright (c) 2009-2010 Evan Walsh. See LICENSE for details.