Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GitLab
omnibus
Commits
ed9f8b00
Commit
ed9f8b00
authored
Jul 03, 2017
by
Balasankar C
Committed by
Balasankar C
Jan 29, 2018
Browse files
Copy complete license text to LICENSE file
parent
c10de1a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/omnibus/licensing.rb
View file @
ed9f8b00
...
...
@@ -247,9 +247,10 @@ module Omnibus
out
<<
"This product bundles
#{
name
}
#{
version
}
,
\n
"
out
<<
"which is available under a
\"
#{
license
}
\"
License.
\n
"
if
!
license_files
.
empty?
out
<<
"
For d
etails
, see
:
\n
"
out
<<
"
D
etails:
\n
"
license_files
.
each
do
|
license_file
|
out
<<
"
#{
license_package_location
(
name
,
license_file
)
}
\n
"
path
=
license_package_location
(
name
,
license_file
)
out
<<
"
#{
license_content
(
path
)
}
\n
"
end
end
out
<<
"
\n
"
...
...
@@ -258,6 +259,25 @@ module Omnibus
out
end
# Reads the content of the license file
# It is in the form of:
# ...
# MIT License
# Permission is hereby granted, free of charge, to any person obtaining
# ...
#
# @return [String]
#
def
license_content
(
path
)
if
File
.
exist?
(
path
)
File
.
read
(
path
)
else
path
end
end
#
# Summary of the licenses of the transitive dependencies of the project.
# It is in the form of:
...
...
@@ -283,9 +303,13 @@ module Omnibus
out
<<
"This product includes
#{
dep_name
}
#{
dep_version
}
\n
"
out
<<
"which is a '
#{
dep_mgr_name
}
' dependency of
#{
projects
}
,
\n
"
out
<<
"and which is available under a '
#{
dep_data
[
"license"
]
}
' License.
\n
"
out
<<
"For details, see:
\n
"
out
<<
files
.
join
(
"
\n
"
)
out
<<
"
\n\n
"
if
!
files
.
empty?
out
<<
"Details:
\n
"
files
.
each
do
|
license_file
|
out
<<
"
#{
license_content
(
license_file
)
}
\n
"
end
end
out
<<
"
\n
"
end
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment