sekrets 0.4.2 → 1.0.0

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/README CHANGED
@@ -33,11 +33,17 @@ DESCRIPTION
33
33
 
34
34
  # put the decryption key in a file
35
35
 
36
- echo 42 > sekrets.key
36
+ echo 42 > .sekrets.key
37
37
 
38
38
  # ignore this file in git
39
39
 
40
- echo sekrets.key >> .gitgnore
40
+ echo .sekrets.key >> .gitgnore
41
+
42
+ # you now no longer need to provide the --key argument to commands
43
+
44
+ sekrets read config/settings.yml.enc
45
+
46
+ sekrets edit config/settings.yml.enc
41
47
 
42
48
  # make sure this file gets deployed on your server
43
49
 
@@ -75,11 +81,7 @@ DESCRIPTION
75
81
  - otherwise the code looks for a companion key file. for example, given the
76
82
  file 'config/sekrets.yml.enc' sekrets will look for a key at
77
83
 
78
- config/sekrets.yml.enc.key
79
-
80
- and
81
-
82
- config/sekrets.yml.enc.k
84
+ config/.sekrets.yml.enc.key
83
85
 
84
86
  if either of these is found to be non-empty the contents of the file will
85
87
  be used as the decryption key for that file. you should *never* commit
@@ -87,11 +89,11 @@ DESCRIPTION
87
89
 
88
90
  - next a project key file is looked for. the path of this file is
89
91
 
90
- ./sekrets.key
92
+ ./.sekrets.key
91
93
 
92
94
  normally and, in a rails' application
93
95
 
94
- RAILS_ROOT/sekrets.key
96
+ RAILS_ROOT/.sekrets.key
95
97
 
96
98
  - if that is not found sekrets looks for the key in the environment under
97
99
  the env var
@@ -1,19 +1,17 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
2
  namespace :sekrets do
3
3
  task :upload_key do
4
- require 'fileutils'
5
-
6
4
  rails_root = File.expand_path(File.dirname(__FILE__))
7
5
 
8
- src = File.join(rails_root, 'sekrets.key')
9
- dst = File.join(deploy_to, 'sekrets.key')
6
+ src = File.join(rails_root, '.sekrets.key')
7
+ dst = File.join(deploy_to, 'current', '.sekrets.key')
10
8
 
11
9
  if test(?s, src)
12
10
  upload(src, dst, :recursive => true)
13
11
  end
14
12
  end
15
13
  end
16
-
14
+
17
15
 
18
16
  before "deploy:finalize_update", "sekrets:upload_key"
19
17
  end
data/lib/sekrets.rb CHANGED
@@ -3,7 +3,7 @@ class Sekrets
3
3
  Fattr(:env){ 'SEKRETS_KEY' }
4
4
  Fattr(:editor){ ENV['SEKRETS_EDITOR'] || ENV['EDITOR'] || 'vim' }
5
5
  Fattr(:root){ defined?(Rails.root) ? Rails.root : '.' }
6
- Fattr(:project_key){ File.join(root, 'sekrets.key') }
6
+ Fattr(:project_key){ File.join(root, '.sekrets.key') }
7
7
  Fattr(:global_key){ File.join(File.expand_path('~'), '.sekrets.key') }
8
8
 
9
9
  #
@@ -19,10 +19,12 @@ class Sekrets
19
19
  path = path_for(path)
20
20
 
21
21
  if path
22
+ dirname, basename = File.split(path)
23
+
22
24
  keyfiles =
23
25
  Coerce.list_of_strings(
24
26
  [:keyfile, :keyfiles].map{|k| options[k]},
25
- %W[ #{ path }.key #{ path }.k ]
27
+ %W[ #{ dirname }/.#{ basename }.key #{ dirname }/.#{ basename }.k ]
26
28
  )
27
29
 
28
30
  keyfiles.each do |file|
@@ -284,7 +286,7 @@ BEGIN {
284
286
  require 'tmpdir'
285
287
 
286
288
  class Sekrets < ::String
287
- Version = '0.4.2' unless defined?(Version)
289
+ Version = '1.0.0' unless defined?(Version)
288
290
 
289
291
  class << Sekrets
290
292
  def version
data/sekrets.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "sekrets"
6
- spec.version = "0.4.2"
6
+ spec.version = "1.0.0"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "sekrets"
9
9
  spec.description = "description: sekrets kicks the ass"
data/test/sekrets_test.rb CHANGED
@@ -19,7 +19,7 @@ Testing Sekrets do
19
19
 
20
20
  paths = {
21
21
  'plaintext' => 'plaintext',
22
- 'plaintext.key' => 'file key'
22
+ '.plaintext.key' => 'file key'
23
23
  }
24
24
 
25
25
  options = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sekrets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: