opensource 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.md +10 -0
- data/LICENSE +2 -2
- data/README.md +13 -8
- data/bin/opensource +15 -9
- data/lib/{opensource.rb → open_source.rb} +5 -5
- data/lib/{opensource → open_source}/error.rb +1 -1
- data/lib/{opensource → open_source}/license.rb +3 -4
- data/lib/{opensource → open_source}/owner.rb +3 -1
- data/lib/open_source/version.rb +3 -0
- data/opensource.gemspec +4 -4
- data/templates/bsd.erb +2 -2
- metadata +13 -11
- data/CHANGELOG.md +0 -0
- data/lib/opensource/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39b285b8f211a3ed4f00eb494c290fd31e4bd137
|
4
|
+
data.tar.gz: f738ac1de6cc359ab5fcc93823ac25d9f44ed1a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3f8725c004f4a8b509ec68edf5e081f5a4bba2f937475f3703e296dc1b84d30c75dee031bd968420d4ff8a567eb607ce7f8bd685c037f998ed761df6ffe1a8f
|
7
|
+
data.tar.gz: 10ebdf67b1bad3493841a0d67c63754d7d7c23be313f35a267a940bca8bd7aa150d6f43fb1336da4152c5c1bf290983825ceaefd3ffd948cf95e92b748dc8947
|
data/History.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
0.6.1 / 2015-05-31
|
3
|
+
==================
|
4
|
+
|
5
|
+
* rename opensource -> open_source
|
6
|
+
* update copyright year
|
7
|
+
* Refactor getting credentials code
|
8
|
+
* Handle missing arguments error. Closes #8
|
9
|
+
* Add supported list of licences
|
10
|
+
* fix missing vars in bsd 3-clause license
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(The MIT License)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2015 Mohnish Thallavajhula <i@mohni.sh>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
6
|
a copy of this software and associated documentation files (the
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
19
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
20
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
21
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
|
-
|
1
|
+
# OpenSource
|
2
2
|
|
3
|
-
|
3
|
+
[](https://codeclimate.com/github/mohnish/opensource.rb)
|
4
|
+
|
5
|
+
Command line tool that lets you add an open source license to your project by running a simple command.
|
6
|
+
|
7
|
+
## Supported Licenses
|
8
|
+
|
9
|
+
- MIT
|
10
|
+
- Apache 2
|
11
|
+
- BSD 3 Clause
|
12
|
+
- GPL 3
|
4
13
|
|
5
14
|
## Installation
|
6
15
|
|
@@ -24,7 +33,7 @@ Usage: opensource OPTIONS
|
|
24
33
|
|
25
34
|
Specific options:
|
26
35
|
-s, --setup Setup user credentials in ~/.osrc file
|
27
|
-
-l, --license LICENSE LICENSE can be mit
|
36
|
+
-l, --license LICENSE LICENSE can be apache2|bsd|gpl3|mit
|
28
37
|
-a, --append README Append LICENSE content to README file
|
29
38
|
|
30
39
|
Common options:
|
@@ -32,15 +41,11 @@ Common options:
|
|
32
41
|
-h, --help Show this message
|
33
42
|
```
|
34
43
|
|
35
|
-
### TODO
|
36
|
-
|
37
|
-
- Currently only MIT is supported. Need to add support for other open source licenses like Apache, GPL, BSD etc
|
38
|
-
|
39
44
|
## License
|
40
45
|
|
41
46
|
(The MIT License)
|
42
47
|
|
43
|
-
Copyright (c)
|
48
|
+
Copyright (c) 2015 Mohnish Thallavajhula <i@mohni.sh>
|
44
49
|
|
45
50
|
Permission is hereby granted, free of charge, to any person obtaining
|
46
51
|
a copy of this software and associated documentation files (the
|
data/bin/opensource
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
# encoding: UTF-8
|
3
3
|
|
4
4
|
require 'optparse'
|
5
|
-
|
5
|
+
require 'open_source'
|
6
6
|
|
7
7
|
options = {}
|
8
8
|
|
9
|
-
OptionParser.new do |opts|
|
9
|
+
option_parser = OptionParser.new do |opts|
|
10
10
|
opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} OPTIONS"
|
11
11
|
opts.separator ''
|
12
12
|
opts.separator 'Specific options:'
|
13
13
|
|
14
14
|
opts.on('-s', '--setup', 'Setup user credentials in ~/.osrc file') do |s|
|
15
|
-
|
15
|
+
OpenSource::Owner.set_credentials
|
16
16
|
exit
|
17
17
|
end
|
18
18
|
|
19
|
-
opts.on('-l', '--license LICENSE',
|
19
|
+
opts.on('-l', '--license LICENSE', OpenSource::LICENSES, "LICENSE can be #{OpenSource::LICENSES.join('|')}") do |l|
|
20
20
|
options[:license] = l
|
21
21
|
end
|
22
22
|
|
@@ -28,7 +28,7 @@ OptionParser.new do |opts|
|
|
28
28
|
opts.separator 'Common options:'
|
29
29
|
|
30
30
|
opts.on_tail('-v', '--version', 'Print the version') do
|
31
|
-
puts
|
31
|
+
puts OpenSource::VERSION
|
32
32
|
exit
|
33
33
|
end
|
34
34
|
|
@@ -36,12 +36,18 @@ OptionParser.new do |opts|
|
|
36
36
|
puts opts
|
37
37
|
exit
|
38
38
|
end
|
39
|
-
end
|
39
|
+
end
|
40
40
|
|
41
41
|
begin
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
option_parser.parse!
|
43
|
+
if options.empty?
|
44
|
+
puts option_parser
|
45
|
+
exit 1
|
46
|
+
end
|
47
|
+
|
48
|
+
OpenSource::License.new(options).process
|
49
|
+
rescue OpenSource::Error => e
|
50
|
+
# TODO: Make sure the above call raises only OpenSource::Error
|
45
51
|
puts "Error: #{e.message}"
|
46
52
|
exit 1
|
47
53
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
require 'open_source/version'
|
2
|
+
require 'open_source/error'
|
3
|
+
require 'open_source/owner'
|
4
|
+
require 'open_source/license'
|
5
5
|
|
6
|
-
module
|
6
|
+
module OpenSource
|
7
7
|
LICENSES = Dir.entries(File.expand_path("../../templates", __FILE__)).map do |filename|
|
8
8
|
File.basename(filename, '.erb') if !['.', '..'].include?(filename)
|
9
9
|
end.compact
|
@@ -1,11 +1,10 @@
|
|
1
1
|
require 'erb'
|
2
2
|
|
3
|
-
module
|
3
|
+
module OpenSource
|
4
4
|
class License
|
5
5
|
def initialize(options)
|
6
6
|
@options = options
|
7
7
|
@user = Owner.get_credentials
|
8
|
-
@user['escaped_email'] = "<#{@user['email']}>"
|
9
8
|
@license = ERB.new(File.read("#{File.expand_path("../../../templates", __FILE__)}/#{@options[:license]}.erb")).result(binding)
|
10
9
|
end
|
11
10
|
|
@@ -14,7 +13,7 @@ module Opensource
|
|
14
13
|
append if @options[:append]
|
15
14
|
end
|
16
15
|
|
17
|
-
|
16
|
+
private
|
18
17
|
def generate
|
19
18
|
f = File.new("#{Dir.pwd}/LICENSE", "w")
|
20
19
|
f.write(@license)
|
@@ -27,4 +26,4 @@ module Opensource
|
|
27
26
|
end
|
28
27
|
end
|
29
28
|
end
|
30
|
-
end
|
29
|
+
end
|
data/opensource.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'open_source/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "opensource"
|
8
|
-
spec.version =
|
8
|
+
spec.version = OpenSource::VERSION
|
9
9
|
spec.authors = ["Mohnish Thallavajhula"]
|
10
10
|
spec.email = ["i@mohni.sh"]
|
11
|
-
spec.summary = %q{
|
12
|
-
spec.description = %q{
|
11
|
+
spec.summary = %q{Command line tool that lets you add an open source license to your project by running a simple command}
|
12
|
+
spec.description = %q{Command line tool that lets you add an open source license to your project by running a simple command}
|
13
13
|
spec.homepage = "https://github.com/mohnish/opensource.rb"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/templates/bsd.erb
CHANGED
@@ -8,14 +8,14 @@ modification, are permitted provided that the following conditions are met:
|
|
8
8
|
* Redistributions in binary form must reproduce the above copyright
|
9
9
|
notice, this list of conditions and the following disclaimer in the
|
10
10
|
documentation and/or other materials provided with the distribution.
|
11
|
-
* Neither the name of
|
11
|
+
* Neither the name of <%= @user['name'] %> nor the
|
12
12
|
names of its contributors may be used to endorse or promote products
|
13
13
|
derived from this software without specific prior written permission.
|
14
14
|
|
15
15
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
16
16
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
17
17
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18
|
-
DISCLAIMED. IN NO EVENT SHALL
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL <%= @user['name'].upcase %> BE LIABLE FOR ANY
|
19
19
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
20
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
21
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opensource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mohnish Thallavajhula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,8 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description:
|
41
|
+
description: Command line tool that lets you add an open source license to your project
|
42
|
+
by running a simple command
|
42
43
|
email:
|
43
44
|
- i@mohni.sh
|
44
45
|
executables:
|
@@ -47,17 +48,17 @@ extensions: []
|
|
47
48
|
extra_rdoc_files: []
|
48
49
|
files:
|
49
50
|
- ".gitignore"
|
50
|
-
- CHANGELOG.md
|
51
51
|
- Gemfile
|
52
|
+
- History.md
|
52
53
|
- LICENSE
|
53
54
|
- README.md
|
54
55
|
- Rakefile
|
55
56
|
- bin/opensource
|
56
|
-
- lib/
|
57
|
-
- lib/
|
58
|
-
- lib/
|
59
|
-
- lib/
|
60
|
-
- lib/
|
57
|
+
- lib/open_source.rb
|
58
|
+
- lib/open_source/error.rb
|
59
|
+
- lib/open_source/license.rb
|
60
|
+
- lib/open_source/owner.rb
|
61
|
+
- lib/open_source/version.rb
|
61
62
|
- opensource.gemspec
|
62
63
|
- templates/apache2.erb
|
63
64
|
- templates/bsd.erb
|
@@ -83,8 +84,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
84
|
version: '0'
|
84
85
|
requirements: []
|
85
86
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.
|
87
|
+
rubygems_version: 2.4.5
|
87
88
|
signing_key:
|
88
89
|
specification_version: 4
|
89
|
-
summary:
|
90
|
+
summary: Command line tool that lets you add an open source license to your project
|
91
|
+
by running a simple command
|
90
92
|
test_files: []
|
data/CHANGELOG.md
DELETED
File without changes
|
data/lib/opensource/version.rb
DELETED