Categories: None [Edit]

licenses

https://rubygems.org/gems/licenses
https://github.com/RyanScottLewis/licenses
# License Create software licenses easily. ## Install ### Bundler: `gem 'license'` ### RubyGems: `gem install license` ## Usage ### Simple ```ruby license = License::Software::MIT.new do |l| l.year.start = 2012 l.author.name = 'Ryan Scott Lewis' l.author.email = 'ryan@rynet.us' end p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis \n\nPermission is hereby granted, free of charge..." ``` ### Multiple Authors ```ruby license = License::Software::MIT.new do |l| l.year.start = 2012 l.authors.add name: 'Ryan Scott Lewis', email: 'ryan@rynet.us' l.authors.add name: 'John Doe', email: 'john.doe@example.com' l.authors.add name: 'Snake Pliskin' l.authors.add 'John McClane ' end p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis , John Doe \n\nPermission is hereby granted, free of charge..." p license.authors.first.name # => 'Ryan Scott Lewis' p license.authors.first.email # => 'ryan@rynet.us' p license.authors.last.name # => 'John McClane' p license.authors.last.email # => 'john@mcclain.org' p license.authors.last.emails # => ['john@mcclain.org', 'jmcclane@gmail.com] ``` #### Smart Setters ```ruby 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.authors = 'Ryan Scott Lewis, John Doe < john.doe@example.com >' end p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis , John Doe \n\nPermission is hereby granted, free of charge..." ``` #### Advanced usage (preferred method) ```ruby license = License::Software.new do # Do not pass block variables to enter the scope of the License::Software type MIT year 2012 author 'Ryan Scott Lewis ' end p license.to_s # => "Copyright (c) 2012 Ryan Scott Lewis \n\nPermission is hereby granted, free of charge..." ``` ##...

Total

Ranking: 109,471 of 158,664
Downloads: 2,520

Daily

Ranking: 33,334 of 158,632
Downloads: 0

Depended by

RankDownloadsName
145,604932Cebu

Depends on

RankDownloadsName
75125,661,365rb-fsevent
24236,876,647redcarpet
46025,853,530guard-rspec
75112,893,633fuubar
1,1395,596,151github-markup
3,307643,016version
5,473224,584guard-yard

Owners

#GravatarHandle
1iconRyanScottLewis