ruby-gpgme 1.0.1 → 1.0.2
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.
- data/Makefile +34 -26
 - data/examples/genkey.rb +1 -1
 - data/examples/keylist.rb +0 -0
 - data/examples/roundtrip.rb +2 -2
 - data/examples/sign.rb +1 -1
 - data/examples/verify.rb +0 -0
 - data/lib/gpgme.rb +9 -3
 - metadata +3 -3
 
    
        data/Makefile
    CHANGED
    
    | 
         @@ -7,32 +7,35 @@ srcdir = . 
     | 
|
| 
       7 
7 
     | 
    
         
             
            topdir = /usr/lib/ruby/1.8/i486-linux
         
     | 
| 
       8 
8 
     | 
    
         
             
            hdrdir = $(topdir)
         
     | 
| 
       9 
9 
     | 
    
         
             
            VPATH = $(srcdir):$(topdir):$(hdrdir)
         
     | 
| 
       10 
     | 
    
         
            -
            prefix = $(DESTDIR)/usr
         
     | 
| 
       11 
10 
     | 
    
         
             
            exec_prefix = $(prefix)
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
            dvidir = $(docdir)
         
     | 
| 
       16 
     | 
    
         
            -
            datarootdir = $(prefix)/share
         
     | 
| 
       17 
     | 
    
         
            -
            archdir = $(rubylibdir)/$(arch)
         
     | 
| 
       18 
     | 
    
         
            -
            sbindir = $(exec_prefix)/sbin
         
     | 
| 
      
 11 
     | 
    
         
            +
            prefix = $(DESTDIR)/usr
         
     | 
| 
      
 12 
     | 
    
         
            +
            sharedstatedir = $(prefix)/com
         
     | 
| 
      
 13 
     | 
    
         
            +
            mandir = $(prefix)/share/man
         
     | 
| 
       19 
14 
     | 
    
         
             
            psdir = $(docdir)
         
     | 
| 
      
 15 
     | 
    
         
            +
            oldincludedir = $(DESTDIR)/usr/include
         
     | 
| 
       20 
16 
     | 
    
         
             
            localedir = $(datarootdir)/locale
         
     | 
| 
      
 17 
     | 
    
         
            +
            bindir = $(exec_prefix)/bin
         
     | 
| 
      
 18 
     | 
    
         
            +
            libexecdir = $(prefix)/lib/ruby1.8
         
     | 
| 
      
 19 
     | 
    
         
            +
            sitedir = $(DESTDIR)/usr/local/lib/site_ruby
         
     | 
| 
       21 
20 
     | 
    
         
             
            htmldir = $(docdir)
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
      
 21 
     | 
    
         
            +
            vendorarchdir = $(vendorlibdir)/$(sitearch)
         
     | 
| 
       23 
22 
     | 
    
         
             
            includedir = $(prefix)/include
         
     | 
| 
       24 
23 
     | 
    
         
             
            infodir = $(prefix)/share/info
         
     | 
| 
      
 24 
     | 
    
         
            +
            vendorlibdir = $(vendordir)/$(ruby_version)
         
     | 
| 
       25 
25 
     | 
    
         
             
            sysconfdir = $(DESTDIR)/etc
         
     | 
| 
       26 
     | 
    
         
            -
            mandir = $(prefix)/share/man
         
     | 
| 
       27 
26 
     | 
    
         
             
            libdir = $(exec_prefix)/lib
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
      
 27 
     | 
    
         
            +
            sbindir = $(exec_prefix)/sbin
         
     | 
| 
      
 28 
     | 
    
         
            +
            rubylibdir = $(libdir)/ruby/$(ruby_version)
         
     | 
| 
      
 29 
     | 
    
         
            +
            docdir = $(datarootdir)/doc/$(PACKAGE)
         
     | 
| 
      
 30 
     | 
    
         
            +
            dvidir = $(docdir)
         
     | 
| 
      
 31 
     | 
    
         
            +
            vendordir = $(libdir)/ruby/vendor_ruby
         
     | 
| 
      
 32 
     | 
    
         
            +
            datarootdir = $(prefix)/share
         
     | 
| 
       30 
33 
     | 
    
         
             
            pdfdir = $(docdir)
         
     | 
| 
      
 34 
     | 
    
         
            +
            archdir = $(rubylibdir)/$(arch)
         
     | 
| 
       31 
35 
     | 
    
         
             
            sitearchdir = $(sitelibdir)/$(sitearch)
         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 36 
     | 
    
         
            +
            datadir = $(datarootdir)
         
     | 
| 
       33 
37 
     | 
    
         
             
            localstatedir = $(DESTDIR)/var
         
     | 
| 
       34 
38 
     | 
    
         
             
            sitelibdir = $(sitedir)/$(ruby_version)
         
     | 
| 
       35 
     | 
    
         
            -
            libexecdir = $(prefix)/lib/ruby1.8
         
     | 
| 
       36 
39 
     | 
    
         | 
| 
       37 
40 
     | 
    
         
             
            CC = cc
         
     | 
| 
       38 
41 
     | 
    
         
             
            LIBRUBY = $(LIBRUBY_SO)
         
     | 
| 
         @@ -41,11 +44,15 @@ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME) 
     | 
|
| 
       41 
44 
     | 
    
         
             
            LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
         
     | 
| 
       42 
45 
     | 
    
         | 
| 
       43 
46 
     | 
    
         
             
            RUBY_EXTCONF_H = 
         
     | 
| 
       44 
     | 
    
         
            -
            CFLAGS   =  -fPIC -fno-strict-aliasing -g -O2  -fPIC  
         
     | 
| 
      
 47 
     | 
    
         
            +
            CFLAGS   =  -fPIC -fno-strict-aliasing -g -g -O2  -fPIC $(cflags)  
         
     | 
| 
       45 
48 
     | 
    
         
             
            INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
      
 49 
     | 
    
         
            +
            DEFS     = -D_FILE_OFFSET_BITS=64
         
     | 
| 
      
 50 
     | 
    
         
            +
            CPPFLAGS =   $(DEFS) $(cppflags)
         
     | 
| 
       47 
51 
     | 
    
         
             
            CXXFLAGS = $(CFLAGS) 
         
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
      
 52 
     | 
    
         
            +
            ldflags  = -L.  -rdynamic -Wl,-export-dynamic
         
     | 
| 
      
 53 
     | 
    
         
            +
            dldflags = 
         
     | 
| 
      
 54 
     | 
    
         
            +
            archflag = 
         
     | 
| 
      
 55 
     | 
    
         
            +
            DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
         
     | 
| 
       49 
56 
     | 
    
         
             
            LDSHARED = $(CC) -shared
         
     | 
| 
       50 
57 
     | 
    
         
             
            AR = ar
         
     | 
| 
       51 
58 
     | 
    
         
             
            EXEEXT = 
         
     | 
| 
         @@ -69,7 +76,7 @@ COPY = cp 
     | 
|
| 
       69 
76 
     | 
    
         
             
            preload = 
         
     | 
| 
       70 
77 
     | 
    
         | 
| 
       71 
78 
     | 
    
         
             
            libpath = . $(libdir)
         
     | 
| 
       72 
     | 
    
         
            -
            LIBPATH =  -L 
     | 
| 
      
 79 
     | 
    
         
            +
            LIBPATH =  -L. -L$(libdir)
         
     | 
| 
       73 
80 
     | 
    
         
             
            DEFFILE = 
         
     | 
| 
       74 
81 
     | 
    
         | 
| 
       75 
82 
     | 
    
         
             
            CLEANFILES = mkmf.log
         
     | 
| 
         @@ -87,6 +94,7 @@ DLLIB = $(TARGET).so 
     | 
|
| 
       87 
94 
     | 
    
         
             
            EXTSTATIC = 
         
     | 
| 
       88 
95 
     | 
    
         
             
            STATIC_LIB = 
         
     | 
| 
       89 
96 
     | 
    
         | 
| 
      
 97 
     | 
    
         
            +
            BINDIR        = $(bindir)
         
     | 
| 
       90 
98 
     | 
    
         
             
            RUBYCOMMONDIR = $(sitedir)$(target_prefix)
         
     | 
| 
       91 
99 
     | 
    
         
             
            RUBYLIBDIR    = $(sitelibdir)$(target_prefix)
         
     | 
| 
       92 
100 
     | 
    
         
             
            RUBYARCHDIR   = $(sitearchdir)$(target_prefix)
         
     | 
| 
         @@ -116,23 +124,23 @@ install-rb: pre-install-rb install-rb-default 
     | 
|
| 
       116 
124 
     | 
    
         
             
            install-rb-default: pre-install-rb-default
         
     | 
| 
       117 
125 
     | 
    
         
             
            pre-install-rb: Makefile
         
     | 
| 
       118 
126 
     | 
    
         
             
            pre-install-rb-default: Makefile
         
     | 
| 
       119 
     | 
    
         
            -
            pre-install-rb-default: $(RUBYLIBDIR)
         
     | 
| 
       120 
     | 
    
         
            -
            install-rb-default: $(RUBYLIBDIR)/gpgme.rb
         
     | 
| 
       121 
     | 
    
         
            -
            $(RUBYLIBDIR)/gpgme.rb: $(srcdir)/lib/gpgme.rb
         
     | 
| 
       122 
     | 
    
         
            -
            	$(INSTALL_DATA) $(srcdir)/lib/gpgme.rb $(@D)
         
     | 
| 
       123 
127 
     | 
    
         
             
            pre-install-rb-default: $(RUBYLIBDIR)/gpgme
         
     | 
| 
       124 
128 
     | 
    
         
             
            install-rb-default: $(RUBYLIBDIR)/gpgme/compat.rb
         
     | 
| 
       125 
     | 
    
         
            -
            $(RUBYLIBDIR)/gpgme/compat.rb: $(srcdir)/lib/gpgme/compat.rb
         
     | 
| 
      
 129 
     | 
    
         
            +
            $(RUBYLIBDIR)/gpgme/compat.rb: $(srcdir)/lib/gpgme/compat.rb $(RUBYLIBDIR)/gpgme
         
     | 
| 
       126 
130 
     | 
    
         
             
            	$(INSTALL_DATA) $(srcdir)/lib/gpgme/compat.rb $(@D)
         
     | 
| 
       127 
131 
     | 
    
         
             
            install-rb-default: $(RUBYLIBDIR)/gpgme/constants.rb
         
     | 
| 
       128 
     | 
    
         
            -
            $(RUBYLIBDIR)/gpgme/constants.rb: $(srcdir)/lib/gpgme/constants.rb
         
     | 
| 
      
 132 
     | 
    
         
            +
            $(RUBYLIBDIR)/gpgme/constants.rb: $(srcdir)/lib/gpgme/constants.rb $(RUBYLIBDIR)/gpgme
         
     | 
| 
       129 
133 
     | 
    
         
             
            	$(INSTALL_DATA) $(srcdir)/lib/gpgme/constants.rb $(@D)
         
     | 
| 
      
 134 
     | 
    
         
            +
            pre-install-rb-default: $(RUBYLIBDIR)
         
     | 
| 
      
 135 
     | 
    
         
            +
            install-rb-default: $(RUBYLIBDIR)/gpgme.rb
         
     | 
| 
      
 136 
     | 
    
         
            +
            $(RUBYLIBDIR)/gpgme.rb: $(srcdir)/lib/gpgme.rb $(RUBYLIBDIR)
         
     | 
| 
      
 137 
     | 
    
         
            +
            	$(INSTALL_DATA) $(srcdir)/lib/gpgme.rb $(@D)
         
     | 
| 
       130 
138 
     | 
    
         
             
            $(RUBYARCHDIR):
         
     | 
| 
       131 
139 
     | 
    
         
             
            	$(MAKEDIRS) $@
         
     | 
| 
       132 
     | 
    
         
            -
            $(RUBYLIBDIR):
         
     | 
| 
       133 
     | 
    
         
            -
            	$(MAKEDIRS) $@
         
     | 
| 
       134 
140 
     | 
    
         
             
            $(RUBYLIBDIR)/gpgme:
         
     | 
| 
       135 
141 
     | 
    
         
             
            	$(MAKEDIRS) $@
         
     | 
| 
      
 142 
     | 
    
         
            +
            $(RUBYLIBDIR):
         
     | 
| 
      
 143 
     | 
    
         
            +
            	$(MAKEDIRS) $@
         
     | 
| 
       136 
144 
     | 
    
         | 
| 
       137 
145 
     | 
    
         
             
            site-install: site-install-so site-install-rb
         
     | 
| 
       138 
146 
     | 
    
         
             
            site-install-so: install-so
         
     | 
    
        data/examples/genkey.rb
    CHANGED
    
    
    
        data/examples/keylist.rb
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        data/examples/roundtrip.rb
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ require 'gpgme' 
     | 
|
| 
       16 
16 
     | 
    
         
             
            #     (0 ... $_.length).each do |i| $_[i] = ?0 end if $_
         
     | 
| 
       17 
17 
     | 
    
         
             
            #     system('stty echo')
         
     | 
| 
       18 
18 
     | 
    
         
             
            #   end
         
     | 
| 
       19 
     | 
    
         
            -
            #   puts
         
     | 
| 
      
 19 
     | 
    
         
            +
            #   $stderr.puts
         
     | 
| 
       20 
20 
     | 
    
         
             
            # end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
            unless ENV['GPG_AGENT_INFO']
         
     | 
| 
         @@ -28,7 +28,7 @@ plain = 'test test test' 
     | 
|
| 
       28 
28 
     | 
    
         
             
            puts("Plaintext:\n#{plain}")
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
            # Perform symmetric encryption on PLAIN.
         
     | 
| 
       31 
     | 
    
         
            -
            cipher = GPGME::encrypt(nil, plain, {:armor => true
         
     | 
| 
      
 31 
     | 
    
         
            +
            cipher = GPGME::encrypt(nil, plain, {:armor => true,
         
     | 
| 
       32 
32 
     | 
    
         
             
            			  # :passphrase_callback => method(:passfunc)
         
     | 
| 
       33 
33 
     | 
    
         
             
            			})
         
     | 
| 
       34 
34 
     | 
    
         
             
            puts("Ciphertext:\n#{cipher}")
         
     | 
    
        data/examples/sign.rb
    CHANGED
    
    
    
        data/examples/verify.rb
    CHANGED
    
    | 
         
            File without changes
         
     | 
    
        data/lib/gpgme.rb
    CHANGED
    
    | 
         @@ -344,9 +344,11 @@ end 
     | 
|
| 
       344 
344 
     | 
    
         
             
            # <i>options</i> are same as <code>GPGME::Ctx.new()</code> except for
         
     | 
| 
       345 
345 
     | 
    
         
             
            #
         
     | 
| 
       346 
346 
     | 
    
         
             
            # - <tt>:sign</tt> If <tt>true</tt>, it performs a combined sign and
         
     | 
| 
       347 
     | 
    
         
            -
            # 
     | 
| 
      
 347 
     | 
    
         
            +
            #   encrypt operation.
         
     | 
| 
       348 
348 
     | 
    
         
             
            # - <tt>:signers</tt> Signing keys.  If specified, it is an array
         
     | 
| 
       349 
349 
     | 
    
         
             
            #   whose elements are a GPGME::Key object or a string.
         
     | 
| 
      
 350 
     | 
    
         
            +
            # - <tt>:always_trust</tt> Setting this to <tt>true</tt> specifies all
         
     | 
| 
      
 351 
     | 
    
         
            +
            #   the recipients should be trusted.
         
     | 
| 
       350 
352 
     | 
    
         
             
            #
         
     | 
| 
       351 
353 
     | 
    
         
             
            def GPGME.encrypt(recipients, plain, *args_options)
         
     | 
| 
       352 
354 
     | 
    
         
             
              raise ArgumentError, 'wrong number of arguments' if args_options.length > 3
         
     | 
| 
         @@ -358,13 +360,17 @@ def GPGME.encrypt(recipients, plain, *args_options) 
     | 
|
| 
       358 
360 
     | 
    
         
             
              plain_data = input_data(plain)
         
     | 
| 
       359 
361 
     | 
    
         
             
              cipher_data = output_data(cipher)
         
     | 
| 
       360 
362 
     | 
    
         
             
              begin
         
     | 
| 
      
 363 
     | 
    
         
            +
                flags = 0
         
     | 
| 
      
 364 
     | 
    
         
            +
                if options[:always_trust]
         
     | 
| 
      
 365 
     | 
    
         
            +
                  flags |= GPGME::ENCRYPT_ALWAYS_TRUST
         
     | 
| 
      
 366 
     | 
    
         
            +
                end
         
     | 
| 
       361 
367 
     | 
    
         
             
                if options[:sign]
         
     | 
| 
       362 
368 
     | 
    
         
             
                  if options[:signers]
         
     | 
| 
       363 
369 
     | 
    
         
             
                    ctx.add_signer(*resolve_keys(options[:signers], true))
         
     | 
| 
       364 
370 
     | 
    
         
             
                  end
         
     | 
| 
       365 
     | 
    
         
            -
                  ctx.encrypt_sign(recipient_keys, plain_data, cipher_data)
         
     | 
| 
      
 371 
     | 
    
         
            +
                  ctx.encrypt_sign(recipient_keys, plain_data, cipher_data, flags)
         
     | 
| 
       366 
372 
     | 
    
         
             
                else
         
     | 
| 
       367 
     | 
    
         
            -
                  ctx.encrypt(recipient_keys, plain_data, cipher_data)
         
     | 
| 
      
 373 
     | 
    
         
            +
                  ctx.encrypt(recipient_keys, plain_data, cipher_data, flags)
         
     | 
| 
       368 
374 
     | 
    
         
             
                end
         
     | 
| 
       369 
375 
     | 
    
         
             
              rescue GPGME::Error::UnusablePublicKey => exc
         
     | 
| 
       370 
376 
     | 
    
         
             
                exc.keys = ctx.encrypt_result.invalid_recipients
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ruby-gpgme
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Daiki Ueno
         
     | 
| 
         @@ -9,7 +9,7 @@ autorequire: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            date: 2008- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2008-12-30 00:00:00 +09:00
         
     | 
| 
       13 
13 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
         @@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       58 
58 
     | 
    
         
             
            requirements: []
         
     | 
| 
       59 
59 
     | 
    
         | 
| 
       60 
60 
     | 
    
         
             
            rubyforge_project: ruby-gpgme
         
     | 
| 
       61 
     | 
    
         
            -
            rubygems_version: 1.0 
     | 
| 
      
 61 
     | 
    
         
            +
            rubygems_version: 1.2.0
         
     | 
| 
       62 
62 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       63 
63 
     | 
    
         
             
            specification_version: 2
         
     | 
| 
       64 
64 
     | 
    
         
             
            summary: Ruby binding of GPGME.
         
     |