gpgme 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require 'mkmf'
2
2
 
3
3
  BUILD = Dir::pwd
4
4
  SRC = File.expand_path(File.dirname(__FILE__))
5
- PREFIX = "#{BUILD}/dst/"
5
+ PREFIX = "#{BUILD}/dst"
6
6
 
7
7
  def sys(*cmd)
8
8
  puts " -- #{cmd.join(' ')}"
@@ -47,7 +47,7 @@ $CFLAGS << " -fPIC "
47
47
 
48
48
  # build gpgme extension
49
49
 
50
- unless have_library 'gpg-error_ext' and have_library 'gpgme_ext' and have_library 'assuan_ext' and have_library 'gpg-error_ext' and have_header 'gpgme.h'
50
+ unless have_library 'gpg-error_ext' and have_library 'assuan_ext' and have_library 'gpgme_ext' and have_header 'gpgme.h'
51
51
  STDERR.puts "\n\n"
52
52
  STDERR.puts "*********************************************************"
53
53
  STDERR.puts "********* error compiling and linking libgpgme. *********"
@@ -1540,7 +1540,13 @@ rb_s_gpgme_op_verify_result (VALUE dummy, VALUE vctx)
1540
1540
  notation = notation->next)
1541
1541
  {
1542
1542
  VALUE vnotation = rb_class_new_instance(0, NULL, cSigNotation);
1543
- rb_iv_set (vnotation, "@name", rb_str_new2 (notation->name));
1543
+ /* The docs say:
1544
+ * The name of the notation field. If this is NULL, then the member
1545
+ * value will contain a policy URL. */
1546
+ if (notation->name == NULL)
1547
+ rb_iv_set (vnotation, "@name", Qnil);
1548
+ else
1549
+ rb_iv_set (vnotation, "@name", rb_str_new2 (notation->name));
1544
1550
  rb_iv_set (vnotation, "@value", rb_str_new2 (notation->value));
1545
1551
  rb_ary_push (vnotations, vnotation);
1546
1552
  }
@@ -173,5 +173,17 @@ module GPGME
173
173
  raise exc if exc
174
174
  encoding
175
175
  end
176
+
177
+ ##
178
+ # Return the entire content of the data object as string.
179
+ def to_s
180
+ pos = seek(0, IO::SEEK_CUR)
181
+ begin
182
+ seek(0)
183
+ read
184
+ ensure
185
+ seek(pos)
186
+ end
187
+ end
176
188
  end
177
189
  end
@@ -25,7 +25,7 @@ module GPGME
25
25
  # Return an array of {GPGME::EngineInfo} structures of enabled engines.
26
26
  #
27
27
  # @example
28
- # GPGME::Engine.engine_info.first
28
+ # GPGME::Engine.info.first
29
29
  # # => #<GPGME::EngineInfo:0x00000100d4fbd8
30
30
  # @file_name="/usr/local/bin/gpg",
31
31
  # @protocol=0,
@@ -3,6 +3,10 @@ require 'test_helper'
3
3
  require 'tempfile'
4
4
 
5
5
  describe GPGME::Crypto do
6
+ before do
7
+ skip unless GPGME::Engine.check_version GPGME::PROTOCOL_OpenPGP
8
+ end
9
+
6
10
  describe "default options functionality" do
7
11
  it "allows operation from instances normally" do
8
12
  crypto = GPGME::Crypto.new
@@ -2,6 +2,10 @@
2
2
  require 'test_helper'
3
3
 
4
4
  describe GPGME::Ctx do
5
+ before do
6
+ skip unless GPGME::Engine.check_version GPGME::PROTOCOL_OpenPGP
7
+ end
8
+
5
9
  it "can instantiate" do
6
10
  assert_instance_of GPGME::Ctx, GPGME::Ctx.new
7
11
  end
@@ -112,5 +112,16 @@ describe GPGME::Data do
112
112
  end
113
113
  end
114
114
  end
115
+
116
+ describe :to_s do
117
+ it "returns the entire content of data" do
118
+ data = GPGME::Data.new("wadus")
119
+ data.read
120
+ old_pos = data.seek(0, IO::SEEK_CUR)
121
+ assert_equal "wadus", data.to_s
122
+ new_pos = data.seek(0, IO::SEEK_CUR)
123
+ assert_equal old_pos, new_pos
124
+ end
125
+ end
115
126
  end
116
127
 
@@ -2,6 +2,9 @@
2
2
  require 'test_helper'
3
3
 
4
4
  describe GPGME::Key do
5
+ before do
6
+ skip unless GPGME::Engine.check_version GPGME::PROTOCOL_OpenPGP
7
+ end
5
8
 
6
9
  it "has certain attributes" do
7
10
  key = GPGME::Key.find(:secret).first
@@ -2,6 +2,10 @@
2
2
  require 'test_helper'
3
3
 
4
4
  describe GPGME::Signature do
5
+ before do
6
+ skip unless GPGME::Engine.check_version GPGME::PROTOCOL_OpenPGP
7
+ end
8
+
5
9
  it "#valid? is true when the signature is valid" do
6
10
  crypto = GPGME::Crypto.new
7
11
  signatures = 0
@@ -2,6 +2,9 @@
2
2
  require 'test_helper'
3
3
 
4
4
  describe GPGME::SubKey do
5
+ before do
6
+ skip unless GPGME::Engine.check_version GPGME::PROTOCOL_OpenPGP
7
+ end
5
8
 
6
9
  # We trust Key for common methods that come from KeyCommon
7
10
 
@@ -74,10 +74,12 @@ def without_key(key, &block)
74
74
  end
75
75
  end
76
76
 
77
- # We use a different home directory for the keys to not disturb current
78
- # installation
79
-
80
- require 'tmpdir'
81
- GPGME::Engine.home_dir = Dir.tmpdir
82
- remove_all_keys
83
- import_keys
77
+ if GPGME::Engine.check_version GPGME::PROTOCOL_OpenPGP
78
+ # We use a different home directory for the keys to not disturb current
79
+ # installation
80
+
81
+ require 'tmpdir'
82
+ GPGME::Engine.home_dir = Dir.tmpdir
83
+ remove_all_keys
84
+ import_keys
85
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gpgme
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 0
10
- version: 2.0.0
9
+ - 1
10
+ version: 2.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daiki Ueno
@@ -112,44 +112,44 @@ extra_rdoc_files: []
112
112
 
113
113
  files:
114
114
  - lib/gpgme.rb
115
- - lib/gpgme/error.rb
115
+ - lib/gpgme/sub_key.rb
116
116
  - lib/gpgme/version.rb
117
- - lib/gpgme/signature.rb
118
- - lib/gpgme/engine.rb
119
117
  - lib/gpgme/key.rb
118
+ - lib/gpgme/key_sig.rb
119
+ - lib/gpgme/engine.rb
120
+ - lib/gpgme/ctx.rb
121
+ - lib/gpgme/signature.rb
122
+ - lib/gpgme/io_callbacks.rb
120
123
  - lib/gpgme/misc.rb
121
124
  - lib/gpgme/data.rb
122
- - lib/gpgme/io_callbacks.rb
123
- - lib/gpgme/key_sig.rb
124
125
  - lib/gpgme/constants.rb
125
- - lib/gpgme/sub_key.rb
126
+ - lib/gpgme/crypto.rb
126
127
  - lib/gpgme/compat.rb
127
128
  - lib/gpgme/key_common.rb
128
- - lib/gpgme/ctx.rb
129
- - lib/gpgme/crypto.rb
130
129
  - lib/gpgme/user_id.rb
131
- - ext/gpgme/gpgme_n.c
130
+ - lib/gpgme/error.rb
132
131
  - ext/gpgme/extconf.rb
133
- - ext/gpgme/libassuan-2.0.2.tar.bz2
132
+ - ext/gpgme/gpgme_n.c
134
133
  - ext/gpgme/libgpg-error-1.10.tar.bz2
134
+ - ext/gpgme/libassuan-2.0.2.tar.bz2
135
135
  - ext/gpgme/gpgme-1.3.1.tar.bz2
136
- - test/key_test.rb
137
- - test/sub_key_test.rb
138
- - test/test_helper.rb
139
- - test/data_test.rb
140
136
  - test/crypto_test.rb
137
+ - test/test_helper.rb
141
138
  - test/gpgme_test.rb
139
+ - test/key_test.rb
140
+ - test/files/testkey_pub.gpg
141
+ - test/files/testkey_sec.gpg
142
+ - test/data_test.rb
142
143
  - test/signature_test.rb
143
144
  - test/support/resources.rb
145
+ - test/sub_key_test.rb
144
146
  - test/ctx_test.rb
145
- - test/files/testkey_sec.gpg
146
- - test/files/testkey_pub.gpg
147
- - examples/sign.rb
148
- - examples/roundtrip.rb
149
147
  - examples/verify.rb
150
- - examples/genkey.rb
151
148
  - examples/keylist.rb
152
149
  - examples/edit.rb
150
+ - examples/roundtrip.rb
151
+ - examples/sign.rb
152
+ - examples/genkey.rb
153
153
  homepage: http://github.com/ueno/ruby-gpgme
154
154
  licenses: []
155
155
 
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  requirements: []
181
181
 
182
182
  rubyforge_project: ruby-gpgme
183
- rubygems_version: 1.8.10
183
+ rubygems_version: 1.8.11
184
184
  signing_key:
185
185
  specification_version: 3
186
186
  summary: Ruby binding of GPGME.