gpgenv 0.1.5 → 0.1.6
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 +4 -4
- data/README.md +2 -4
- data/bin/gpgenv +9 -3
- data/lib/gpgenv/gpgenv_command.rb +41 -0
- data/lib/gpgenv/version.rb +1 -1
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7ecbe2313308b638a10d233136b3a48289e554cc
         | 
| 4 | 
            +
              data.tar.gz: 7bcf49271836774facf4fb957a07bfb6d69397ee
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: a32b7b1ee9943987ec23dc2085c7ec84db2aeff0ece43c1fa5566dad22d1ff4e1eff408ee1226c117d4c5aaa232582a83d26aad3aaec9f53608b7bab9af3a5fc
         | 
| 7 | 
            +
              data.tar.gz: d5218f52b6e4832ec5d1337e243403af82caf3c825e4801930a54d33ca433b3362ece09f54caf35b76ff09a70f17ff03bedc8c2c6049bb05c4c45ebb53421160
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,14 +1,12 @@ | |
| 1 1 | 
             
            # Gpgenv
         | 
| 2 2 |  | 
| 3 3 | 
             
            ## Wat?
         | 
| 4 | 
            -
            Gpgenv is similar to [envdir](http://cr.yp.to/daemontools/envdir.html), but it lets you use gpg-encrypted 
         | 
| 5 | 
            -
            files. This is very useful if you want to store sensitive credentials on your machine, but you want to 
         | 
| 4 | 
            +
            Gpgenv is similar to [envdir](http://cr.yp.to/daemontools/envdir.html) and [dotenv](https://github.com/bkeepers/dotenv), but it lets you use gpg-encrypted files. This is useful if you want to store sensitive credentials on your machine, but you want to 
         | 
| 6 5 | 
             
            keep them encrypted. 
         | 
| 7 6 |  | 
| 8 7 | 
             
            ## Why?
         | 
| 9 8 | 
             
            As an admin, I am guilty of occasionally storing sensitive credentials on disk. Personal experience leads me to believe that this is
         | 
| 10 | 
            -
            extremely common. Your .netrc file probably contains all sorts of sensitive data, and even if you use a gpg-encrypted .netrc file, many tools
         | 
| 11 | 
            -
            simply don't understand gpg. Storing this stuff in plaintext is dangerous - but you do it anyway because the alternatives are just too painful.
         | 
| 9 | 
            +
            extremely common. Your .netrc file probably contains all sorts of sensitive data, and even if you use a gpg-encrypted .netrc file, many tools simply don't understand gpg. Storing this stuff in plaintext is dangerous, but you do it anyway because the alternatives are just too painful.
         | 
| 12 10 |  | 
| 13 11 | 
             
            I love [pass](http://www.passwordstore.org/), because it makes it easy to store passwords encrypted. But it doesn't make it easy to *use* 
         | 
| 14 12 | 
             
            them in any capacity other than copy-and-pasting them. I wrote `gpgenv` to bridge that gap: Easily edit gpg-encrypted files, easily
         | 
    
        data/bin/gpgenv
    CHANGED
    
    | @@ -1,7 +1,14 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 | 
            -
            require 'gpgenv/ | 
| 2 | 
            +
            require 'gpgenv/gpgenv_command'
         | 
| 3 3 | 
             
            begin
         | 
| 4 | 
            -
               | 
| 4 | 
            +
              # Support both "gpgenv <do-something>" and "gpgenv <subcommand>".
         | 
| 5 | 
            +
              if ARGV.first && ARGV.first == '--version'
         | 
| 6 | 
            +
                puts Gpgenv::VERSION 
         | 
| 7 | 
            +
              elsif ARGV.first && ARGV.first[0] != '-' && !Gpgenv::GpgenvCommand.find_subcommand(ARGV.first)
         | 
| 8 | 
            +
                Gpgenv::ExecCommand.run
         | 
| 9 | 
            +
              else
         | 
| 10 | 
            +
                Gpgenv::GpgenvCommand.run
         | 
| 11 | 
            +
              end 
         | 
| 5 12 | 
             
            rescue StandardError => bang
         | 
| 6 13 | 
             
              raise if ENV['DEBUG'] == 'true'
         | 
| 7 14 | 
             
              puts bang.message
         | 
| @@ -9,4 +16,3 @@ rescue StandardError => bang | |
| 9 16 | 
             
            end
         | 
| 10 17 |  | 
| 11 18 |  | 
| 12 | 
            -
             | 
| @@ -0,0 +1,41 @@ | |
| 1 | 
            +
            require 'gpgenv'
         | 
| 2 | 
            +
            require 'clamp'
         | 
| 3 | 
            +
            require 'gpgenv/edit_command'
         | 
| 4 | 
            +
            require 'gpgenv/exec_command'
         | 
| 5 | 
            +
            require 'gpgenv/export_command'
         | 
| 6 | 
            +
            require 'gpgenv/import_command'
         | 
| 7 | 
            +
            require 'gpgenv/set_command'
         | 
| 8 | 
            +
            require 'gpgenv/shell_command'
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            class Gpgenv
         | 
| 11 | 
            +
              class GpgenvCommand < Clamp::Command
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                option '--version', :flag, "Print version"
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                subcommand 'exec',
         | 
| 16 | 
            +
                  'Execute the given shell command, using .gpgenv env vars',
         | 
| 17 | 
            +
                  Gpgenv::ExecCommand
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                subcommand 'edit',
         | 
| 20 | 
            +
                  'Use $EDITOR to edit your .gpgenv vars',
         | 
| 21 | 
            +
                  Gpgenv::EditCommand
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                subcommand 'set',
         | 
| 24 | 
            +
                  'Set a .gpgenv var',
         | 
| 25 | 
            +
                  Gpgenv::SetCommand
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                subcommand 'import',
         | 
| 28 | 
            +
                  'Import a .env file to .gpgenv',
         | 
| 29 | 
            +
                  Gpgenv::ImportCommand
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                subcommand 'export',
         | 
| 32 | 
            +
                  'export a .gpgenv directory to a .env file',
         | 
| 33 | 
            +
                  Gpgenv::ExportCommand
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                def execute
         | 
| 36 | 
            +
                  if version?
         | 
| 37 | 
            +
                    puts Gpgenv.VERSION
         | 
| 38 | 
            +
                  end
         | 
| 39 | 
            +
                end
         | 
| 40 | 
            +
              end
         | 
| 41 | 
            +
            end
         | 
    
        data/lib/gpgenv/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: gpgenv
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Michael Shea
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2017-01-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: clamp
         | 
| @@ -142,6 +142,7 @@ files: | |
| 142 142 | 
             
            - lib/gpgenv/error.rb
         | 
| 143 143 | 
             
            - lib/gpgenv/exec_command.rb
         | 
| 144 144 | 
             
            - lib/gpgenv/export_command.rb
         | 
| 145 | 
            +
            - lib/gpgenv/gpgenv_command.rb
         | 
| 145 146 | 
             
            - lib/gpgenv/import_command.rb
         | 
| 146 147 | 
             
            - lib/gpgenv/set_command.rb
         | 
| 147 148 | 
             
            - lib/gpgenv/shell_command.rb
         |