Skip to content

Commit

Permalink
Merge pull request #104 from CrCs2O4/master
Browse files Browse the repository at this point in the history
Fix gem build licence warning
  • Loading branch information
davetron5000 authored Nov 3, 2016
2 parents 935444f + 8628e1d commit 1f3acbe
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 1f3acbe

Please sign in to comment.