ruby_git_crypt 0.1.0.pre.1 → 0.1.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58708bdc311759486fd4d818881b53f5cda5f6d535f8e5c00eb53c54e3a1ac55
4
- data.tar.gz: e00ce54737466951c462d0753cbbe3afac084d1241516c3ace18c324e4bccc22
3
+ metadata.gz: 65d25a6f744b2583106ae7d4e3798b745aaa74527444db07c28efb2ef6a6531c
4
+ data.tar.gz: ecdef79e8352ad59297b8bfbfb27653607bac587cbb2b8145a6a5df6ca4b51f6
5
5
  SHA512:
6
- metadata.gz: 803e63d5587c07eb79f138fb17332291f0074616b1b734bd3026446bc19ffa47c6081beb7565f9fffae2d0cf28ea7c8bc61338be1cbf78f124e2890c5a8c43da
7
- data.tar.gz: e65a13db1734ae9f3e862227e60d8c5fda052a50e42ff0e68956e628cad9b877954d20e7aad3956a4b75a1d8d729ea4a18f6b84ba4aa50650edb82b114026374
6
+ metadata.gz: f9ac76ca228d8698ba35721a685829d9b4798254714f04cafda04cda16709cc826ff3e624c4a179fd67f94923ca1f307748030f62c99d290bdf018b8dcbec053
7
+ data.tar.gz: 9a0fd917ab50a2ebd7f5c497d79352bac20cb4b017bdee8627768581798899216215bf89592684e0b2ac494b0754404b0ca950c37af1342b70ba8d2d5b52293a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_git_crypt (0.1.0.pre.1)
4
+ ruby_git_crypt (0.1.0.pre.2)
5
5
  immutable-struct (~> 2.4)
6
6
  lino (~> 3.0)
7
7
 
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyGitCrypt
6
+ module Commands
7
+ class AddGPGUser < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[add-gpg-user]
11
+ end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ %w[
17
+ --key-name
18
+ --no-commit
19
+ --trusted
20
+ ]
21
+ end
22
+
23
+ # @!visibility private
24
+ def arguments(parameters)
25
+ [parameters[:gpg_user_id]]
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyGitCrypt
6
+ module Commands
7
+ class ExportKey < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[export-key]
11
+ end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ %w[
17
+ --key-name
18
+ ]
19
+ end
20
+
21
+ # @!visibility private
22
+ def arguments(parameters)
23
+ [parameters[:filename]]
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyGitCrypt
6
+ module Commands
7
+ class Init < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[init]
11
+ end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ %w[
17
+ --key-name
18
+ ]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyGitCrypt
6
+ module Commands
7
+ class Lock < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[lock]
11
+ end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ %w[
17
+ --all
18
+ --force
19
+ --key-name
20
+ ]
21
+ end
22
+ end
23
+ end
24
+ end
@@ -9,6 +9,21 @@ module RubyGitCrypt
9
9
  def subcommands
10
10
  %w[status]
11
11
  end
12
+
13
+ # @!visibility private
14
+ def options
15
+ super +
16
+ %w[
17
+ -e
18
+ -u
19
+ --fix
20
+ ]
21
+ end
22
+
23
+ # @!visibility private
24
+ def arguments(parameters)
25
+ [parameters[:files]]
26
+ end
12
27
  end
13
28
  end
14
29
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'base'
4
+
5
+ module RubyGitCrypt
6
+ module Commands
7
+ class Unlock < Base
8
+ # @!visibility private
9
+ def subcommands
10
+ %w[unlock]
11
+ end
12
+
13
+ # @!visibility private
14
+ def arguments(parameters)
15
+ [parameters[:key_files]]
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'commands/init'
3
4
  require_relative 'commands/status'
5
+ require_relative 'commands/lock'
6
+ require_relative 'commands/unlock'
7
+ require_relative 'commands/export_key'
8
+ require_relative 'commands/add_gpg_user'
4
9
 
5
10
  module RubyGitCrypt
6
11
  module Commands
@@ -2,6 +2,28 @@
2
2
 
3
3
  module RubyGitCrypt
4
4
  module Options
5
- DEFINITIONS = [].freeze
5
+ DEFINITIONS = [
6
+ # flag options
7
+ definition(name: '-e', option_type: :flag, value_type: :boolean,
8
+ override_keys: { singular: :encrypted_only }),
9
+ definition(name: '-u', option_type: :flag, value_type: :boolean,
10
+ override_keys: { singular: :unencrypted_only }),
11
+ %w[
12
+ --all
13
+ --fix
14
+ --force
15
+ --no-commit
16
+ --trusted
17
+ ].map do |o|
18
+ definition(name: o, option_type: :flag, value_type: :boolean)
19
+ end,
20
+
21
+ # string options
22
+ %w[
23
+ --key-name
24
+ ].map do |o|
25
+ definition(name: o, option_type: :standard, value_type: :string)
26
+ end
27
+ ].flatten.freeze
6
28
  end
7
29
  end
@@ -4,15 +4,13 @@ require 'immutable-struct'
4
4
 
5
5
  module RubyGitCrypt
6
6
  module Options
7
- class Name < ImmutableStruct.new(:name)
7
+ class Name < ImmutableStruct.new(:name, :prefix)
8
+ attr_reader :name
9
+
8
10
  def initialize(name)
9
11
  super(name: name.to_s)
10
12
  end
11
13
 
12
- def name
13
- "--#{without_prefix}"
14
- end
15
-
16
14
  alias to_s name
17
15
 
18
16
  def as_singular_key
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyGitCrypt
4
- VERSION = '0.1.0.pre.1'
4
+ VERSION = '0.1.0.pre.2'
5
5
  end
@@ -21,11 +21,36 @@ module RubyGitCrypt
21
21
  end
22
22
 
23
23
  module ClassMethods
24
+ def add_gpg_user(parameters = {}, invocation_options = {})
25
+ exec(RubyGitCrypt::Commands::AddGPGUser,
26
+ parameters, invocation_options)
27
+ end
28
+
29
+ def export_key(parameters = {}, invocation_options = {})
30
+ exec(RubyGitCrypt::Commands::ExportKey,
31
+ parameters, invocation_options)
32
+ end
33
+
34
+ def init(parameters = {}, invocation_options = {})
35
+ exec(RubyGitCrypt::Commands::Init,
36
+ parameters, invocation_options)
37
+ end
38
+
39
+ def lock(parameters = {}, invocation_options = {})
40
+ exec(RubyGitCrypt::Commands::Lock,
41
+ parameters, invocation_options)
42
+ end
43
+
24
44
  def status(parameters = {}, invocation_options = {})
25
45
  exec(RubyGitCrypt::Commands::Status,
26
46
  parameters, invocation_options)
27
47
  end
28
48
 
49
+ def unlock(parameters = {}, invocation_options = {})
50
+ exec(RubyGitCrypt::Commands::Unlock,
51
+ parameters, invocation_options)
52
+ end
53
+
29
54
  private
30
55
 
31
56
  def exec(command_class, parameters, invocation_options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_git_crypt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.1
4
+ version: 0.1.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
@@ -294,8 +294,13 @@ files:
294
294
  - bin/setup
295
295
  - lib/ruby_git_crypt.rb
296
296
  - lib/ruby_git_crypt/commands.rb
297
+ - lib/ruby_git_crypt/commands/add_gpg_user.rb
297
298
  - lib/ruby_git_crypt/commands/base.rb
299
+ - lib/ruby_git_crypt/commands/export_key.rb
300
+ - lib/ruby_git_crypt/commands/init.rb
301
+ - lib/ruby_git_crypt/commands/lock.rb
298
302
  - lib/ruby_git_crypt/commands/status.rb
303
+ - lib/ruby_git_crypt/commands/unlock.rb
299
304
  - lib/ruby_git_crypt/errors.rb
300
305
  - lib/ruby_git_crypt/errors/execution_error.rb
301
306
  - lib/ruby_git_crypt/options.rb