opensource 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62ba66039ead0537f81892f1b91536e03c16c83c
4
- data.tar.gz: 2577842b0f55542cb894904478ecf12473b09c5d
3
+ metadata.gz: 39b285b8f211a3ed4f00eb494c290fd31e4bd137
4
+ data.tar.gz: f738ac1de6cc359ab5fcc93823ac25d9f44ed1a3
5
5
  SHA512:
6
- metadata.gz: 91ee74ea895b6d7e2080127ec5a325e9fc216f02c01f1eeb664b93c2c3cc9c6d3e1b980eaf24a6f830194fa7d946ce9430f872d2aa27edda1e41a1e1f516e81a
7
- data.tar.gz: af28a4366f43ad0ca75638fe1b80849b1006334059146de80518d016ccfb2ff055005ef10dd715f2d420fd03f0aee0dadb4c6c101e031d1005003c5e913757e6
6
+ metadata.gz: e3f8725c004f4a8b509ec68edf5e081f5a4bba2f937475f3703e296dc1b84d30c75dee031bd968420d4ff8a567eb607ce7f8bd685c037f998ed761df6ffe1a8f
7
+ data.tar.gz: 10ebdf67b1bad3493841a0d67c63754d7d7c23be313f35a267a940bca8bd7aa150d6f43fb1336da4152c5c1bf290983825ceaefd3ffd948cf95e92b748dc8947
@@ -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) 2014 Mohnish Thallavajhula <i@mohni.sh>
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
- ## Opensource.rb
1
+ # OpenSource
2
2
 
3
- Add an Opensource License to your project. Helps get rid of the annoyance of adding a new license to the project and optionally append the content of the license to the README.md file.
3
+ [![Code Climate](https://codeclimate.com/github/mohnish/opensource.rb/badges/gpa.svg)](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) 2014 Mohnish Thallavajhula <i@mohni.sh>
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
@@ -2,21 +2,21 @@
2
2
  # encoding: UTF-8
3
3
 
4
4
  require 'optparse'
5
- require_relative '../lib/opensource'
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
- Opensource::Owner.set_credentials
15
+ OpenSource::Owner.set_credentials
16
16
  exit
17
17
  end
18
18
 
19
- opts.on('-l', '--license LICENSE', Opensource::LICENSES, "LICENSE can be #{Opensource::LICENSES.join('|')}") do |l|
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 Opensource::VERSION
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.parse!
39
+ end
40
40
 
41
41
  begin
42
- Opensource::License.new(options).process
43
- rescue Opensource::Error => e
44
- # TODO: Make sure the above call raises only Opensource::Error
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
- require_relative 'opensource/version'
2
- require_relative 'opensource/error'
3
- require_relative 'opensource/owner'
4
- require_relative 'opensource/license'
1
+ require 'open_source/version'
2
+ require 'open_source/error'
3
+ require 'open_source/owner'
4
+ require 'open_source/license'
5
5
 
6
- module Opensource
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,4 +1,4 @@
1
- module Opensource
1
+ module OpenSource
2
2
  module Error
3
3
  def self.exception(*args)
4
4
  RuntimeError.new(*args).extend(self)
@@ -1,11 +1,10 @@
1
1
  require 'erb'
2
2
 
3
- module Opensource
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
- private
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
@@ -1,4 +1,4 @@
1
- module Opensource
1
+ module OpenSource
2
2
  module Owner
3
3
  extend self
4
4
 
@@ -27,6 +27,8 @@ module Opensource
27
27
  end
28
28
  end
29
29
 
30
+ user['escaped_email'] = "<#{user['email']}>"
31
+
30
32
  user
31
33
  end
32
34
  end
@@ -0,0 +1,3 @@
1
+ module OpenSource
2
+ VERSION = '0.6.1'
3
+ end
@@ -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 'opensource/version'
4
+ require 'open_source/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "opensource"
8
- spec.version = Opensource::VERSION
8
+ spec.version = OpenSource::VERSION
9
9
  spec.authors = ["Mohnish Thallavajhula"]
10
10
  spec.email = ["i@mohni.sh"]
11
- spec.summary = %q{Add a license to your opensource project}
12
- spec.description = %q{Add a license to your opensource project by running a simple command}
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
 
@@ -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 the <organization> nor the
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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
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.0
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: 2014-08-13 00:00:00.000000000 Z
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: Add a license to your opensource project by running a simple command
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/opensource.rb
57
- - lib/opensource/error.rb
58
- - lib/opensource/license.rb
59
- - lib/opensource/owner.rb
60
- - lib/opensource/version.rb
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.2.2
87
+ rubygems_version: 2.4.5
87
88
  signing_key:
88
89
  specification_version: 4
89
- summary: Add a license to your opensource project
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: []
File without changes
@@ -1,3 +0,0 @@
1
- module Opensource
2
- VERSION = '0.6.0'
3
- end