Skip to content

Commit f36ef25

Browse files
committed
Release 0.3.8
1 parent 5347756 commit f36ef25

File tree

5 files changed

+116
-11
lines changed

5 files changed

+116
-11
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2017 Alexey Melnichuk
3+
Copyright (c) 2014-2018 Alexey Melnichuk
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

examples/cURLv3/post_mime.lua

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ local curl = require "cURL"
55
local easy = curl.easy()
66

77
-- Create new mime object.
8-
-- cURL documentation doesn not mentioned that
9-
-- this mime object can be used only
108
local mime = easy:mime()
119

1210
-- Add part. Source of data is file on disk.
@@ -41,12 +39,9 @@ end
4139

4240
easy:close()
4341

44-
-- E.g. it does not send filedata second time.
4542
-- Lua-cURL does not free mime when close `parent` easy.
4643

4744
-- Explicitly free mime object and all its parts
48-
-- There no way to reuse only some parts.
45+
-- There no way to reuse only some parts or submimes.
46+
-- but it possible reuse entire mime again.
4947
mime:free()
50-
51-
-- Subparts become also freed
52-
print(part)

examples/lcurl/crul_info.lua

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
local curl = require "lcurl"
2+
3+
local function keys(t)
4+
local s = {}
5+
for k in pairs(t) do
6+
s[#s + 1] = k
7+
end
8+
table.sort(s)
9+
return s
10+
end
11+
12+
local function printf(...)
13+
return print(string.format(...))
14+
end
15+
16+
local exclude = {protocols = 1, features = 1, version = 1, version_num = 1}
17+
18+
local info = curl.version_info()
19+
20+
print(curl.version())
21+
22+
for _, key in ipairs(keys(info)) do if not exclude[key] then
23+
printf("%15s: %s", key, info[key])
24+
end end
25+
26+
print('Protocols:')
27+
for _, protocol in ipairs(keys(info.protocols))do
28+
local on = info.protocols[protocol]
29+
printf(' [%s] %s', on and '+' or '-', protocol)
30+
end
31+
32+
print('Features:')
33+
for _, feature in ipairs(keys(info.features))do
34+
local on = info.features[feature]
35+
printf(' [%s] %s', on and '+' or '-', feature)
36+
end

rockspecs/lua-curl-0.3.8-1.rockspec

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package = "Lua-cURL"
2+
version = "0.3.8-1"
3+
4+
source = {
5+
url = "https://github.com/Lua-cURL/Lua-cURLv3/archive/v0.3.8.zip",
6+
dir = "Lua-cURLv3-0.3.8",
7+
}
8+
9+
description = {
10+
summary = "Lua binding to libcurl",
11+
detailed = [[
12+
]],
13+
homepage = "https://github.com/Lua-cURL",
14+
license = "MIT/X11"
15+
}
16+
17+
dependencies = {
18+
"lua >= 5.1, < 5.4"
19+
}
20+
21+
external_dependencies = {
22+
platforms = {
23+
windows = {
24+
CURL = {
25+
header = "curl/curl.h",
26+
library = "libcurl",
27+
}
28+
};
29+
unix = {
30+
CURL = {
31+
header = "curl/curl.h",
32+
-- library = "curl",
33+
}
34+
};
35+
}
36+
}
37+
38+
build = {
39+
copy_directories = {'doc', 'examples', 'test'},
40+
41+
type = "builtin",
42+
43+
platforms = {
44+
windows = { modules = {
45+
lcurl = {
46+
libraries = {"libcurl", "ws2_32"},
47+
}
48+
}},
49+
unix = { modules = {
50+
lcurl = {
51+
libraries = {"curl"},
52+
}
53+
}}
54+
},
55+
56+
modules = {
57+
["cURL" ] = "src/lua/cURL.lua",
58+
["cURL.safe" ] = "src/lua/cURL/safe.lua",
59+
["cURL.utils" ] = "src/lua/cURL/utils.lua",
60+
["cURL.impl.cURL" ] = "src/lua/cURL/impl/cURL.lua",
61+
62+
lcurl = {
63+
sources = {
64+
"src/l52util.c", "src/lceasy.c", "src/lcerror.c",
65+
"src/lchttppost.c", "src/lcurl.c", "src/lcutils.c",
66+
"src/lcmulti.c", "src/lcshare.c",
67+
},
68+
incdirs = { "$(CURL_INCDIR)" },
69+
libdirs = { "$(CURL_LIBDIR)" }
70+
},
71+
}
72+
}
73+
74+

src/lua/cURL/impl/cURL.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--
22
-- Author: Alexey Melnichuk <[email protected]>
33
--
4-
-- Copyright (C) 2014-2017 Alexey Melnichuk <[email protected]>
4+
-- Copyright (C) 2014-2018 Alexey Melnichuk <[email protected]>
55
--
66
-- Licensed according to the included 'LICENSE' document
77
--
@@ -10,9 +10,9 @@
1010

1111
local module_info = {
1212
_NAME = "Lua-cURL";
13-
_VERSION = "0.3.8-dev";
13+
_VERSION = "0.3.8";
1414
_LICENSE = "MIT";
15-
_COPYRIGHT = "Copyright (c) 2014-2017 Alexey Melnichuk";
15+
_COPYRIGHT = "Copyright (c) 2014-2018 Alexey Melnichuk";
1616
}
1717

1818
local function hash_id(str)

0 commit comments

Comments
 (0)