license-generator 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +14 -1
- data/features/generate_license.feature +7 -2
- data/lib/license-generator/app.rb +2 -0
- data/lib/license-generator/version.rb +1 -1
- data/spec/app_spec.rb +1 -1
- data/templates/afl-3.0.erb +1 -1
- data/templates/apache-2.0.erb +1 -1
- data/templates/bsd.erb +1 -1
- data/templates/gpl-1.0.erb +1 -1
- data/templates/gpl-2.0.erb +1 -1
- data/templates/gpl-3.0.erb +1 -1
- data/templates/mit.erb +1 -1
- data/templates/mozilla-2.0.erb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,12 +8,16 @@ Generate an open source license for your projects.
|
|
8
8
|
|
9
9
|
## Usage:
|
10
10
|
|
11
|
-
licgen [
|
11
|
+
licgen <license> [<author1>, [<author2> ...]]
|
12
12
|
|
13
13
|
Too see the available license templates:
|
14
14
|
|
15
15
|
licgen list
|
16
16
|
|
17
|
+
## Available licenses
|
18
|
+
|
19
|
+
They are provided in the gem as [templates](templates/).
|
20
|
+
|
17
21
|
### Please add some!
|
18
22
|
|
19
23
|
There are a lot. See <http://www.opensource.org/licenses/alphabetical>.
|
@@ -26,12 +30,21 @@ can also prompt the user for input like this:
|
|
26
30
|
|
27
31
|
<%= option(:name) %>
|
28
32
|
|
33
|
+
Since author name will be needed for almost all templates, a special template
|
34
|
+
variable is provided:
|
35
|
+
|
36
|
+
<%= authors %>
|
37
|
+
|
38
|
+
If authors are not specified on the command line, it will prompt the user.
|
39
|
+
|
29
40
|
## Credits
|
30
41
|
|
31
42
|
* Bill Evans ([@thirteenpixels][1]) for help naming the binary and pushing to make
|
32
43
|
it not hard to add templates.
|
33
44
|
* Dayton Nolan ([@daytonn][2]) for fixes and new templates.
|
45
|
+
* Leszek Rybicki ([@leszekr][3]) for new templates.
|
34
46
|
|
35
47
|
|
36
48
|
[1]: https://github.com/thirteenpixels
|
37
49
|
[2]: https://github.com/daytonn
|
50
|
+
[3]: https://github.com/leszekr
|
@@ -3,7 +3,7 @@ Feature: Generate a License
|
|
3
3
|
As an open source developer
|
4
4
|
I want to generate a LICENSE file in my project
|
5
5
|
|
6
|
-
Scenario: Run
|
6
|
+
Scenario: Run without authors
|
7
7
|
When I run `licgen bsd` interactively
|
8
8
|
And I type "Justin Blake"
|
9
9
|
And I type "Hentzia"
|
@@ -11,7 +11,12 @@ Feature: Generate a License
|
|
11
11
|
And the file "LICENSE" should contain a copyright notice for "Justin Blake"
|
12
12
|
And the file "LICENSE" should contain "Neither the name of Hentzia nor the names of its"
|
13
13
|
|
14
|
-
|
14
|
+
Scenario: Run with authors
|
15
|
+
When I run `licgen bsd "James Pearson"` interactively
|
16
|
+
And I type "Hentzia"
|
17
|
+
Then a file named "LICENSE" should exist
|
18
|
+
And the file "LICENSE" should contain a copyright notice for "James Pearson"
|
19
|
+
And the file "LICENSE" should contain "Neither the name of Hentzia nor the names of its"
|
15
20
|
|
16
21
|
@wip
|
17
22
|
Scenario: Bad template name
|
@@ -3,6 +3,7 @@ require 'thor'
|
|
3
3
|
module LicenseGenerator
|
4
4
|
class App < Thor
|
5
5
|
include Thor::Actions
|
6
|
+
attr_accessor :authors
|
6
7
|
|
7
8
|
# Path to the templates
|
8
9
|
def self.source_root
|
@@ -17,6 +18,7 @@ module LicenseGenerator
|
|
17
18
|
end
|
18
19
|
|
19
20
|
def method_missing(meth, *args)
|
21
|
+
self.authors = args.empty? ? option(:authors) : args.join(', ')
|
20
22
|
template "#{meth}.erb", "LICENSE"
|
21
23
|
end
|
22
24
|
|
data/spec/app_spec.rb
CHANGED
data/templates/afl-3.0.erb
CHANGED
data/templates/apache-2.0.erb
CHANGED
@@ -187,7 +187,7 @@
|
|
187
187
|
same "printed page" as the copyright notice for easier
|
188
188
|
identification within third-party archives.
|
189
189
|
|
190
|
-
Copyright <%= Time.now.year %> <%=
|
190
|
+
Copyright <%= Time.now.year %> <%= authors %>
|
191
191
|
|
192
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
193
193
|
you may not use this file except in compliance with the License.
|
data/templates/bsd.erb
CHANGED
data/templates/gpl-1.0.erb
CHANGED
data/templates/gpl-2.0.erb
CHANGED
data/templates/gpl-3.0.erb
CHANGED
data/templates/mit.erb
CHANGED
data/templates/mozilla-2.0.erb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: license-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02
|
12
|
+
date: 2013-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
segments:
|
143
143
|
- 0
|
144
|
-
hash:
|
144
|
+
hash: -3349718527898348751
|
145
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
146
|
none: false
|
147
147
|
requirements:
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
segments:
|
152
152
|
- 0
|
153
|
-
hash:
|
153
|
+
hash: -3349718527898348751
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project: license-generator
|
156
156
|
rubygems_version: 1.8.25
|