Skip to content

Commit

Permalink
fix gem build licence warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Chromium committed Oct 26, 2016
1 parent 935444f commit 8628e1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/methadone
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ main do |app_name|
warn "warning: your app has no license" unless license
license = nil if license == 'NONE'
if license
copy_file "#{options[:license]}_LICENSE.txt", :as => "LICENSE.txt"
copy_file "#{options[:license]}_LICENSE.txt", :as => "LICENSE.txt"
else
#Remove the MIT license generated by `bundle gem`
debug "Making sure no LICENSE.txt file exists at the root of the repo"
Expand All @@ -69,7 +69,7 @@ main do |app_name|
if gemspec_content =~ /(^\s*#{gem_variable}\.license\s*=\s*).*/
gemspec_content.gsub!(/(^\s*#{gem_variable}\.license\s*=\s*).*/,"\\1#{license.to_s.inspect}")
else
gemspec_content.gsub!(/(^\s*#{gem_variable}\.name\s*=\s*.*)/,"\\1\n #{gem_variable}.license=#{license.to_s.inspect}")
gemspec_content.gsub!(/(^\s*#{gem_variable}\.name\s*=\s*.*)/,"\\1\n#{" #{gem_variable}.license".ljust(20)} = #{license.to_s.inspect.upcase}")
end
File.open(gemspec,'w') {|f| f.write gemspec_content }

Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/license_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Then /^newgem's license should be the (\w+) license/ do |license|
@license = license
step %(a file named "tmp/newgem/LICENSE.txt" should exist)
step %(the file "tmp/newgem/newgem.gemspec" should match /#{@license}/)
step %(the file "tmp/newgem/newgem.gemspec" should match /#{@license.upcase}/)
end

Then /^the README should reference this license$/ do
Expand Down

0 comments on commit 8628e1d

Please sign in to comment.