sign 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6e9e0a78029c3547fdcf8ba7a8724b44dda116e
4
- data.tar.gz: ba4c8a6f03d20ad6d0989782ad8b9d6284419c0f
3
+ metadata.gz: d6ecad4c19e6bbecd2c22c583e04b782dabbe2fd
4
+ data.tar.gz: 2dac39cdd9ae07801d5099d1a0ff9269ecc165d3
5
5
  SHA512:
6
- metadata.gz: d240de357b8215a5ecce64037a6b6178dacd76de73e4c48ee565104fd501894de4ee1e72a0fe1ff8ed33a576103102055010b66c3580004c29e28b44da60bcd3
7
- data.tar.gz: '007447852ebeed043b911bbaf43baddb44176b60b30293baca0f25d468bd1fc702351760ae2a63cdd5e8f035e2a9e25cc5f6270b39a3d6e4520b4cd40e13ede8'
6
+ metadata.gz: d9f833007efc6503859a84bdc818e73f6e523f705f54c362bc96476a9fe08956a3cbc6b19149e7ca3524064d8df8ea7769981a67cdedb0b34437db6e0a489e29
7
+ data.tar.gz: af005851596165872d00b09bb5e9b190c7729e9bbb35a08acb9656dee15e6df1e9ed6db301a757706a87b75a99eb78cf26f18d0227296d714cfb236279f474a9
data/.travis.yml CHANGED
@@ -5,3 +5,4 @@ rvm:
5
5
  - 2.3.5
6
6
  - 2.4.2
7
7
  before_install: gem install bundler
8
+ cache: bundler
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 less than 10 seconds. No need for an internet connection either!
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 is needed and are 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.
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 create an MIT license with name and year:
49
+ To see a list of available licenses:
50
50
 
51
51
  ```
52
- sign mit --name="Rick Deckard" --year="2049"
52
+ sign --list
53
53
  ```
54
54
 
55
- To create an MIT license with automatic name and year:
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 see a list of available licenses:
61
+ To create an MIT license with automatic name and year:
62
62
 
63
63
  ```
64
- sign --list
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 display version number"
30
- puts " --help display help information"
31
- puts " --list display list of licenses"
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
@@ -1,3 +1,3 @@
1
1
  module Sign
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-02 00:00:00.000000000 Z
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: '0'
121
+ version: 2.2.8
122
122
  required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ">="