License
Create software licenses easily.
Install
Bundler: gem 'license'
RubyGems: gem install license
Usage
Simple
license = License::Software::MIT.new do |l|
l.year.start = 2012
l..name = 'Ryan Scott Lewis'
l..email = '[email protected]'
end
p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis <[email protected]>\n\nPermission is hereby granted, free of charge..."
Multiple Authors
license = License::Software::MIT.new do |l|
l.year.start = 2012
l..add name: 'Ryan Scott Lewis', email: '[email protected]'
l..add name: 'John Doe', email: '[email protected]'
l..add name: 'Snake Pliskin'
l..add 'John McClane <[email protected], [email protected]>'
end
p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis <[email protected]>, John Doe <[email protected]>\n\nPermission is hereby granted, free of charge..."
p license..first.name # => 'Ryan Scott Lewis'
p license..first.email # => '[email protected]'
p license..last.name # => 'John McClane'
p license..last.email # => '[email protected]'
p license..last.emails # => ['[email protected]', '[email protected]]
Smart Setters
license = License::Software.new do |l|
l.type = License::Software::MIT # Set which type of license here instead
l.year = '2006-2011' # Will set year.start to 2006 and year.end to 2011
l. = 'Ryan Scott Lewis<ryan@rynet>, John Doe < [email protected] >'
end
p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis <[email protected]>, John Doe <[email protected]>\n\nPermission is hereby granted, free of charge..."
Advanced usage (preferred method)
license = License::Software.new do # Do not pass block variables to enter the scope of the License::Software
type MIT
year 2012
'Ryan Scott Lewis <[email protected]>'
end
p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis <[email protected]>\n\nPermission is hereby granted, free of charge..."
Contributing
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
- Fork the project
- Start a feature/bugfix branch
- Commit and push until you are happy with your contribution
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright
Copyright © 2012 Ryan Scott Lewis [email protected].
The MIT License (MIT) - See LICENSE for further details.