Sha256: e655fcf1b4860cf890761466ceccad56848b193a8e131bcd3a7cd2f3bbad9603

Contents?: true

Size: 1006 Bytes

Versions: 10

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'open-uri'

require_relative './build/build_client'

RSpec::Core::RakeTask.new(:spec)

task default: :spec

desc 'Regenerates the client starting from the JSON Hyperschema'
task :regenerate do
  BuildClient.new(
    open('https://site-api.datocms.com/docs/site-api-hyperschema.json').read,
    'site',
    %w(session item upload user#update)
  ).build

  BuildClient.new(
    open('https://site-api.datocms.com/docs/account-api-hyperschema.json').read,
    'account',
    %w(
      session
      account#create account#reset_password
      subscription
      portal_session
    )
  ).build
end

desc 'Open an irb (or pry) session preloaded with this gem'
task :console do
  begin
    require 'pry'
    gem_name = File.basename(Dir.pwd)
    sh %(pry -I lib -r #{gem_name}.rb)
  rescue LoadError => _
    sh %(irb -rubygems -I lib -r #{gem_name}.rb)
  end
end

require 'rubocop/rake_task'
RuboCop::RakeTask.new

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dato-0.5.1 Rakefile
dato-0.5.0 Rakefile
dato-0.4.3 Rakefile
dato-0.4.2 Rakefile
dato-0.4.1 Rakefile
dato-0.4.0 Rakefile
dato-0.3.31 Rakefile
dato-0.4.0.pre Rakefile
dato-0.3.30 Rakefile
dato-0.3.29 Rakefile