opensource 1.1.2 → 2.1.0
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 +5 -5
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/ci.yml +27 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +46 -0
- data/History.md +12 -0
- data/LICENSE +1 -1
- data/Makefile +43 -0
- data/README.md +52 -5
- data/Rakefile +4 -0
- data/exe/opensource +9 -3
- data/lib/open_source/error.rb +6 -5
- data/lib/open_source/license/generator.rb +52 -6
- data/lib/open_source/license/owner.rb +40 -6
- data/lib/open_source/license/templates/apache2.erb +1 -1
- data/lib/open_source/license/templates/bsd.erb +1 -1
- data/lib/open_source/license/templates/gpl3.erb +2 -2
- data/lib/open_source/license/templates/isc.erb +1 -1
- data/lib/open_source/license/templates/mit.erb +1 -1
- data/lib/open_source/version.rb +1 -1
- data/lib/open_source.rb +10 -0
- data/opensource.gemspec +11 -8
- metadata +44 -26
- data/.codeclimate.yml +0 -5
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 88a46d31221547e064e035afd8912a8330ee23556bc1f68f4e3c01041dc6e318
|
|
4
|
+
data.tar.gz: 4f75381c7b2d05615bf37815991da3319a1fde8c69451dba6d8869dac4a7d1f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 212d14d940e64a30aefb70823dc7907d85dd46cf434199e79bcf18d1fa88a2b4be0b572d595baf81236263e68a9d5b78ab431f2b6fbb27f0d23e2ad7afccb0c2
|
|
7
|
+
data.tar.gz: a8b75d09d62aef6de3fe861b36ec1f02003aa95bdd4218f1b7d1122207595539bd020ac3a83e63fdcf75ceb5e324ec534dfcfa9d65a8a518cebe9a19fe9376a5
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
ruby:
|
|
17
|
+
- "3.2"
|
|
18
|
+
- "3.3"
|
|
19
|
+
- "3.4"
|
|
20
|
+
- "4.0"
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v7.0.1
|
|
23
|
+
- uses: ruby/setup-ruby@v1.321.0
|
|
24
|
+
with:
|
|
25
|
+
ruby-version: ${{ matrix.ruby }}
|
|
26
|
+
bundler-cache: true
|
|
27
|
+
- run: bundle exec rake
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.6
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
|
10
|
+
|
|
11
|
+
* Using welcoming and inclusive language
|
|
12
|
+
* Being respectful of differing viewpoints and experiences
|
|
13
|
+
* Gracefully accepting constructive criticism
|
|
14
|
+
* Focusing on what is best for the community
|
|
15
|
+
* Showing empathy towards other community members
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behavior by participants include:
|
|
18
|
+
|
|
19
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
20
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
21
|
+
* Public or private harassment
|
|
22
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
23
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
+
|
|
25
|
+
## Our Responsibilities
|
|
26
|
+
|
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
28
|
+
|
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
## Scope
|
|
32
|
+
|
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
34
|
+
|
|
35
|
+
## Enforcement
|
|
36
|
+
|
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at m@mt.cx. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
38
|
+
|
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
40
|
+
|
|
41
|
+
## Attribution
|
|
42
|
+
|
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
|
44
|
+
|
|
45
|
+
[homepage]: http://contributor-covenant.org
|
|
46
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/History.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
2.1.0 / 2026-07-25
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
* handle missing credentials gracefully - improve ux
|
|
6
|
+
* Upgrade to latest deps
|
|
7
|
+
|
|
8
|
+
2.0.0 / 2026-07-19
|
|
9
|
+
==================
|
|
10
|
+
|
|
11
|
+
* Upgrade to the latest and greatest
|
|
12
|
+
* Create CODE_OF_CONDUCT.md
|
|
13
|
+
|
|
2
14
|
1.1.1 / 2016-04-15
|
|
3
15
|
==================
|
|
4
16
|
|
data/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Mohnish Thallavajhula <hi@iam.mt>
|
|
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
|
data/Makefile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.DEFAULT_GOAL := help
|
|
2
|
+
|
|
3
|
+
BUNDLE ?= bundle
|
|
4
|
+
RUBY ?= ruby
|
|
5
|
+
|
|
6
|
+
.PHONY: help setup install test spec build console version clean ci
|
|
7
|
+
|
|
8
|
+
help:
|
|
9
|
+
@printf "Available targets:\n"
|
|
10
|
+
@printf " make setup Install gem dependencies\n"
|
|
11
|
+
@printf " make install Alias for setup\n"
|
|
12
|
+
@printf " make test Run the default test suite\n"
|
|
13
|
+
@printf " make spec Run RSpec directly\n"
|
|
14
|
+
@printf " make build Build the gem package\n"
|
|
15
|
+
@printf " make version Smoke-check the CLI version command\n"
|
|
16
|
+
@printf " make console Start an IRB console with the gem loaded\n"
|
|
17
|
+
@printf " make clean Remove generated gem packages\n"
|
|
18
|
+
@printf " make ci Run the local CI checks\n"
|
|
19
|
+
|
|
20
|
+
setup:
|
|
21
|
+
$(BUNDLE) install
|
|
22
|
+
|
|
23
|
+
install: setup
|
|
24
|
+
|
|
25
|
+
test:
|
|
26
|
+
$(BUNDLE) exec rake
|
|
27
|
+
|
|
28
|
+
spec:
|
|
29
|
+
$(BUNDLE) exec rspec
|
|
30
|
+
|
|
31
|
+
build:
|
|
32
|
+
$(BUNDLE) exec rake build
|
|
33
|
+
|
|
34
|
+
version:
|
|
35
|
+
$(BUNDLE) exec $(RUBY) exe/opensource --version
|
|
36
|
+
|
|
37
|
+
console:
|
|
38
|
+
$(BUNDLE) exec bin/console
|
|
39
|
+
|
|
40
|
+
clean:
|
|
41
|
+
$(BUNDLE) exec rake clean
|
|
42
|
+
|
|
43
|
+
ci: test build version
|
data/README.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
# OpenSource
|
|
2
|
-
[](https://codeclimate.com/github/mohnish/opensource)
|
|
2
|
+
[](https://github.com/mohnish/opensource/actions/workflows/ci.yml)
|
|
4
3
|
|
|
5
4
|
> Command line tool that lets you add an open source license to your project by running a simple command.
|
|
6
5
|
|
|
7
|
-
Supports **Ruby
|
|
6
|
+
Supports **Ruby 3.2+**. Local development targets **Ruby 4.0.6**, as declared in `.ruby-version`.
|
|
8
7
|
|
|
9
8
|
## Supported Licenses
|
|
10
9
|
|
|
@@ -18,7 +17,7 @@ Supports **Ruby 1.9.3+**.
|
|
|
18
17
|
Run:
|
|
19
18
|
|
|
20
19
|
```bash
|
|
21
|
-
|
|
20
|
+
gem install opensource
|
|
22
21
|
```
|
|
23
22
|
|
|
24
23
|
## Usage
|
|
@@ -36,11 +35,59 @@ Common options:
|
|
|
36
35
|
-h, --help Show this message
|
|
37
36
|
```
|
|
38
37
|
|
|
38
|
+
## Development
|
|
39
|
+
|
|
40
|
+
This project has been updated for the current Ruby toolchain:
|
|
41
|
+
|
|
42
|
+
- Ruby `4.0.6` for local development
|
|
43
|
+
- Ruby `3.2+` as the supported runtime range
|
|
44
|
+
- Bundler `4`
|
|
45
|
+
- Rake `13`
|
|
46
|
+
- RSpec `3.13`
|
|
47
|
+
- GitHub Actions CI instead of Travis CI
|
|
48
|
+
- Dependabot for Bundler and GitHub Actions updates
|
|
49
|
+
|
|
50
|
+
Install dependencies:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
make setup
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Run the test suite:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
make test
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Build the gem package:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
make build
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Run the local CI checks:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
make ci
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
See all available shortcuts:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
make
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
CI runs the test suite on Ruby `3.2`, `3.3`, `3.4`, and `4.0`.
|
|
81
|
+
|
|
82
|
+
### Runtime Dependencies
|
|
83
|
+
|
|
84
|
+
Ruby 4 no longer loads `logger` as an always-available standard library dependency. The gem declares `logger` explicitly so the CLI works on Ruby 4 and newer RubyGems installations.
|
|
85
|
+
|
|
39
86
|
## License
|
|
40
87
|
|
|
41
88
|
(The MIT License)
|
|
42
89
|
|
|
43
|
-
Copyright (c)
|
|
90
|
+
Copyright (c) 2026 Mohnish Thallavajhula <hi@iam.mt>
|
|
44
91
|
|
|
45
92
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
46
93
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
data/exe/opensource
CHANGED
|
@@ -39,15 +39,21 @@ option_parser = OptionParser.new do |opts|
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
begin
|
|
42
|
-
|
|
42
|
+
begin
|
|
43
|
+
option_parser.parse!
|
|
44
|
+
rescue OptionParser::ParseError => e
|
|
45
|
+
raise OpenSource::OptionError, e.message
|
|
46
|
+
end
|
|
47
|
+
|
|
43
48
|
if options.empty?
|
|
44
49
|
OpenSource.logger.info(option_parser)
|
|
45
50
|
exit 0
|
|
46
51
|
end
|
|
47
52
|
|
|
48
|
-
OpenSource
|
|
53
|
+
OpenSource.with_owner_credentials do
|
|
54
|
+
OpenSource::License::Generator.new(options).generate
|
|
55
|
+
end
|
|
49
56
|
rescue OpenSource::Error => e
|
|
50
|
-
# TODO: Make sure the above call raises only OpenSource::Error
|
|
51
57
|
OpenSource.logger.fatal("Error: #{e.message}")
|
|
52
58
|
exit 1
|
|
53
59
|
end
|
data/lib/open_source/error.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
module OpenSource
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
end
|
|
2
|
+
class Error < StandardError; end
|
|
3
|
+
class OptionError < Error; end
|
|
4
|
+
class ConfigError < Error; end
|
|
5
|
+
class MissingCredentialsError < ConfigError; end
|
|
6
|
+
class LicenseError < Error; end
|
|
7
|
+
class FileError < Error; end
|
|
7
8
|
end
|
|
@@ -6,7 +6,7 @@ module OpenSource
|
|
|
6
6
|
def initialize(options)
|
|
7
7
|
@options = options
|
|
8
8
|
@owner = Owner.new
|
|
9
|
-
@license =
|
|
9
|
+
@license = load_license_template
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def generate
|
|
@@ -15,16 +15,62 @@ module OpenSource
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
private
|
|
18
|
+
def load_license_template
|
|
19
|
+
unless OpenSource::SUPPORTED_LICENSES.include?(@options[:license])
|
|
20
|
+
raise LicenseError, "Unsupported license #{@options[:license].inspect}. Supported licenses: #{OpenSource::SUPPORTED_LICENSES.join(', ')}"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
ERB.new(File.read(template_path))
|
|
24
|
+
rescue OpenSource::Error
|
|
25
|
+
raise
|
|
26
|
+
rescue SystemCallError => ex
|
|
27
|
+
raise LicenseError, "Unable to read #{@options[:license]} license template: #{ex.message}"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def template_path
|
|
31
|
+
"#{File.expand_path("../templates", __FILE__)}/#{@options[:license]}.erb"
|
|
32
|
+
end
|
|
33
|
+
|
|
18
34
|
def create_license_file
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
35
|
+
license_content = render_license
|
|
36
|
+
|
|
37
|
+
File.open(license_path, 'w') do |file|
|
|
38
|
+
file.write(license_content)
|
|
39
|
+
end
|
|
40
|
+
rescue OpenSource::Error
|
|
41
|
+
raise
|
|
42
|
+
rescue SystemCallError => ex
|
|
43
|
+
raise FileError, "Unable to write #{license_path}: #{ex.message}"
|
|
22
44
|
end
|
|
23
45
|
|
|
24
46
|
def append_to_file
|
|
25
|
-
File.
|
|
26
|
-
|
|
47
|
+
append_path = File.expand_path(@options[:append])
|
|
48
|
+
license_content = render_license(markdown: true)
|
|
49
|
+
|
|
50
|
+
File.open(append_path, 'a') do |file|
|
|
51
|
+
file << "\n## License\n\n#{license_content}"
|
|
27
52
|
end
|
|
53
|
+
rescue OpenSource::Error
|
|
54
|
+
raise
|
|
55
|
+
rescue SystemCallError => ex
|
|
56
|
+
raise FileError, "Unable to append license to #{append_path}: #{ex.message}"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def license_path
|
|
60
|
+
"#{Dir.pwd}/LICENSE"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def render_license(markdown: false)
|
|
64
|
+
previous_owner_email = @owner_email
|
|
65
|
+
@owner_email = markdown ? @owner.markdown_supported_email : @owner.license_email
|
|
66
|
+
|
|
67
|
+
@license.result(binding)
|
|
68
|
+
rescue OpenSource::Error
|
|
69
|
+
raise
|
|
70
|
+
rescue StandardError => ex
|
|
71
|
+
raise LicenseError, "Unable to render #{@options[:license]} license: #{ex.message}"
|
|
72
|
+
ensure
|
|
73
|
+
@owner_email = previous_owner_email
|
|
28
74
|
end
|
|
29
75
|
end
|
|
30
76
|
end
|
|
@@ -4,15 +4,15 @@ module OpenSource
|
|
|
4
4
|
module License
|
|
5
5
|
class Owner
|
|
6
6
|
def credentials=(credentials)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
rescue
|
|
11
|
-
|
|
7
|
+
File.open(CONFIG_PATH, 'w') do |config_file|
|
|
8
|
+
config_file.write(YAML.dump(credentials))
|
|
9
|
+
end
|
|
10
|
+
rescue SystemCallError => ex
|
|
11
|
+
raise ConfigError, "Unable to write #{CONFIG_PATH}: #{ex.message}"
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def credentials
|
|
15
|
-
@credentials ||=
|
|
15
|
+
@credentials ||= load_credentials
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def email
|
|
@@ -23,9 +23,43 @@ module OpenSource
|
|
|
23
23
|
"<#{credentials[:email]}>"
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def license_email
|
|
27
|
+
"<#{credentials[:email]}>"
|
|
28
|
+
end
|
|
29
|
+
|
|
26
30
|
def name
|
|
27
31
|
credentials[:name]
|
|
28
32
|
end
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
def load_credentials
|
|
36
|
+
credentials = YAML.load_file(CONFIG_PATH)
|
|
37
|
+
credentials = normalize_credentials(credentials)
|
|
38
|
+
|
|
39
|
+
unless credentials.key?(:name) && credentials.key?(:email)
|
|
40
|
+
raise ConfigError, "Invalid configuration in #{CONFIG_PATH}; run `opensource --setup` to recreate it"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
credentials
|
|
44
|
+
rescue OpenSource::Error
|
|
45
|
+
raise
|
|
46
|
+
rescue Errno::ENOENT
|
|
47
|
+
raise MissingCredentialsError, "Missing #{CONFIG_PATH}; run `opensource --setup` first"
|
|
48
|
+
rescue Psych::Exception => ex
|
|
49
|
+
raise ConfigError, "Unable to parse #{CONFIG_PATH}: #{ex.message}"
|
|
50
|
+
rescue SystemCallError => ex
|
|
51
|
+
raise ConfigError, "Unable to read #{CONFIG_PATH}: #{ex.message}"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def normalize_credentials(credentials)
|
|
55
|
+
unless credentials.is_a?(Hash)
|
|
56
|
+
raise ConfigError, "Invalid configuration in #{CONFIG_PATH}; run `opensource --setup` to recreate it"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
credentials.each_with_object({}) do |(key, value), normalized|
|
|
60
|
+
normalized[key.to_sym] = value if key.respond_to?(:to_sym)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
29
63
|
end
|
|
30
64
|
end
|
|
31
65
|
end
|
|
@@ -187,7 +187,7 @@ APPENDIX: How to apply the Apache License to your work.
|
|
|
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 %> <%= @owner.name %> <%= @
|
|
190
|
+
Copyright <%= Time.now.year %> <%= @owner.name %> <%= @owner_email %>
|
|
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.
|
|
@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
|
|
|
632
632
|
the "copyright" line and a pointer to where the full notice is found.
|
|
633
633
|
|
|
634
634
|
<one line to give the program's name and a brief idea of what it does.>
|
|
635
|
-
Copyright (C) <%= Time.now.year %> <%= @owner.name %> <%= @
|
|
635
|
+
Copyright (C) <%= Time.now.year %> <%= @owner.name %> <%= @owner_email %>
|
|
636
636
|
|
|
637
637
|
This program is free software: you can redistribute it and/or modify
|
|
638
638
|
it under the terms of the GNU General Public License as published by
|
|
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|
|
652
652
|
If the program does terminal interaction, make it output a short
|
|
653
653
|
notice like this when it starts in an interactive mode:
|
|
654
654
|
|
|
655
|
-
Copyright (C) <%= Time.now.year %> <%= @owner.name %> <%= @
|
|
655
|
+
Copyright (C) <%= Time.now.year %> <%= @owner.name %> <%= @owner_email %>
|
|
656
656
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
657
657
|
This is free software, and you are welcome to redistribute it
|
|
658
658
|
under certain conditions; type `show c' for details.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
ISC License (ISC)
|
|
2
|
-
Copyright (c) <%= Time.now.year %>, <%= @owner.name %> <%= @
|
|
2
|
+
Copyright (c) <%= Time.now.year %>, <%= @owner.name %> <%= @owner_email %>
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
|
-
Copyright (c) <%= Time.now.year %> <%= @owner.name %> <%= @
|
|
3
|
+
Copyright (c) <%= Time.now.year %> <%= @owner.name %> <%= @owner_email %>
|
|
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
|
data/lib/open_source/version.rb
CHANGED
data/lib/open_source.rb
CHANGED
|
@@ -27,4 +27,14 @@ module OpenSource
|
|
|
27
27
|
owner = License::Owner.new
|
|
28
28
|
owner.credentials = owner_credentials
|
|
29
29
|
end
|
|
30
|
+
|
|
31
|
+
def self.with_owner_credentials(interactive: $stdin.tty?)
|
|
32
|
+
yield
|
|
33
|
+
rescue MissingCredentialsError
|
|
34
|
+
raise unless interactive
|
|
35
|
+
|
|
36
|
+
OpenSource.logger.info("Owner credentials are not set. Let's set them up now.")
|
|
37
|
+
setup_owner_credentials
|
|
38
|
+
yield
|
|
39
|
+
end
|
|
30
40
|
end
|
data/opensource.gemspec
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
5
|
require 'open_source/version'
|
|
5
6
|
|
|
@@ -7,18 +8,20 @@ Gem::Specification.new do |spec|
|
|
|
7
8
|
spec.name = 'opensource'
|
|
8
9
|
spec.version = OpenSource::VERSION
|
|
9
10
|
spec.authors = ['Mohnish Thallavajhula']
|
|
10
|
-
spec.email = ['
|
|
11
|
+
spec.email = ['hi@iam.mt']
|
|
11
12
|
spec.summary = spec.description = %q{Command line tool that lets you add an open source license to your project by running a simple command}
|
|
12
13
|
spec.homepage = 'https://github.com/mohnish/opensource'
|
|
13
14
|
spec.license = 'MIT'
|
|
15
|
+
spec.required_ruby_version = '>= 3.2'
|
|
16
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
14
17
|
|
|
15
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").select { |f| File.file?(f) }.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
16
19
|
spec.bindir = 'exe'
|
|
17
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
21
|
spec.require_paths = ['lib']
|
|
20
22
|
|
|
21
|
-
spec.
|
|
22
|
-
|
|
23
|
-
spec.add_development_dependency '
|
|
23
|
+
spec.add_dependency 'logger', '>= 1.7', '< 2'
|
|
24
|
+
|
|
25
|
+
spec.add_development_dependency 'rake', '>= 13', '< 15'
|
|
26
|
+
spec.add_development_dependency 'rspec', '>= 3.13', '< 5'
|
|
24
27
|
end
|
metadata
CHANGED
|
@@ -1,73 +1,93 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opensource
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mohnish Thallavajhula
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
13
|
+
name: logger
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- - "
|
|
16
|
+
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.
|
|
20
|
-
|
|
18
|
+
version: '1.7'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '2'
|
|
22
|
+
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
25
|
requirements:
|
|
24
|
-
- - "
|
|
26
|
+
- - ">="
|
|
25
27
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.
|
|
28
|
+
version: '1.7'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '2'
|
|
27
32
|
- !ruby/object:Gem::Dependency
|
|
28
33
|
name: rake
|
|
29
34
|
requirement: !ruby/object:Gem::Requirement
|
|
30
35
|
requirements:
|
|
31
|
-
- - "
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '13'
|
|
39
|
+
- - "<"
|
|
32
40
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
41
|
+
version: '15'
|
|
34
42
|
type: :development
|
|
35
43
|
prerelease: false
|
|
36
44
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
45
|
requirements:
|
|
38
|
-
- - "
|
|
46
|
+
- - ">="
|
|
39
47
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
48
|
+
version: '13'
|
|
49
|
+
- - "<"
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '15'
|
|
41
52
|
- !ruby/object:Gem::Dependency
|
|
42
53
|
name: rspec
|
|
43
54
|
requirement: !ruby/object:Gem::Requirement
|
|
44
55
|
requirements:
|
|
45
|
-
- - "
|
|
56
|
+
- - ">="
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
version: '3.13'
|
|
59
|
+
- - "<"
|
|
46
60
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
61
|
+
version: '5'
|
|
48
62
|
type: :development
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
|
-
- - "
|
|
66
|
+
- - ">="
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '3.
|
|
68
|
+
version: '3.13'
|
|
69
|
+
- - "<"
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
version: '5'
|
|
55
72
|
description: Command line tool that lets you add an open source license to your project
|
|
56
73
|
by running a simple command
|
|
57
74
|
email:
|
|
58
|
-
-
|
|
75
|
+
- hi@iam.mt
|
|
59
76
|
executables:
|
|
60
77
|
- opensource
|
|
61
78
|
extensions: []
|
|
62
79
|
extra_rdoc_files: []
|
|
63
80
|
files:
|
|
64
|
-
- ".
|
|
81
|
+
- ".github/dependabot.yml"
|
|
82
|
+
- ".github/workflows/ci.yml"
|
|
65
83
|
- ".gitignore"
|
|
66
84
|
- ".rspec"
|
|
67
|
-
- ".
|
|
85
|
+
- ".ruby-version"
|
|
86
|
+
- CODE_OF_CONDUCT.md
|
|
68
87
|
- Gemfile
|
|
69
88
|
- History.md
|
|
70
89
|
- LICENSE
|
|
90
|
+
- Makefile
|
|
71
91
|
- README.md
|
|
72
92
|
- Rakefile
|
|
73
93
|
- bin/console
|
|
@@ -90,8 +110,8 @@ files:
|
|
|
90
110
|
homepage: https://github.com/mohnish/opensource
|
|
91
111
|
licenses:
|
|
92
112
|
- MIT
|
|
93
|
-
metadata:
|
|
94
|
-
|
|
113
|
+
metadata:
|
|
114
|
+
rubygems_mfa_required: 'true'
|
|
95
115
|
rdoc_options: []
|
|
96
116
|
require_paths:
|
|
97
117
|
- lib
|
|
@@ -99,16 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
99
119
|
requirements:
|
|
100
120
|
- - ">="
|
|
101
121
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
122
|
+
version: '3.2'
|
|
103
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
124
|
requirements:
|
|
105
125
|
- - ">="
|
|
106
126
|
- !ruby/object:Gem::Version
|
|
107
127
|
version: '0'
|
|
108
128
|
requirements: []
|
|
109
|
-
|
|
110
|
-
rubygems_version: 2.5.1
|
|
111
|
-
signing_key:
|
|
129
|
+
rubygems_version: 4.0.16
|
|
112
130
|
specification_version: 4
|
|
113
131
|
summary: Command line tool that lets you add an open source license to your project
|
|
114
132
|
by running a simple command
|
data/.codeclimate.yml
DELETED