rakefile in purecloud-0.35.1 vs rakefile in purecloud-0.36.1

- old
+ new

@@ -1,7 +1,6 @@ require 'json' -require "yard" require 'rake/testtask' require 'rubygems' require 'gems' require 'fileutils' @@ -16,16 +15,10 @@ task :clean do rm_rf gen_dir rm_rf lib_dir end -YARD::Rake::YardocTask.new do |t| - YARD::Templates::Engine.register_template_path 'doc/template' - t.files = ['lib/**/*.rb', '-', 'README.md'] - t.options = ['--output-dir','doc_out', '-p', 'doc/template'] -end - GEM_VERSION = ENV['SDK_VERSION'] ||= "0.0.0" task :buildgem do Dir.mkdir(gen_dir) unless File.exists?(gen_dir) @@ -42,48 +35,45 @@ "gemLicense" => "MIT", "gemSummary" => "PureCloud Platform API Library", "gemDescription" => "A Ruby library to interface with the PureCloud Platform API", "gemHomepage" => "https://developer.mypurecloud.com", "gemAuthor" => "Kevin Glinski", - "gemAuthorEmail" => "Kevin.Glinski@inin.com" - + "gemAuthorEmail" => "Kevin.Glinski@inin.com", + "httpUserAgent" => "PureCloud SDK/Ruby #{GEM_VERSION}", + "gitUserId" => "mypurecloud", + "gitRepoId" => "purecloud_api_sdk_ruby" } File.open("config-ruby.json", 'w') { |file| file.write(codegenConfig.to_json) } + rm_rf 'docs' `java -jar external/swagger-codegen-cli.jar generate -i ./swagger.json -l ruby -c config-ruby.json -t swagger_template` `cat lib/purecloud.rb extensions/auth.rb > lib/purecloud.tmp` `mv lib/purecloud.tmp lib/purecloud.rb` - end -task :rename_and_zip do - Dir.glob('doc_out/index.html') do |filepath| - IO.write(filepath, File.open(filepath) {|f| f.read.gsub(/title:.*/, 'title: Ruby SDK Home')}) + Dir.glob('docs/*.md') do |filepath| + File.rename(filepath, filepath.gsub(/md$/, "html.md")) end - Dir.glob('doc_out/**/*.html') do |filepath| - IO.write(filepath, File.open(filepath) {|f| f.read.gsub(/(title:\s+\w+):\s+(.*)/, '\1 - \2').gsub(/PureCloud::/, '')}) + Dir.glob('README.md') do |filepath| + FileUtils.cp(filepath, filepath.gsub(/README/, "docs/index.html")) end - Dir.glob("doc_out/**/*.html") do |f| - #filename = File.basename(f, File.extname(f)) - File.rename(f, f + ".erb") + FileUtils.mv 'docs', 'doc_out' - end + rm_rf 'spec/api' + rm_rf 'spec/models' + end -end - task :release do version = ENV['SDK_VERSION'] puts "releasing #{version}" Gems.configure do |config| config.key = ENV['GEM_KEY'] end puts Gems.push File.new "gen/purecloud-#{version}.gem" end - -task :doc => [:yard, :rename_and_zip] task :default => [:clean, :generate, :buildgem]# :test,