forked from texel/docusign
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
82 lines (72 loc) · 2.55 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright (C) DocuSign, Inc. All rights reserved.
#
# This source code is intended only as a supplement to DocuSign SDK
# and/or on-line documentation.
#
# This sample is designed to demonstrate DocuSign features and is not intended
# for production use. Code and policy for a production application must be
# developed to meet the specific data and security requirements of the
# application.
#
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
# PARTICULAR PURPOSE.
require 'rubygems'
require './lib/docusign.rb'
gem 'mumboe-soap4r'
require 'wsdl/soap/wsdl2ruby'
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "docusign"
gemspec.summary = "A library for working with the Docusign API and associated objects"
gemspec.description = <<-HERE
A library for working with the Docusign API and associated objects.
Provides SOAP4R-generated proxy classes, and extends many useful classes
with familiar Ruby-like syntax.
HERE
gemspec.email = "[email protected]"
gemspec.homepage = "http://github.com/texel/docusign"
gemspec.authors = ["Leigh Caplan"]
end
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
end
task :cultivate do
system "touch Manifest.txt; rake check_manifest | grep -v \"(in \" | patch"
system "rake debug_gem | grep -v \"(in \" > `basename \\`pwd\\``.gemspec"
end
#Test tasks
require 'rspec'
require 'rspec/core/rake_task'
desc 'Run the unit tests'
RSpec::Core::RakeTask.new(:test)
#End test tasks
namespace :docusign do
namespace :services do
desc "Generate SOAP stubs for Docusign API"
task :generate do
wsdl_path = File.expand_path(File.dirname(__FILE__) + "/lib/wsdl/DocuSign3.0.2API.wsdl")
wsdl2ruby('docusign', 'Docusign', "file://#{wsdl_path}")
end
desc "Generate SOAP stubs for Docusign Credential API"
task :generate_credential_api do
wsdl_path = File.expand_path(File.dirname(__FILE__) + "/lib/wsdl/DocuSign3.0.2CredentialAPI.wsdl")
wsdl2ruby('docusign/credential', 'Docusign::Credential', "file://#{wsdl_path}")
end
end
end
private
def wsdl2ruby(name, module_name, url)
g = WSDL::SOAP::WSDL2Ruby.new
g.location = url
g.basedir = File.expand_path(File.dirname(__FILE__) + "/lib/")
g.opt['classdef'] = name
g.opt['driver'] = nil
g.opt['module_path'] = module_name
g.opt['mapping_registry'] = true
g.opt['force'] = true
g.run
end
# vim: syntax=Ruby