capng_c 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 255863aedacdc832b5ff8da87fb0d97a2916a65b1385c6f8072281967039d632
4
- data.tar.gz: e145914ff785ff35cf7df36e86e9fca56a6de5228139b4e9ef586888be20bad3
3
+ metadata.gz: 2bb0e5ea482272f6f1678202e013e2279429a8d8db9331560a0037d5d3affee5
4
+ data.tar.gz: d00913ec86725ff56ec782cec00ade00c12ce7583963dabe080d2ae7f43a6de2
5
5
  SHA512:
6
- metadata.gz: e401c25553011b8e922b1f7c80574fef9d9890464905b29513485c7a1627091fa26532d6f461d86aeb202e82b64eddca7f31edde1e48f07a00bf8cb3fe67ab01
7
- data.tar.gz: 6d6f3fbf99fc67ea2ec32f5803a453782d2f10e6773d7db1905eba33d01c657cb7a3a238d7cc65f910f5ad361398964b44135f4bf79c256d0edb35222f2cdb8d
6
+ metadata.gz: 7fffbe03cb38e5237a24a4dacd9c0b0908d9d63692f04ef2c8e4e0181d96860f3ca0c6d2a7c35319123aaf6176b1faca303c8a6d4ddff1cd7c413250297112b6
7
+ data.tar.gz: 022ef6afb55bcaac0b83e8a31ae634f7839a2f8a6f49dc493328f0dd8ee44f04420227cf37eee3169142d6b5bbe8ee1c5df976f4e0158deffa225545c6c863c9
@@ -226,13 +226,26 @@ rb_capng_update(VALUE self,
226
226
  }
227
227
 
228
228
  static VALUE
229
- rb_capng_apply(VALUE self, VALUE rb_action_set)
229
+ rb_capng_apply(VALUE self, VALUE rb_select_name_or_enum)
230
230
  {
231
231
  int result = 0;
232
+ capng_select_t select = 0;
232
233
 
233
- Check_Type(rb_action_set, T_FIXNUM);
234
+ switch (TYPE(rb_select_name_or_enum)) {
235
+ case T_SYMBOL:
236
+ select = select_name_to_select_type(RSTRING_PTR(rb_sym2str(rb_select_name_or_enum)));
237
+ break;
238
+ case T_STRING:
239
+ select = select_name_to_select_type(StringValuePtr(rb_select_name_or_enum));
240
+ break;
241
+ case T_FIXNUM:
242
+ select = NUM2INT(rb_select_name_or_enum);
243
+ break;
244
+ default:
245
+ rb_raise(rb_eArgError, "Expected a String or a Symbol instance, or a capability type constant");
246
+ }
234
247
 
235
- result = capng_apply(NUM2INT(rb_action_set));
248
+ result = capng_apply(select);
236
249
 
237
250
  if (result == 0)
238
251
  return Qtrue;
@@ -1,3 +1,3 @@
1
1
  class CapNG
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capng_c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake