Project

license

0.01
No commit activity in last 3 years
No release in over 3 years
A honor-based license key generator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 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.X¶ ↑

To 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.X¶ ↑

I won’t code or test with Rails 3 until it has been officially released.

Usage¶ ↑

For a new license, call the License.new method with the name, email, and product name as the arguments

@license = License.new("Evan Walsh","evan@nothingconcept.com","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 © 2009-2010 Evan Walsh. See LICENSE for details.