-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
54 lines (40 loc) · 1.5 KB
/
Rakefile
File metadata and controls
54 lines (40 loc) · 1.5 KB
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
require 'rubygems'
require 'zip/zip'
require 'rubygems/package_task'
version = "1.0.2"
spec = Gem::Specification.new do |s|
s.name = 'BusinessPlatformSDK'
s.version = version
s.date = '2016-09-26'
s.summary = "An sms-client for the websms-api-platform!"
s.description = "An sms-client for the websms-api-platform. Evaluates, processes and sends an sms-message-request."
s.authors = ["Sebastian Wilhelm"]
s.email = 'developer@websms.com'
s.files = FileList['lib/BusinessPlatformSDK.rb','lib/BusinessPlatformSDK/*.rb'].to_a
s.homepage = 'http://api.websms.com'
s.extra_rdoc_files = ['README.rdoc']
s.has_rdoc = true
s.add_dependency('json_pure', '>= 1.7.5')
end
Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = true
#pkg.zip_command = '"C:\Program Files\7-Zip\7z.exe" a -tzip'
end
zip_file_name = "RUBY_SMS_Toolkit-" + version + ".zip"
if(File.exists?(zip_file_name))
File.delete(zip_file_name)
puts "Old zip file deleted."
end
# Problems with Zip? CALL "rake gem" and pack those 2 files gem file and README.md to a zip by yourself
task :package => [:gem] do
readme_file = File.open('README.md', 'r')
gem_name = "#{spec.name}-#{spec.version}.gem"
gem_file = File.open("pkg/"+gem_name, 'r')
Zip::ZipFile.open(zip_file_name, Zip::ZipFile::CREATE) {
|zipfile|
zipfile.mkdir(zip_file_name)
zipfile.add(zip_file_name+"/README.md",readme_file.path)
zipfile.add(zip_file_name+"/"+gem_name,"pkg/"+gem_name)
}
puts "Build succeeded."
end