tty 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -2
  3. data/.travis.yml +15 -4
  4. data/CHANGELOG.md +22 -0
  5. data/Gemfile +4 -7
  6. data/README.md +648 -58
  7. data/appveyor.yml +3 -4
  8. data/exe/teletype +18 -0
  9. data/lib/tty.rb +7 -4
  10. data/lib/tty/cli.rb +140 -0
  11. data/lib/tty/cmd.rb +132 -0
  12. data/lib/tty/commands/add.rb +321 -0
  13. data/lib/tty/commands/new.rb +256 -0
  14. data/lib/tty/gemspec.rb +30 -0
  15. data/lib/tty/licenses.rb +34 -0
  16. data/lib/tty/path_helpers.rb +38 -0
  17. data/lib/tty/plugins.rb +20 -12
  18. data/lib/tty/templater.rb +54 -0
  19. data/lib/tty/templates/add/command.rb.tt +31 -0
  20. data/lib/tty/templates/add/gitkeep.tt +1 -0
  21. data/lib/tty/templates/add/namespace.rb.tt +17 -0
  22. data/lib/tty/templates/add/spec/integration/command_spec.rb.tt +20 -0
  23. data/lib/tty/templates/add/spec/integration/sub_command_spec.rb.tt +16 -0
  24. data/lib/tty/templates/add/spec/unit/command_spec.rb.tt +15 -0
  25. data/lib/tty/templates/add/spec/unit/sub_command_spec.rb.tt +15 -0
  26. data/lib/tty/templates/add/test/integration/command_test.rb.tt +23 -0
  27. data/lib/tty/templates/add/test/integration/sub_command_test.rb.tt +19 -0
  28. data/lib/tty/templates/add/test/unit/command_test.rb.tt +16 -0
  29. data/lib/tty/templates/add/test/unit/sub_command_test.rb.tt +16 -0
  30. data/lib/tty/templates/new/agplv3_LICENSE.txt.tt +555 -0
  31. data/lib/tty/templates/new/apache_LICENSE.txt.tt +157 -0
  32. data/lib/tty/templates/new/bsd2_LICENSE.txt.tt +22 -0
  33. data/lib/tty/templates/new/bsd3_LICENSE.txt.tt +26 -0
  34. data/lib/tty/templates/new/exe/newcli.tt +18 -0
  35. data/lib/tty/templates/new/gitkeep.tt +1 -0
  36. data/lib/tty/templates/new/gplv2_LICENSE.txt.tt +255 -0
  37. data/lib/tty/templates/new/gplv3_LICENSE.txt.tt +543 -0
  38. data/lib/tty/templates/new/lgplv3_LICENSE.txt.tt +143 -0
  39. data/lib/tty/templates/new/lib/newcli/cli.rb.tt +24 -0
  40. data/lib/tty/templates/new/lib/newcli/command.rb.tt +124 -0
  41. data/lib/tty/templates/new/mit_LICENSE.txt.tt +20 -0
  42. data/lib/tty/templates/new/mplv2_LICENSE.txt.tt +277 -0
  43. data/lib/tty/version.rb +1 -1
  44. data/spec/fixtures/foo-0.0.1.gemspec +4 -4
  45. data/spec/integration/add_desc_args_spec.rb +341 -0
  46. data/spec/integration/add_force_spec.rb +98 -0
  47. data/spec/integration/add_namespaced_spec.rb +291 -0
  48. data/spec/integration/add_spec.rb +535 -0
  49. data/spec/integration/add_subcommand_spec.rb +259 -0
  50. data/spec/integration/new_author_spec.rb +19 -0
  51. data/spec/integration/new_license_spec.rb +39 -0
  52. data/spec/integration/new_namespaced_spec.rb +228 -0
  53. data/spec/integration/new_spec.rb +354 -0
  54. data/spec/integration/new_test_spec.rb +21 -0
  55. data/spec/integration/start_spec.rb +21 -0
  56. data/spec/spec_helper.rb +47 -16
  57. data/spec/unit/gemspec_spec.rb +17 -0
  58. data/spec/{tty/plugins/load_spec.rb → unit/plugins/activate_spec.rb} +2 -4
  59. data/spec/unit/plugins/load_from_spec.rb +28 -0
  60. data/spec/{tty → unit}/plugins/plugin/load_spec.rb +1 -3
  61. data/spec/{tty → unit}/plugins/plugin/new_spec.rb +1 -3
  62. data/spec/{tty → unit}/tty_spec.rb +1 -3
  63. data/tty.gemspec +25 -15
  64. metadata +186 -49
  65. data/spec/tty/plugins/find_spec.rb +0 -20
  66. data/tasks/metrics/cane.rake +0 -14
  67. data/tasks/metrics/flog.rake +0 -17
  68. data/tasks/metrics/heckle.rake +0 -15
  69. data/tasks/metrics/reek.rake +0 -13
@@ -0,0 +1,143 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+
3
+ Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc.
4
+ <http://fsf.org/>
5
+
6
+ Everyone is permitted to copy and distribute verbatim copies of this license
7
+ document, but changing it is not allowed.
8
+
9
+ This version of the GNU Lesser General Public License incorporates the terms and
10
+ conditions of version 3 of the GNU General Public License, supplemented by the
11
+ additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser General
16
+ Public License, and the "GNU GPL" refers to version 3 of the GNU General Public
17
+ License.
18
+
19
+ "The Library" refers to a covered work governed by this License, other than an
20
+ Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided by the
23
+ Library, but which is not otherwise based on the Library. Defining a subclass of
24
+ a class defined by the Library is deemed a mode of using an interface provided
25
+ by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an Application with
28
+ the Library. The particular version of the Library with which the Combined Work
29
+ was made is also called the "Linked Version".
30
+
31
+ The "Minimal Corresponding Source" for a Combined Work means the Corresponding
32
+ Source for the Combined Work, excluding any source code for portions of the
33
+ Combined Work that, considered in isolation, are based on the Application, and
34
+ not on the Linked Version.
35
+
36
+ The "Corresponding Application Code" for a Combined Work means the object code
37
+ and/or source code for the Application, including any data and utility programs
38
+ needed for reproducing the Combined Work from the Application, but excluding the
39
+ System Libraries of the Combined Work.
40
+
41
+ 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under
42
+ sections 3 and 4 of this License without being bound by section 3 of the GNU
43
+ GPL.
44
+
45
+ 2. Conveying Modified Versions. If you modify a copy of the Library, and, in
46
+ your modifications, a facility refers to a function or data to be supplied by an
47
+ Application that uses the facility (other than as an argument passed when the
48
+ facility is invoked), then you may convey a copy of the modified version:
49
+
50
+ a) under this License, provided that you make a good faith effort to ensure
51
+ that, in the event an Application does not supply the function or data, the
52
+ facility still operates, and performs whatever part of its purpose remains
53
+ meaningful, or
54
+
55
+ b) under the GNU GPL, with none of the additional permissions of this License
56
+ applicable to that copy.
57
+
58
+ 3. Object Code Incorporating Material from Library Header Files. The object
59
+ code form of an Application may incorporate material from a header file that is
60
+ part of the Library. You may convey such object code under terms of your choice,
61
+ provided that, if the incorporated material is not limited to numerical
62
+ parameters, data structure layouts and accessors, or small macros, inline
63
+ functions and templates (ten or fewer lines in length), you do both of the
64
+ following:
65
+
66
+ a) Give prominent notice with each copy of the object code that the Library is
67
+ used in it and that the Library and its use are covered by this License.
68
+
69
+ b) Accompany the object code with a copy of the GNU GPL and this license
70
+ document.
71
+
72
+ 4. Combined Works. You may convey a Combined Work under terms of your choice
73
+ that, taken together, effectively do not restrict modification of the portions
74
+ of the Library contained in the Combined Work and reverse engineering for
75
+ debugging such modifications, if you also do each of the following:
76
+
77
+ a) Give prominent notice with each copy of the Combined Work that the Library is
78
+ used in it and that the Library and its use are covered by this License.
79
+
80
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
81
+ document.
82
+
83
+ c) For a Combined Work that displays copyright notices during execution, include
84
+ the copyright notice for the Library among these notices, as well as a reference
85
+ directing the user to the copies of the GNU GPL and this license document.
86
+
87
+ d) Do one of the following:
88
+
89
+ 0) Convey the Minimal Corresponding Source under the terms of this License, and
90
+ the Corresponding Application Code in a form suitable for, and under terms that
91
+ permit, the user to recombine or relink the Application with a modified version
92
+ of the Linked Version to produce a modified Combined Work, in the manner
93
+ specified by section 6 of the GNU GPL for conveying Corresponding Source.
94
+
95
+ 1) Use a suitable shared library mechanism for linking with the Library. A
96
+ suitable mechanism is one that (a) uses at run time a copy of the Library
97
+ already present on the user's computer system, and (b) will operate properly
98
+ with a modified version of the Library that is interface-compatible with the
99
+ Linked Version.
100
+
101
+ e) Provide Installation Information, but only if you would otherwise be required
102
+ to provide such information under section 6 of the GNU GPL, and only to the
103
+ extent that such information is necessary to install and execute a modified
104
+ version of the Combined Work produced by recombining or relinking the
105
+ Application with a modified version of the Linked Version. (If you use option
106
+ 4d0, the Installation Information must accompany the Minimal Corresponding
107
+ Source and Corresponding Application Code. If you use option 4d1, you must
108
+ provide the Installation Information in the manner specified by section 6 of the
109
+ GNU GPL for conveying Corresponding Source.)
110
+
111
+ 5. Combined Libraries. You may place library facilities that are a work based
112
+ on the Library side by side in a single library together with other library
113
+ facilities that are not Applications and are not covered by this License, and
114
+ convey such a combined library under terms of your choice, if you do both of the
115
+ following:
116
+
117
+ a) Accompany the combined library with a copy of the same work based on the
118
+ Library, uncombined with any other library facilities, conveyed under the terms
119
+ of this License.
120
+
121
+ b) Give prominent notice with the combined library that part of it is a work
122
+ based on the Library, and explaining where to find the accompanying uncombined
123
+ form of the same work.
124
+
125
+ 6. Revised Versions of the GNU Lesser General Public License. The Free Software
126
+ Foundation may publish revised and/or new versions of the GNU Lesser General
127
+ Public License from time to time. Such new versions will be similar in spirit to
128
+ the present version, but may differ in detail to address new problems or
129
+ concerns.
130
+
131
+ Each version is given a distinguishing version number. If the Library as you
132
+ received it specifies that a certain numbered version of the GNU Lesser General
133
+ Public License "or any later version" applies to it, you have the option of
134
+ following the terms and conditions either of that published version or of any
135
+ later version published by the Free Software Foundation. If the Library as you
136
+ received it does not specify a version number of the GNU Lesser General Public
137
+ License, you may choose any version of the GNU Lesser General Public License
138
+ ever published by the Free Software Foundation.
139
+
140
+ If the Library as you received it specifies that a proxy can decide whether
141
+ future versions of the GNU Lesser General Public License shall apply, that
142
+ proxy's public statement of acceptance of any version is permanent authorization
143
+ for you to choose that version for the Library.
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+
5
+ <%- constantinized_parts.each_with_index do |const, i| -%>
6
+ <%= ' ' * i %>module <%= const %>
7
+ <%- end -%>
8
+ <%= indent %># Handle the application command line parsing
9
+ <%= indent %># and the dispatch to various command objects
10
+ <%= indent %>#
11
+ <%= indent %># @api public
12
+ <%= indent %>class CLI < Thor
13
+ <%= indent %> # Error raised by this runner
14
+ <%= indent %> Error = Class.new(StandardError)
15
+
16
+ <%= indent %> desc 'version', '<%= app_name %> version'
17
+ <%= indent %> def version
18
+ <%= indent %> require_relative 'version'
19
+ <%= indent %> puts "v#{<%= constantinized_name %>::VERSION}"
20
+ <%= indent %> end
21
+ <%= indent %> map %w(--version -v) => :version
22
+ <%- (constantinized_parts.size).downto(0) do |i| -%>
23
+ <%= ' ' * i %>end
24
+ <%- end -%>
@@ -0,0 +1,124 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'forwardable'
4
+
5
+ <%- constantinized_parts.each_with_index do |const, i| -%>
6
+ <%= ' ' * i %>module <%= const %>
7
+ <%- end -%>
8
+ <%= indent %>class Command
9
+ <%= indent %> extend Forwardable
10
+
11
+ <%= indent %> def_delegators :command, :run
12
+
13
+ <%= indent %> # Execute this command
14
+ <%= indent %> #
15
+ <%= indent %> # @api public
16
+ <%= indent %> def execute(*)
17
+ <%= indent %> raise(
18
+ <%= indent %> NotImplementedError,
19
+ <%= indent %> "#{self.class}##{__method__} must be implemented"
20
+ <%= indent %> )
21
+ <%= indent %> end
22
+
23
+ <%= indent %> # The external commands runner
24
+ <%= indent %> #
25
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-command
26
+ <%= indent %> #
27
+ <%= indent %> # @api public
28
+ <%= indent %> def command(**options)
29
+ <%= indent %> require 'tty-command'
30
+ <%= indent %> TTY::Command.new(options)
31
+ <%= indent %> end
32
+
33
+ <%= indent %> # The cursor movement
34
+ <%= indent %> #
35
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-cursor
36
+ <%= indent %> #
37
+ <%= indent %> # @api public
38
+ <%= indent %> def cursor
39
+ <%= indent %> require 'tty-cursor'
40
+ <%= indent %> TTY::Cursor
41
+ <%= indent %> end
42
+
43
+ <%= indent %> # Open a file or text in the user's preferred editor
44
+ <%= indent %> #
45
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-editor
46
+ <%= indent %> #
47
+ <%= indent %> # @api public
48
+ <%= indent %> def editor
49
+ <%= indent %> require 'tty-editor'
50
+ <%= indent %> TTY::Editor
51
+ <%= indent %> end
52
+
53
+ <%= indent %> # File manipulation utility methods
54
+ <%= indent %> #
55
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-file
56
+ <%= indent %> #
57
+ <%= indent %> # @api public
58
+ <%= indent %> def generator
59
+ <%= indent %> require 'tty-file'
60
+ <%= indent %> TTY::File
61
+ <%= indent %> end
62
+
63
+ <%= indent %> # Terminal output paging
64
+ <%= indent %> #
65
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-pager
66
+ <%= indent %> #
67
+ <%= indent %> # @api public
68
+ <%= indent %> def pager(**options)
69
+ <%= indent %> require 'tty-pager'
70
+ <%= indent %> TTY::Pager.new(options)
71
+ <%= indent %> end
72
+
73
+ <%= indent %> # Terminal platform and OS properties
74
+ <%= indent %> #
75
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-pager
76
+ <%= indent %> #
77
+ <%= indent %> # @api public
78
+ <%= indent %> def platform
79
+ <%= indent %> require 'tty-platform'
80
+ <%= indent %> TTY::Platform.new
81
+ <%= indent %> end
82
+
83
+ <%= indent %> # The interactive prompt
84
+ <%= indent %> #
85
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-prompt
86
+ <%= indent %> #
87
+ <%= indent %> # @api public
88
+ <%= indent %> def prompt(**options)
89
+ <%= indent %> require 'tty-prompt'
90
+ <%= indent %> TTY::Prompt.new(options)
91
+ <%= indent %> end
92
+
93
+ <%= indent %> # Get terminal screen properties
94
+ <%= indent %> #
95
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-screen
96
+ <%= indent %> #
97
+ <%= indent %> # @api public
98
+ <%= indent %> def screen
99
+ <%= indent %> require 'tty-screen'
100
+ <%= indent %> TTY::Screen
101
+ <%= indent %> end
102
+
103
+ <%= indent %> # The unix which utility
104
+ <%= indent %> #
105
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-which
106
+ <%= indent %> #
107
+ <%= indent %> # @api public
108
+ <%= indent %> def which(*args)
109
+ <%= indent %> require 'tty-which'
110
+ <%= indent %> TTY::Which.which(*args)
111
+ <%= indent %> end
112
+
113
+ <%= indent %> # Check if executable exists
114
+ <%= indent %> #
115
+ <%= indent %> # @see http://www.rubydoc.info/gems/tty-which
116
+ <%= indent %> #
117
+ <%= indent %> # @api public
118
+ <%= indent %> def exec_exist?(*args)
119
+ <%= indent %> require 'tty-which'
120
+ <%= indent %> TTY::Which.exist?(*args)
121
+ <%= indent %> end
122
+ <%- (constantinized_parts.size).downto(0) do |i| -%>
123
+ <%= ' ' * i %>end
124
+ <%- end -%>
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) <%= Time.now.year %> <%= author %>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,277 @@
1
+ Mozilla Public License Version 2.0
2
+
3
+ 1. Definitions
4
+
5
+ 1.1. "Contributor" means each individual or legal entity that creates,
6
+ contributes to the creation of, or owns Covered Software.
7
+
8
+ 1.2. "Contributor Version" means the combination of the Contributions of others
9
+ (if any) used by a Contributor and that particular Contributor's Contribution.
10
+
11
+ 1.3. "Contribution" means Covered Software of a particular Contributor.
12
+
13
+ 1.4. "Covered Software" means Source Code Form to which the initial Contributor
14
+ has attached the notice in Exhibit A, the Executable Form of such Source Code
15
+ Form, and Modifications of such Source Code Form, in each case including
16
+ portions thereof.
17
+
18
+ 1.5. "Incompatible With Secondary Licenses" means
19
+
20
+ (a) that the initial Contributor has attached the notice described in Exhibit B
21
+ to the Covered Software; or
22
+
23
+ (b) that the Covered Software was made available under the terms of version 1.1
24
+ or earlier of the License, but not also under the terms of a Secondary License.
25
+
26
+ 1.6. "Executable Form" means any form of the work other than Source Code Form.
27
+
28
+ 1.7. "Larger Work" means a work that combines Covered Software with other
29
+ material, in a separate file or files, that is not Covered Software.
30
+
31
+ 1.8. "License" means this document.
32
+
33
+ 1.9. "Licensable" means having the right to grant, to the maximum extent
34
+ possible, whether at the time of the initial grant or subsequently, any and all
35
+ of the rights conveyed by this License.
36
+
37
+ 1.10. "Modifications" means any of the following:
38
+
39
+ (a) any file in Source Code Form that results from an addition to, deletion
40
+ from, or modification of the contents of Covered Software; or
41
+
42
+ (b) any new file in Source Code Form that contains any Covered Software.
43
+
44
+ 1.11. "Patent Claims" of a Contributor means any patent claim(s), including
45
+ without limitation, method, process, and apparatus claims, in any patent
46
+ Licensable by such Contributor that would be infringed, but for the grant of the
47
+ License, by the making, using, selling, offering for sale, having made, import,
48
+ or transfer of either its Contributions or its Contributor Version.
49
+
50
+ 1.12. "Secondary License" means either the GNU General Public License, Version
51
+ 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General
52
+ Public License, Version 3.0, or any later versions of those licenses.
53
+
54
+ 1.13. "Source Code Form" means the form of the work preferred for making
55
+ modifications.
56
+
57
+ 1.14. "You" (or "Your") means an individual or a legal entity exercising rights
58
+ under this License. For legal entities, "You" includes any entity that controls,
59
+ is controlled by, or is under common control with You. For purposes of this
60
+ definition, "control" means (a) the power, direct or indirect, to cause the
61
+ direction or management of such entity, whether by contract or otherwise, or (b)
62
+ ownership of more than fifty percent (50%) of the outstanding shares or
63
+ beneficial ownership of such entity.
64
+
65
+ 2. License Grants and Conditions
66
+
67
+ 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free,
68
+ non-exclusive license:
69
+
70
+ (a) under intellectual property rights (other than patent or trademark)
71
+ Licensable by such Contributor to use, reproduce, make available, modify,
72
+ display, perform, distribute, and otherwise exploit its Contributions, either on
73
+ an unmodified basis, with Modifications, or as part of a Larger Work; and
74
+
75
+ (b) under Patent Claims of such Contributor to make, use, sell, offer for sale,
76
+ have made, import, and otherwise transfer either its Contributions or its
77
+ Contributor Version.
78
+
79
+ 2.2. Effective Date The licenses granted in Section 2.1 with respect to any
80
+ Contribution become effective for each Contribution on the date the Contributor
81
+ first distributes such Contribution.
82
+
83
+ 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the
84
+ only rights granted under this License. No additional rights or licenses will be
85
+ implied from the distribution or licensing of Covered Software under this
86
+ License. Notwithstanding Section 2.1(b) above, no patent license is granted by a
87
+ Contributor:
88
+
89
+ (a) for any code that a Contributor has removed from Covered Software; or
90
+
91
+ (b) for infringements caused by: (i) Your and any other third party's
92
+ modifications of Covered Software, or (ii) the combination of its Contributions
93
+ with other software (except as part of its Contributor Version); or
94
+
95
+ (c) under Patent Claims infringed by Covered Software in the absence of its
96
+ Contributions.
97
+
98
+ This License does not grant any rights in the trademarks, service marks, or
99
+ logos of any Contributor (except as may be necessary to comply with the notice
100
+ requirements in Section 3.4).
101
+
102
+ 2.4. Subsequent Licenses No Contributor makes additional grants as a result of
103
+ Your choice to distribute the Covered Software under a subsequent version of
104
+ this License (see Section 10.2) or under the terms of a Secondary License (if
105
+ permitted under the terms of Section 3.3).
106
+
107
+ 2.5. Representation Each Contributor represents that the Contributor believes
108
+ its Contributions are its original creation(s) or it has sufficient rights to
109
+ grant the rights to its Contributions conveyed by this License.
110
+
111
+ 2.6. Fair Use This License is not intended to limit any rights You have under
112
+ applicable copyright doctrines of fair use, fair dealing, or other equivalents.
113
+
114
+ 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses
115
+ granted in Section 2.1.
116
+
117
+ 3. Responsibilities
118
+
119
+ 3.1. Distribution of Source Form All distribution of Covered Software in Source
120
+ Code Form, including any Modifications that You create or to which You
121
+ contribute, must be under the terms of this License. You must inform recipients
122
+ that the Source Code Form of the Covered Software is governed by the terms of
123
+ this License, and how they can obtain a copy of this License. You may not
124
+ attempt to alter or restrict the recipients' rights in the Source Code Form.
125
+
126
+ 3.2. Distribution of Executable Form If You distribute Covered Software in
127
+ Executable Form then:
128
+
129
+ (a) such Covered Software must also be made available in Source Code Form, as
130
+ described in Section 3.1, and You must inform recipients of the Executable Form
131
+ how they can obtain a copy of such Source Code Form by reasonable means in a
132
+ timely manner, at a charge no more than the cost of distribution to the
133
+ recipient; and
134
+
135
+ (b) You may distribute such Executable Form under the terms of this License, or
136
+ sublicense it under different terms, provided that the license for the
137
+ Executable Form does not attempt to limit or alter the recipients' rights in the
138
+ Source Code Form under this License.
139
+
140
+ 3.3. Distribution of a Larger Work You may create and distribute a Larger Work
141
+ under terms of Your choice, provided that You also comply with the requirements
142
+ of this License for the Covered Software. If the Larger Work is a combination of
143
+ Covered Software with a work governed by one or more Secondary Licenses, and the
144
+ Covered Software is not Incompatible With Secondary Licenses, this License
145
+ permits You to additionally distribute such Covered Software under the terms of
146
+ such Secondary License(s), so that the recipient of the Larger Work may, at
147
+ their option, further distribute the Covered Software under the terms of either
148
+ this License or such Secondary License(s).
149
+
150
+ 3.4. Notices You may not remove or alter the substance of any license notices
151
+ (including copyright notices, patent notices, disclaimers of warranty, or
152
+ limitations of liability) contained within the Source Code Form of the Covered
153
+ Software, except that You may alter any license notices to the extent required
154
+ to remedy known factual inaccuracies.
155
+
156
+ 3.5. Application of Additional Terms You may choose to offer, and to charge a
157
+ fee for, warranty, support, indemnity or liability obligations to one or more
158
+ recipients of Covered Software. However, You may do so only on Your own behalf,
159
+ and not on behalf of any Contributor. You must make it absolutely clear that any
160
+ such warranty, support, indemnity, or liability obligation is offered by You
161
+ alone, and You hereby agree to indemnify every Contributor for any liability
162
+ incurred by such Contributor as a result of warranty, support, indemnity or
163
+ liability terms You offer. You may include additional disclaimers of warranty
164
+ and limitations of liability specific to any jurisdiction.
165
+
166
+ 4. Inability to Comply Due to Statute or Regulation If it is impossible for You
167
+ to comply with any of the terms of this License with respect to some or all of
168
+ the Covered Software due to statute, judicial order, or regulation then You
169
+ must: (a) comply with the terms of this License to the maximum extent possible;
170
+ and (b) describe the limitations and the code they affect. Such description must
171
+ be placed in a text file included with all distributions of the Covered Software
172
+ under this License. Except to the extent prohibited by statute or regulation,
173
+ such description must be sufficiently detailed for a recipient of ordinary skill
174
+ to be able to understand it.
175
+
176
+ 5. Termination
177
+
178
+ 5.1. The rights granted under this License will terminate automatically if You
179
+ fail to comply with any of its terms. However, if You become compliant, then the
180
+ rights granted under this License from a particular Contributor are reinstated
181
+ (a) provisionally, unless and until such Contributor explicitly and finally
182
+ terminates Your grants, and (b) on an ongoing basis, if such Contributor fails
183
+ to notify You of the non-compliance by some reasonable means prior to 60 days
184
+ after You have come back into compliance. Moreover, Your grants from a
185
+ particular Contributor are reinstated on an ongoing basis if such Contributor
186
+ notifies You of the non-compliance by some reasonable means, this is the first
187
+ time You have received notice of non-compliance with this License from such
188
+ Contributor, and You become compliant prior to 30 days after Your receipt of the
189
+ notice.
190
+
191
+ 5.2. If You initiate litigation against any entity by asserting a patent
192
+ infringement claim (excluding declaratory judgment actions, counter-claims, and
193
+ cross-claims) alleging that a Contributor Version directly or indirectly
194
+ infringes any patent, then the rights granted to You by any and all Contributors
195
+ for the Covered Software under Section 2.1 of this License shall terminate.
196
+
197
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
198
+ license agreements (excluding distributors and resellers) which have been
199
+ validly granted by You or Your distributors under this License prior to
200
+ termination shall survive termination.
201
+
202
+ 6. Disclaimer of Warranty Covered Software is provided under this License on an
203
+ "as is" basis, without warranty of any kind, either expressed, implied, or
204
+ statutory, including, without limitation, warranties that the Covered Software
205
+ is free of defects, merchantable, fit for a particular purpose or
206
+ non-infringing. The entire risk as to the quality and performance of the Covered
207
+ Software is with You. Should any Covered Software prove defective in any
208
+ respect, You (not any Contributor) assume the cost of any necessary servicing,
209
+ repair, or correction. This disclaimer of warranty constitutes an essential part
210
+ of this License. No use of any Covered Software is authorized under this License
211
+ except under this disclaimer.
212
+
213
+ 7. Limitation of Liability Under no circumstances and under no legal theory,
214
+ whether tort (including negligence), contract, or otherwise, shall any
215
+ Contributor, or anyone who distributes Covered Software as permitted above, be
216
+ liable to You for any direct, indirect, special, incidental, or consequential
217
+ damages of any character including, without limitation, damages for lost
218
+ profits, loss of goodwill, work stoppage, computer failure or malfunction, or
219
+ any and all other commercial damages or losses, even if such party shall have
220
+ been informed of the possibility of such damages. This limitation of liability
221
+ shall not apply to liability for death or personal injury resulting from such
222
+ party's negligence to the extent applicable law prohibits such limitation. Some
223
+ jurisdictions do not allow the exclusion or limitation of incidental or
224
+ consequential damages, so this exclusion and limitation may not apply to You.
225
+
226
+ 8. Litigation Any litigation relating to this License may be brought only in the
227
+ courts of a jurisdiction where the defendant maintains its principal place of
228
+ business and such litigation shall be governed by laws of that jurisdiction,
229
+ without reference to its conflict-of-law provisions. Nothing in this Section
230
+ shall prevent a party's ability to bring cross-claims or counter-claims.
231
+
232
+ 9. Miscellaneous This License represents the complete agreement concerning the
233
+ subject matter hereof. If any provision of this License is held to be
234
+ unenforceable, such provision shall be reformed only to the extent necessary to
235
+ make it enforceable. Any law or regulation which provides that the language of a
236
+ contract shall be construed against the drafter shall not be used to construe
237
+ this License against a Contributor.
238
+
239
+ 10. Versions of the License
240
+
241
+ 10.1. New Versions Mozilla Foundation is the license steward. Except as provided
242
+ in Section 10.3, no one other than the license steward has the right to modify
243
+ or publish new versions of this License. Each version will be given a
244
+ distinguishing version number.
245
+
246
+ 10.2. Effect of New Versions You may distribute the Covered Software under the
247
+ terms of the version of the License under which You originally received the
248
+ Covered Software, or under the terms of any subsequent version published by the
249
+ license steward.
250
+
251
+ 10.3. Modified Versions If you create software not governed by this License, and
252
+ you want to create a new license for such software, you may create and use a
253
+ modified version of this License if you rename the license and remove any
254
+ references to the name of the license steward (except to note that such modified
255
+ license differs from this License).
256
+
257
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
258
+ If You choose to distribute Source Code Form that is Incompatible With Secondary
259
+ Licenses under the terms of this version of the License, the notice described in
260
+ Exhibit B of this License must be attached.
261
+
262
+ Exhibit A - Source Code Form License Notice
263
+
264
+ This Source Code Form is subject to the terms of the Mozilla Public License, v.
265
+ 2.0. If a copy of the MPL was not distributed with this file, You can obtain one
266
+ at http://mozilla.org/MPL/2.0/.
267
+
268
+ If it is not possible or desirable to put the notice in a particular file, then
269
+ You may include the notice in a location (such as a LICENSE file in a relevant
270
+ directory) where a recipient would be likely to look for such a notice.
271
+
272
+ You may add additional accurate notices of copyright ownership.
273
+
274
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
275
+
276
+ This Source Code Form is "Incompatible With Secondary Licenses", as defined by
277
+ the Mozilla Public License, v. 2.0.