license_auto 0.1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +47 -0
  3. data/.travis.yml +9 -0
  4. data/CHANGELOG.md +17 -0
  5. data/Gemfile +27 -0
  6. data/Gemfile.lock +103 -0
  7. data/LICENSE +23 -0
  8. data/README.md +136 -0
  9. data/Rakefile +20 -0
  10. data/examples/get_license_files_of_bundler.rb +12 -0
  11. data/lib/api.rb +60 -0
  12. data/lib/api/bitbucket.rb +142 -0
  13. data/lib/api/code_google_com.rb +66 -0
  14. data/lib/api/excel_export.rb +189 -0
  15. data/lib/api/gem_data.rb +30 -0
  16. data/lib/api/git_kernel_org.rb +59 -0
  17. data/lib/api/github.rb +376 -0
  18. data/lib/api/go_pkg_in.rb +41 -0
  19. data/lib/api/golang_org.rb +63 -0
  20. data/lib/api/google_source_com.rb +68 -0
  21. data/lib/api/gradle2.rb +41 -0
  22. data/lib/api/helper.rb +26 -0
  23. data/lib/api/j_center.rb +23 -0
  24. data/lib/api/maven_central_repository.rb +192 -0
  25. data/lib/api/mq.rb +30 -0
  26. data/lib/api/npm_registry.rb +169 -0
  27. data/lib/api/pattern.rb +33 -0
  28. data/lib/api/remote_source_package.rb +319 -0
  29. data/lib/api/spider.rb +47 -0
  30. data/lib/cloner.rb +154 -0
  31. data/lib/db.rb +267 -0
  32. data/lib/license_auto.rb +20 -0
  33. data/lib/license_auto/config/config.rb +52 -0
  34. data/lib/license_auto/errors.rb +0 -0
  35. data/lib/license_auto/license/frequency.rb +30 -0
  36. data/lib/license_auto/license/similarity.rb +247 -0
  37. data/lib/license_auto/license/templates/AFL2.0.txt +43 -0
  38. data/lib/license_auto/license/templates/AFL2.1.txt +47 -0
  39. data/lib/license_auto/license/templates/AFL3.0.txt +45 -0
  40. data/lib/license_auto/license/templates/AGPL3.0.txt +236 -0
  41. data/lib/license_auto/license/templates/APSL 2.0.txt +100 -0
  42. data/lib/license_auto/license/templates/Apache1.0.txt +18 -0
  43. data/lib/license_auto/license/templates/Apache1.1.txt +18 -0
  44. data/lib/license_auto/license/templates/Apache2.0.txt +201 -0
  45. data/lib/license_auto/license/templates/Artistic1.0.txt +45 -0
  46. data/lib/license_auto/license/templates/Artistic2.0.txt +70 -0
  47. data/lib/license_auto/license/templates/BSD.txt +29 -0
  48. data/lib/license_auto/license/templates/CDDL1.0.txt +1 -0
  49. data/lib/license_auto/license/templates/CDDL1.1.txt +209 -0
  50. data/lib/license_auto/license/templates/CPL1.0.txt +211 -0
  51. data/lib/license_auto/license/templates/CPOL 1.02.txt +41 -0
  52. data/lib/license_auto/license/templates/ClarifiedArtistic.txt +140 -0
  53. data/lib/license_auto/license/templates/Creative Commons1.0.txt +28 -0
  54. data/lib/license_auto/license/templates/EPL1.0.txt +70 -0
  55. data/lib/license_auto/license/templates/ERLANG1.1.txt +286 -0
  56. data/lib/license_auto/license/templates/GFDL1.1.txt +101 -0
  57. data/lib/license_auto/license/templates/GFDL1.2.txt +108 -0
  58. data/lib/license_auto/license/templates/GFDL1.3.txt +116 -0
  59. data/lib/license_auto/license/templates/GPL1.0.txt +105 -0
  60. data/lib/license_auto/license/templates/GPL2.0.txt +340 -0
  61. data/lib/license_auto/license/templates/GPL3.0.txt +220 -0
  62. data/lib/license_auto/license/templates/H2.txt +118 -0
  63. data/lib/license_auto/license/templates/IBMPublic1.0.txt +58 -0
  64. data/lib/license_auto/license/templates/LGPL2.0.txt +481 -0
  65. data/lib/license_auto/license/templates/LGPL2.1.txt +166 -0
  66. data/lib/license_auto/license/templates/LGPL3.0.txt +56 -0
  67. data/lib/license_auto/license/templates/Lucent Public License 1.02.txt +244 -0
  68. data/lib/license_auto/license/templates/MIT.txt +21 -0
  69. data/lib/license_auto/license/templates/MIT2.0.txt +11 -0
  70. data/lib/license_auto/license/templates/MPL 2.0.txt +373 -0
  71. data/lib/license_auto/license/templates/MPL1.1.txt +470 -0
  72. data/lib/license_auto/license/templates/MS-LPL.txt +22 -0
  73. data/lib/license_auto/license/templates/MS-PL.txt +20 -0
  74. data/lib/license_auto/license/templates/MS-RL.txt +19 -0
  75. data/lib/license_auto/license/templates/NPL1.0.txt +138 -0
  76. data/lib/license_auto/license/templates/OpenSSL.txt +127 -0
  77. data/lib/license_auto/license/templates/Oracle license.txt +69 -0
  78. data/lib/license_auto/license/templates/PublicDomain.txt +7 -0
  79. data/lib/license_auto/license/templates/Python.txt +15 -0
  80. data/lib/license_auto/license/templates/QPL1.0.txt +45 -0
  81. data/lib/license_auto/license/templates/RubyClause-6.txt +56 -0
  82. data/lib/license_auto/license/templates/SQLite Copyright.txt +33 -0
  83. data/lib/license_auto/license/templates/Sleepycat.txt +133 -0
  84. data/lib/license_auto/license/templates/SunPublic1.0.txt +183 -0
  85. data/lib/license_auto/license/templates/WTFPL license.txt +13 -0
  86. data/lib/license_auto/license_info.rb +12 -0
  87. data/lib/license_auto/matcher.rb +100 -0
  88. data/lib/license_auto/package.rb +73 -0
  89. data/lib/license_auto/parser/gemfile.rb +0 -0
  90. data/lib/license_auto/parser/golang.rb +0 -0
  91. data/lib/license_auto/parser/gradle.rb +0 -0
  92. data/lib/license_auto/version.rb +20 -0
  93. data/lib/license_auto/website.rb +11 -0
  94. data/lib/license_auto/website/github.rb +49 -0
  95. data/lib/license_auto/website/ruby_gems_org.rb +79 -0
  96. data/lib/license_auto/website/ruby_gems_org_db.rb +52 -0
  97. data/lib/license_auto/website/rubydoc_info.rb +12 -0
  98. data/lib/message.rb +5 -0
  99. data/lib/misc.rb +131 -0
  100. data/lib/parser/enums.rb +161 -0
  101. data/lib/parser/gemfile_parser.rb +221 -0
  102. data/lib/parser/golang_parser.rb +104 -0
  103. data/lib/parser/gradle_parser.rb +141 -0
  104. data/lib/parser/manifest_parser.rb +66 -0
  105. data/lib/parser/maven_parser.rb +91 -0
  106. data/lib/parser/npm_parser.rb +82 -0
  107. data/lib/parser/pip_parser.rb +1 -0
  108. data/lib/parser/rebar_parser.rb +61 -0
  109. data/lib/recorder.rb +184 -0
  110. data/lib/script/apt-get.deps.sh +37 -0
  111. data/lib/script/debian_dpkg_list.sh +2 -0
  112. data/lib/script/rubygems.org.importdb.sh +22 -0
  113. data/license_auto.gemspec +44 -0
  114. data/remove/license_auto +4 -0
  115. data/remove/mq_pack.rb +219 -0
  116. data/remove/mq_repo.rb +106 -0
  117. metadata +249 -0
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
@@ -0,0 +1,33 @@
1
+ SQLite Copyright
2
+
3
+
4
+ SQLite is in the
5
+ Public Domain
6
+ All of the code and documentation in SQLite has been dedicated to the public domain by the authors. All code authors, and representatives of the companies they work for, have signed affidavits dedicating their contributions to the public domain and originals of those signed affidavits are stored in a firesafe at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original SQLite code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
7
+
8
+ The previous paragraph applies to the deliverable code and documentation in SQLite - those parts of the SQLite library that you actually bundle and ship with a larger application. Some scripts used as part of the build process (for example the "configure" scripts generated by autoconf) might fall under other open-source licenses. Nothing from these build scripts ever reaches the final deliverable SQLite library, however, and so the licenses associated with those scripts should not be a factor in assessing your rights to copy and use the SQLite library.
9
+
10
+ All of the deliverable code in SQLite has been written from scratch. No code has been taken from other projects or from the open internet. Every line of code can be traced back to its original author, and all of those authors have public domain dedications on file. So the SQLite code base is clean and is uncontaminated with licensed code from other projects.
11
+
12
+ Obtaining An Explicit License To Use SQLite
13
+
14
+ Even though SQLite is in the public domain and does not require a license, some users want to obtain a license anyway. Some reasons for obtaining a license include:
15
+
16
+ You are using SQLite in a jurisdiction that does not recognize the public domain.
17
+ You are using SQLite in a jurisdiction that does not recognize the right of an author to dedicate their work to the public domain.
18
+ You want to hold a tangible legal document as evidence that you have the legal right to use and distribute SQLite.
19
+ Your legal department tells you that you have to purchase a license.
20
+ If you feel like you really have to purchase a license for SQLite, Hwaci, the company that employs the architect and principal developers of SQLite, will sell you one.
21
+
22
+ Contributed Code
23
+
24
+ In order to keep SQLite completely free and unencumbered by copyright, all new contributors to the SQLite code base are asked to dedicate their contributions to the public domain. If you want to send a patch or enhancement for possible inclusion in the SQLite source tree, please accompany the patch with the following statement:
25
+
26
+ The author or authors of this code dedicate any and all copyright interest in this code to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this code under copyright law.
27
+ We are not able to accept patches or changes to SQLite that are not accompanied by a statement such as the above. In addition, if you make changes or enhancements as an employee, then a simple statement such as the above is insufficient. You must also send by surface mail a copyright release signed by a company officer. A signed original of the copyright release should be mailed to:
28
+
29
+ Hwaci
30
+ 6200 Maple Cove Lane
31
+ Charlotte, NC 28269
32
+ USA
33
+ A template copyright release is available in PDF or HTML. You can use this release to make future changes.
@@ -0,0 +1,133 @@
1
+ Open Source License for Oracle Berkeley DB
2
+
3
+ The following is the license that applies to this copy of the Berkeley
4
+ DB software. For a license to use the Berkeley DB software under
5
+ conditions other than those described here, or to purchase support for
6
+ this software, please contact berkeleydb-info_us@oracle.com.
7
+
8
+ If you were looking for the license that applies to Berkeley DB XML, click here.
9
+
10
+ If you were looking for the license that applies to Berkeley DB Java
11
+ Edition, click here.
12
+
13
+ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
14
+ /*
15
+ * Copyright (c) 1990, 2012 Oracle and/or its affiliates. All rights reserved.
16
+ *
17
+ * Redistribution and use in source and binary forms, with or without
18
+ * modification, are permitted provided that the following conditions
19
+ * are met:
20
+ * 1. Redistributions of source code must retain the above copyright
21
+ * notice, this list of conditions and the following disclaimer.
22
+ * 2. Redistributions in binary form must reproduce the above copyright
23
+ * notice, this list of conditions and the following disclaimer in the
24
+ * documentation and/or other materials provided with the distribution.
25
+ * 3. Redistributions in any form must be accompanied by information on
26
+ * how to obtain complete source code for the DB software and any
27
+ * accompanying software that uses the DB software. The source code
28
+ * must either be included in the distribution or be available for no
29
+ * more than the cost of distribution plus a nominal fee, and must be
30
+ * freely redistributable under reasonable conditions. For an
31
+ * executable file, complete source code means the source code for all
32
+ * modules it contains. It does not include source code for modules or
33
+ * files that typically accompany the major components of the operating
34
+ * system on which the executable file runs.
35
+ *
36
+ * THIS SOFTWARE IS PROVIDED BY ORACLE ``AS IS'' AND ANY EXPRESS OR
37
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
39
+ * NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL ORACLE BE LIABLE
40
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
41
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
42
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
43
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
45
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
46
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
+ */
48
+ /*
49
+ * Copyright (c) 1990, 1993, 1994, 1995
50
+ * The Regents of the University of California. All rights reserved.
51
+ *
52
+ * Redistribution and use in source and binary forms, with or without
53
+ * modification, are permitted provided that the following conditions
54
+ * are met:
55
+ * 1. Redistributions of source code must retain the above copyright
56
+ * notice, this list of conditions and the following disclaimer.
57
+ * 2. Redistributions in binary form must reproduce the above copyright
58
+ * notice, this list of conditions and the following disclaimer in the
59
+ * documentation and/or other materials provided with the distribution.
60
+ * 3. Neither the name of the University nor the names of its contributors
61
+ * may be used to endorse or promote products derived from this software
62
+ * without specific prior written permission.
63
+ *
64
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
65
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
66
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
67
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
68
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
69
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
70
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
71
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
72
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
73
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
74
+ * SUCH DAMAGE.
75
+ */
76
+ /*
77
+ * Copyright (c) 1995, 1996
78
+ * The President and Fellows of Harvard University. All rights reserved.
79
+ *
80
+ * Redistribution and use in source and binary forms, with or without
81
+ * modification, are permitted provided that the following conditions
82
+ * are met:
83
+ * 1. Redistributions of source code must retain the above copyright
84
+ * notice, this list of conditions and the following disclaimer.
85
+ * 2. Redistributions in binary form must reproduce the above copyright
86
+ * notice, this list of conditions and the following disclaimer in the
87
+ * documentation and/or other materials provided with the distribution.
88
+ * 3. Neither the name of the University nor the names of its contributors
89
+ * may be used to endorse or promote products derived from this software
90
+ * without specific prior written permission.
91
+ *
92
+ * THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS'' AND
93
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
95
+ * ARE DISCLAIMED. IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE
96
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
97
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
98
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
99
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
100
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
101
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
102
+ * SUCH DAMAGE.
103
+ */
104
+ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
105
+ /***
106
+ * ASM: a very small and fast Java bytecode manipulation framework
107
+ * Copyright (c) 2000-2005 INRIA, France Telecom
108
+ * All rights reserved.
109
+ *
110
+ * Redistribution and use in source and binary forms, with or without
111
+ * modification, are permitted provided that the following conditions
112
+ * are met:
113
+ * 1. Redistributions of source code must retain the above copyright
114
+ * notice, this list of conditions and the following disclaimer.
115
+ * 2. Redistributions in binary form must reproduce the above copyright
116
+ * notice, this list of conditions and the following disclaimer in the
117
+ * documentation and/or other materials provided with the distribution.
118
+ * 3. Neither the name of the copyright holders nor the names of its
119
+ * contributors may be used to endorse or promote products derived from
120
+ * this software without specific prior written permission.
121
+ *
122
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
123
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
124
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
125
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
126
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
127
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
128
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
129
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
130
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
131
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
132
+ * THE POSSIBILITY OF SUCH DAMAGE.
133
+ */
@@ -0,0 +1,183 @@
1
+ SUN PUBLIC LICENSE Version 1.0
2
+ 1. Definitions.
3
+ 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.
4
+
5
+ 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications.
6
+
7
+ 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
8
+
9
+ 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof and corresponding documentation released with the source code.
10
+
11
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data.
12
+
13
+ 1.5. "Executable" means Covered Code in any form other than Source Code.
14
+
15
+ 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
16
+
17
+ 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
18
+
19
+ 1.8. "License" means this document.
20
+
21
+ 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
22
+
23
+ 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
24
+
25
+ A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
26
+
27
+ B. Any new file that contains any part of the Original Code or previous Modifications.
28
+
29
+ 1.10. "Original Code"../ means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
30
+
31
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
32
+
33
+ 1.11. "Source Code"../ means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated documentation, interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
34
+
35
+ 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control"../ means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
36
+
37
+ 2. Source Code License.
38
+
39
+ 2.1 The Initial Developer Grant.
40
+
41
+ The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
42
+
43
+ (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
44
+
45
+ (b) under Patent Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
46
+
47
+ (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
48
+
49
+ (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
50
+
51
+ 2.2. Contributor Grant.
52
+
53
+ Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
54
+
55
+ (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
56
+
57
+ b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
58
+
59
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
60
+
61
+ (d) notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
62
+
63
+ 3. Distribution Obligations.
64
+
65
+ 3.1. Application of License.
66
+
67
+ The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
68
+
69
+ 3.2. Availability of Source Code.
70
+
71
+ Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
72
+
73
+ 3.3. Description of Modifications.
74
+
75
+ You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
76
+
77
+ 3.4. Intellectual Property Matters.
78
+
79
+ (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "../LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
80
+
81
+ (b) Contributor APIs.
82
+
83
+ If Contributor's Modifications include an application programming interface ("API"../) and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
84
+
85
+ (c) Representations.
86
+
87
+ Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License
88
+
89
+ .
90
+ 3.5. Required Notices.
91
+
92
+ You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
93
+
94
+ 3.6. Distribution of Executable Versions.
95
+
96
+ You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
97
+
98
+ 3.7. Larger Works.
99
+
100
+ You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
101
+
102
+ 4. Inability to Comply Due to Statute or Regulation.
103
+
104
+ If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
105
+
106
+ 5. Application of this License.
107
+
108
+ This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
109
+
110
+ 6. Versions of the License.
111
+
112
+ 6.1. New Versions. Sun Microsystems, Inc. ("Sun") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
113
+ 6.2. Effect of New Versions.
114
+
115
+ Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Sun. No one other than Sun has the right to modify the terms applicable to Covered Code created under this License.
116
+
117
+ 6.3. Derivative Works.
118
+
119
+ If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must: (a) rename Your license so that the phrases "Sun," "Sun Public License," or "SPL"../ or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Sun Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
120
+
121
+ 7. DISCLAIMER OF WARRANTY.
122
+
123
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "../AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
124
+
125
+ 8. TERMINATION.
126
+
127
+ 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
128
+
129
+ 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that:
130
+
131
+ (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
132
+
133
+ (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
134
+
135
+ 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
136
+
137
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
138
+
139
+ 9. LIMITATION OF LIABILITY.
140
+
141
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
142
+
143
+ 10. U.S. GOVERNMENT END USERS.
144
+
145
+ The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation,"../ as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
146
+
147
+ 11. MISCELLANEOUS.
148
+
149
+ This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
150
+
151
+ 12. RESPONSIBILITY FOR CLAIMS.
152
+
153
+ As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
154
+
155
+ 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as ?Multiple-Licensed?. ?Multiple-Licensed? means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
156
+
157
+ Exhibit A -Sun Public License Notice.
158
+
159
+ The contents of this file are subject to the Sun Public License
160
+ Version 1.0 (the License); you may not use this file except in
161
+ compliance with the License. A copy of the License is available at
162
+ http://www.sun.com/
163
+ The Original Code is _________________. The Initial Developer of the
164
+ Original Code is ___________. Portions created by ______ are Copyright
165
+ (C)_________. All Rights Reserved.
166
+
167
+ Contributor(s): ______________________________________.
168
+
169
+ Alternatively, the contents of this file may be used under the terms
170
+ of the _____ license (the ?[___] License?), in which case the
171
+ provisions of [______] License are applicable instead of those above.
172
+ If you wish to allow use of your version of this file only under the
173
+ terms of the [____] License and not to allow others to use your
174
+ version of this file under the SPL, indicate your decision by deleting
175
+ the provisions above and replace them with the notice and other
176
+ provisions required by the [___] License. If you do not delete the
177
+ provisions above, a recipient may use your version of this file under
178
+ either the SPL or the [___] License.
179
+
180
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
181
+ the notices in the Source Code files of the Original Code. You should
182
+ use the text of this Exhibit A rather than the text found in the
183
+ Original Code Source Code for Your Modifications.]
@@ -0,0 +1,13 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
@@ -0,0 +1,12 @@
1
+ require 'hashie/mash'
2
+
3
+ module LicenseAuto
4
+ class LicenseInfo < Hashie::Mash
5
+ attr_reader :licenses
6
+
7
+ def initialize(**args)
8
+ @licenses = args[:licenses]
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,100 @@
1
+ module LicenseAuto
2
+ module Matcher
3
+
4
+ ##
5
+ # Match all kinds of source_url by their regex patterns.
6
+ #
7
+ # The follow website URLs can get clear matched result:
8
+ # * https://github.com
9
+ # * https://bitbucket.org
10
+ # * https://rubygems.org
11
+ # * https://googlesource.com
12
+ # * https://code.google.com
13
+ # * https://gopkg.in
14
+ # * https://golang.org
15
+
16
+ class SourceURL
17
+
18
+ attr_reader :url
19
+
20
+ ##
21
+ # Struct a new matcher by url
22
+
23
+ def initialize(url)
24
+ @url = url
25
+ end
26
+
27
+ def match_github_resource()
28
+ matched = github_resource.match(@url)
29
+ end
30
+
31
+ def match_bitbucket_resource
32
+ matched = github_resource.match(@url)
33
+ end
34
+
35
+ private
36
+
37
+ ##
38
+ # vcs: Version Control System
39
+
40
+ # FIXME: @Cissy
41
+ def github_resource
42
+ # /(git\+)?(?<protocol>(http[s]?|git))(:\/\/|@)(?<host>(www\.)?github\.com)(\/|:)(?<owner>.+)\/(?<repo>[^\/.]+)(?<vcs>\.git)?/
43
+ /(git\+)?
44
+ (?<protocol>(http[s]?|git))
45
+ (:\/\/|@)
46
+ (?<host>(www\.)?github\.com)
47
+ (\/|:)
48
+ (?<owner>.+)\/
49
+ (?<repo>[^\/.]+)
50
+ (?<vcs>\.git)?/x
51
+ end
52
+
53
+ def bitbucket_resource
54
+ /(?<protocol>http[s]?):\/\/(?<host>bitbucket\.org)\/(?<owner>.+)\/(?<repo>.+)(?<vcs>\.git)?/
55
+ end
56
+ end
57
+
58
+
59
+ class FilepathName
60
+
61
+ attr_reader :name
62
+
63
+ LICENSE_PATTERN = /(((?<license_name>.*)[-_])?licen[sc]e|copying|copyright|copyleft)+/i
64
+ NOTICE_PATTERN = /notice/i
65
+ README_PATTERN = /readme(?<extension>\..*)?/i
66
+
67
+ ##
68
+ # Debian Linux doc:
69
+ # [4.2. copyright. Required files under the debian directory](https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#copyright)
70
+ DPKG_COPYRIGHT_PATTERN = /^[^\/]+\/debian\/copyright$/
71
+
72
+
73
+
74
+ def initialize(name)
75
+ @name = name
76
+ end
77
+
78
+ def match_license_file()
79
+ LICENSE_PATTERN.match(@name)
80
+ end
81
+
82
+ def match_readme_file()
83
+ README_PATTERN.match(@name)
84
+ end
85
+
86
+ def match_notice_file()
87
+ NOTICE_PATTERN.match(@name)
88
+ end
89
+
90
+ ##
91
+ # git ref: commit hash/branch/tag
92
+ def match_the_ref(ref)
93
+ version_pattern = /[vV]?#{@name.gsub(/\./, '\.').gsub(/\//, '\/')}$/i
94
+ version_pattern.match(ref)
95
+ end
96
+
97
+
98
+ end
99
+ end
100
+ end