lib/ronin/license.rb in ronin-0.2.1 vs lib/ronin/license.rb in ronin-0.2.2
- old
+ new
@@ -20,11 +20,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#++
#
require 'ronin/model'
-require 'ronin/extensions/string'
require 'dm-predefined'
module Ronin
class License
@@ -63,26 +62,57 @@
# _options_ may contain the following keys:
# <tt>:description</tt>:: The description of the license.
# <tt>:url</tt>:: The URL to the license.
#
def self.define(name,options={})
- super(name.to_method_name,options.merge(:name => name))
+ super(name.downcase.gsub(/[\s_\-]+/,'_'),options.merge(:name => name))
end
# Creative Commons Licenses
- define 'CC by', :description => 'Creative Commons Attribution v3.0 License', :url => 'http://creativecommons.org/licenses/by/3.0/'
- define 'CC by-sa', :description => 'Creative Commons Attribution-Share Alike v3.0 License', :url => 'http://creativecommons.org/licenses/by-sa/3.0/'
- define 'CC by-nd', :description => 'Creative Commons Attribution-No Derivative Works v3.0 License', :url => 'http://creativecommons.org/licenses/by-nd/3.0/'
- define 'CC by-nc', :description => 'Creative Commons Attribution-Noncommercial v3.0 License', :url => 'http://creativecommons.org/licenses/by-nc/3.0/'
- define 'CC by-nc-sa', :description => 'Creative Commons Attribution-Noncommercial-Share Alike v3.0 License', :url => 'http://creativecommons.org/licenses/by-nc-sa/3.0/'
- define 'CC by-nc-nd', :description => 'Creative Commons Attribution-Noncommercial-No Derivative Works v3.0 License', :url => 'http://creativecommons.org/licenses/by-nc-nd/3.0/'
+ define 'CC by',
+ :description => 'Creative Commons Attribution v3.0 License',
+ :url => 'http://creativecommons.org/licenses/by/3.0/'
+ define 'CC by-sa',
+ :description => 'Creative Commons Attribution-Share Alike v3.0 License',
+ :url => 'http://creativecommons.org/licenses/by-sa/3.0/'
+
+ define 'CC by-nd',
+ :description => 'Creative Commons Attribution-No Derivative Works v3.0 License',
+ :url => 'http://creativecommons.org/licenses/by-nd/3.0/'
+
+ define 'CC by-nc',
+ :description => 'Creative Commons Attribution-Noncommercial v3.0 License',
+ :url => 'http://creativecommons.org/licenses/by-nc/3.0/'
+
+ define 'CC by-nc-sa',
+ :description => 'Creative Commons Attribution-Noncommercial-Share Alike v3.0 License',
+ :url => 'http://creativecommons.org/licenses/by-nc-sa/3.0/'
+
+ define 'CC by-nc-nd',
+ :description => 'Creative Commons Attribution-Noncommercial-No Derivative Works v3.0 License',
+ :url => 'http://creativecommons.org/licenses/by-nc-nd/3.0/'
+
+ define 'CC0',
+ :description => 'Creative Commons Zero License',
+ :url => 'http://creativecommons.org/licenses/zero/1.0/'
+
# GNU Public Licenses
- define 'GPL-2', :description => 'GNU Public License v2.0', :url => 'http://www.gnu.org/licenses/gpl-2.0.txt'
- define 'GPL-3', :description => 'GNU Public License v3.0', :url => 'http://www.gnu.org/licenses/gpl-3.0.txt'
- define 'LGPL-3', :description => 'GNU Lesser General Public License v3.0', :url => 'http://www.gnu.org/licenses/lgpl-3.0.txt'
+ define 'GPL-2',
+ :description => 'GNU Public License v2.0',
+ :url => 'http://www.gnu.org/licenses/gpl-2.0.txt'
+ define 'GPL-3',
+ :description => 'GNU Public License v3.0',
+ :url => 'http://www.gnu.org/licenses/gpl-3.0.txt'
+
+ define 'LGPL-3',
+ :description => 'GNU Lesser General Public License v3.0',
+ :url => 'http://www.gnu.org/licenses/lgpl-3.0.txt'
+
# The MIT Licence
- define 'MIT', :description => 'The MIT Licence', :url => 'http://www.opensource.org/licenses/mit-license.php'
+ define 'MIT',
+ :description => 'The MIT Licence',
+ :url => 'http://www.opensource.org/licenses/mit-license.php'
end
end