sign 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +8 -8
- data/lib/sign/runner.rb +31 -7
- data/lib/sign/version.rb +1 -1
- data/sign.gemspec +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6ecad4c19e6bbecd2c22c583e04b782dabbe2fd
|
4
|
+
data.tar.gz: 2dac39cdd9ae07801d5099d1a0ff9269ecc165d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9f833007efc6503859a84bdc818e73f6e523f705f54c362bc96476a9fe08956a3cbc6b19149e7ca3524064d8df8ea7769981a67cdedb0b34437db6e0a489e29
|
7
|
+
data.tar.gz: af005851596165872d00b09bb5e9b190c7729e9bbb35a08acb9656dee15e6df1e9ed6db301a757706a87b75a99eb78cf26f18d0227296d714cfb236279f474a9
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.0.2] - 2017-11-03
|
8
|
+
### Changed
|
9
|
+
- Sign will check if a license file exists before creating/overwriting.
|
10
|
+
- Alias for options and flags.
|
11
|
+
|
12
|
+
|
7
13
|
## [1.0.1] - 2017-11-02
|
8
14
|
### Changed
|
9
15
|
- Fix issue where some licenses weren't being fetched.
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ This process can take about 1-2 minutes, precious time that you can be using for
|
|
22
22
|
2. Enter `sign mit`.
|
23
23
|
3. Profit.
|
24
24
|
|
25
|
-
Sign creates a license in your current project directory for you in
|
25
|
+
Sign creates a license in your current project directory for you in a matter of seconds. **No need for an internet connection either!**
|
26
26
|
|
27
27
|
## Installation
|
28
28
|
|
@@ -42,26 +42,26 @@ And then execute `bundle`.
|
|
42
42
|
|
43
43
|
## Usage
|
44
44
|
|
45
|
-
There are a wide range of licenses available (provided by [Open Source Initiative](https://opensource.org/)). The format is `sign <license name> --name=[NAME] --year=[YEAR]`. If either name or year
|
45
|
+
There are a wide range of licenses available (provided by [Open Source Initiative](https://opensource.org/)). The format is `sign <license name> --name=[NAME] --year=[YEAR]`. If either name or year are needed and not provided, it will automatically try to detect a `.gitconfig` file on your system and grab the name from there. The year will automatically be set to the current year too.
|
46
46
|
|
47
47
|
### Examples
|
48
48
|
|
49
|
-
To
|
49
|
+
To see a list of available licenses:
|
50
50
|
|
51
51
|
```
|
52
|
-
sign
|
52
|
+
sign --list
|
53
53
|
```
|
54
54
|
|
55
|
-
To create an MIT license with
|
55
|
+
To create an MIT license with name and year:
|
56
56
|
|
57
57
|
```
|
58
|
-
sign mit
|
58
|
+
sign mit --name="Rick Deckard" --year="2049"
|
59
59
|
```
|
60
60
|
|
61
|
-
To
|
61
|
+
To create an MIT license with automatic name and year:
|
62
62
|
|
63
63
|
```
|
64
|
-
sign
|
64
|
+
sign mit
|
65
65
|
```
|
66
66
|
|
67
67
|
## Updates
|
data/lib/sign/runner.rb
CHANGED
@@ -5,14 +5,14 @@ module Sign
|
|
5
5
|
argv << "--help" if argv.empty?
|
6
6
|
|
7
7
|
case argv[0]
|
8
|
-
when "--help"
|
8
|
+
when "--help", "-h"
|
9
9
|
show_help
|
10
|
-
when "--version"
|
10
|
+
when "--version", "-v"
|
11
11
|
show_version
|
12
|
-
when "--list"
|
12
|
+
when "--list", "-l"
|
13
13
|
show_list
|
14
14
|
else
|
15
|
-
create_license(argv)
|
15
|
+
create_license(argv) unless license_exist?
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -26,9 +26,9 @@ module Sign
|
|
26
26
|
puts ""
|
27
27
|
puts " Options:"
|
28
28
|
puts ""
|
29
|
-
puts " --version
|
30
|
-
puts " --help
|
31
|
-
puts " --list
|
29
|
+
puts " --version | -v display version number"
|
30
|
+
puts " --help | -h display help information"
|
31
|
+
puts " --list | -l display list of licenses"
|
32
32
|
puts ""
|
33
33
|
end
|
34
34
|
|
@@ -44,6 +44,30 @@ module Sign
|
|
44
44
|
puts "Sign v#{Sign::VERSION}"
|
45
45
|
end
|
46
46
|
|
47
|
+
def license_exist?
|
48
|
+
if File.exist?("LICENSE")
|
49
|
+
argv = ARGV.clone # save user's first inputs for license
|
50
|
+
ARGV.clear # clears ARGV to allow for next input
|
51
|
+
|
52
|
+
puts "There seems to be a license file already. Would you like to overwrite it? [y/n]"
|
53
|
+
input = gets.chomp.downcase
|
54
|
+
|
55
|
+
yes = ["y", "yes"]
|
56
|
+
no = ["n", "no"]
|
57
|
+
|
58
|
+
if yes.include?(input)
|
59
|
+
return false
|
60
|
+
elsif no.include?(input)
|
61
|
+
puts "Terminating..."
|
62
|
+
|
63
|
+
exit
|
64
|
+
else
|
65
|
+
puts "Sorry, I didn't get that. Let's try again."
|
66
|
+
license_exist?
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
47
71
|
def create_license(argv)
|
48
72
|
license = Sign::Fetcher.new.get_license(argv[0])
|
49
73
|
name = !!argv[1] ? parse_argument(argv[1]) : nil
|
data/lib/sign/version.rb
CHANGED
data/sign.gemspec
CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.bindir = "bin"
|
28
28
|
spec.executables = spec.files.grep(%r{^bin/sign}) { |f| File.basename(f) }
|
29
29
|
spec.require_paths = ["lib"]
|
30
|
+
spec.required_ruby_version = '>= 2.2.8'
|
30
31
|
|
31
32
|
spec.add_development_dependency "bundler", "~> 1.15"
|
32
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sign
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Ng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
118
|
requirements:
|
119
119
|
- - ">="
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
121
|
+
version: 2.2.8
|
122
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
124
|
- - ">="
|