gpgme 2.0.15 → 2.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gpgme/gpgme_n.c +26 -0
- data/lib/gpgme/data.rb +17 -0
- data/lib/gpgme/version.rb +1 -1
- data/test/data_test.rb +15 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e116524f7d40d7f03d5273a1b39d155abff31b2
|
4
|
+
data.tar.gz: 3c2887c7995d2c96ea5edf1fbca4e91b3cfb695e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37278dddb406d5215deb50b702bb681ef0137648690c8f1f188550a22bf21b7856b17c0255d2cc418a1909c362befbd495d567bea961e7e7c8ddf38a9f94c212
|
7
|
+
data.tar.gz: 9a2aa9aa660b99256e2fbb12e23e61b2d914179461495f9ecdb453f9ed0b60bb9129883c997c7ad32f0ea0c518823c9077785dcd570731a534e7f8528aefaa8c
|
data/ext/gpgme/gpgme_n.c
CHANGED
@@ -468,6 +468,28 @@ rb_s_gpgme_data_set_encoding (VALUE dummy, VALUE vdh, VALUE venc)
|
|
468
468
|
return LONG2NUM(err);
|
469
469
|
}
|
470
470
|
|
471
|
+
static VALUE
|
472
|
+
rb_s_gpgme_data_get_file_name (VALUE dummy, VALUE vdh)
|
473
|
+
{
|
474
|
+
gpgme_data_t dh;
|
475
|
+
|
476
|
+
UNWRAP_GPGME_DATA(vdh, dh);
|
477
|
+
const char *result = gpgme_data_get_file_name (dh);
|
478
|
+
return result ? rb_str_new2 (result) : Qnil;
|
479
|
+
}
|
480
|
+
|
481
|
+
static VALUE
|
482
|
+
rb_s_gpgme_data_set_file_name (VALUE dummy, VALUE vdh, VALUE vfile_name)
|
483
|
+
{
|
484
|
+
gpgme_data_t dh;
|
485
|
+
gpgme_error_t err;
|
486
|
+
|
487
|
+
UNWRAP_GPGME_DATA(vdh, dh);
|
488
|
+
err = gpgme_data_set_file_name (dh,
|
489
|
+
NIL_P(vfile_name) ? NULL : StringValueCStr(vfile_name));
|
490
|
+
return LONG2NUM(err);
|
491
|
+
}
|
492
|
+
|
471
493
|
static VALUE
|
472
494
|
rb_s_gpgme_new (VALUE dummy, VALUE rctx)
|
473
495
|
{
|
@@ -2335,6 +2357,10 @@ Init_gpgme_n (void)
|
|
2335
2357
|
rb_s_gpgme_data_get_encoding, 1);
|
2336
2358
|
rb_define_module_function (mGPGME, "gpgme_data_set_encoding",
|
2337
2359
|
rb_s_gpgme_data_set_encoding, 2);
|
2360
|
+
rb_define_module_function (mGPGME, "gpgme_data_get_file_name",
|
2361
|
+
rb_s_gpgme_data_get_file_name, 1);
|
2362
|
+
rb_define_module_function (mGPGME, "gpgme_data_set_file_name",
|
2363
|
+
rb_s_gpgme_data_set_file_name, 2);
|
2338
2364
|
|
2339
2365
|
/* Creating Contexts */
|
2340
2366
|
rb_define_module_function (mGPGME, "gpgme_new",
|
data/lib/gpgme/data.rb
CHANGED
@@ -176,6 +176,23 @@ module GPGME
|
|
176
176
|
encoding
|
177
177
|
end
|
178
178
|
|
179
|
+
##
|
180
|
+
# Return the file name of the underlying data.
|
181
|
+
def file_name
|
182
|
+
GPGME::gpgme_data_get_file_name(self)
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# Sets the file name for this buffer.
|
187
|
+
#
|
188
|
+
# @raise [GPGME::Error::InvalidValue] if the value isn't accepted.
|
189
|
+
def file_name=(file_name)
|
190
|
+
err = GPGME::gpgme_data_set_file_name(self, file_name)
|
191
|
+
exc = GPGME::error_to_exception(err)
|
192
|
+
raise exc if exc
|
193
|
+
file_name
|
194
|
+
end
|
195
|
+
|
179
196
|
##
|
180
197
|
# Return the entire content of the data object as string.
|
181
198
|
def to_s
|
data/lib/gpgme/version.rb
CHANGED
data/test/data_test.rb
CHANGED
@@ -113,6 +113,21 @@ describe GPGME::Data do
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
+
describe :file_name do
|
117
|
+
it "has no name by default" do
|
118
|
+
data = GPGME::Data.new("wadus")
|
119
|
+
assert_nil data.file_name
|
120
|
+
end
|
121
|
+
|
122
|
+
it "can set file_name" do
|
123
|
+
data = GPGME::Data.new("wadus")
|
124
|
+
[ "foo.bar", nil ].each do |file_name|
|
125
|
+
data.file_name = file_name
|
126
|
+
assert_equal file_name, data.file_name
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
116
131
|
describe :to_s do
|
117
132
|
it "returns the entire content of data" do
|
118
133
|
data = GPGME::Data.new("wadus")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpgme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daiki Ueno
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mini_portile2
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.
|
62
|
+
version: 0.9.11
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.9.11
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: coveralls
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|