sekrets 1.1.0 → 1.2.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.
@@ -286,7 +286,7 @@ BEGIN {
286
286
  require 'tmpdir'
287
287
 
288
288
  class Sekrets < ::String
289
- Version = '1.1.0' unless defined?(Version)
289
+ Version = '1.2.0' unless defined?(Version)
290
290
 
291
291
  class << Sekrets
292
292
  def version
@@ -1,17 +1,37 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
+ rails_root =
3
+ case
4
+ when defined?(RAILS_ROOT)
5
+ RAILS_ROOT
6
+ when defined?(Rails.root)
7
+ Rails.root
8
+ else
9
+ nil
10
+ end
11
+
12
+ if rails_root.nil?
13
+ Capistrano::Configuration.instance.load_paths.each do |load_path|
14
+ if test(?e, File.join(load_path, 'Capfile'))
15
+ rails_root = File.expand_path(load_path)
16
+ break
17
+ end
18
+ end
19
+ end
20
+
21
+ abort 'could not determine rails_root!' unless rails_root
22
+
2
23
  namespace :sekrets do
3
24
  task :upload_key do
4
- rails_root = File.expand_path(File.dirname(__FILE__))
5
-
25
+
6
26
  src = File.join(rails_root, '.sekrets.key')
7
27
  dst = File.join(deploy_to, 'current', '.sekrets.key')
8
-
28
+
9
29
  if test(?s, src)
10
30
  upload(src, dst, :recursive => true)
11
31
  end
12
32
  end
13
33
  end
14
-
15
-
34
+
35
+
16
36
  after "deploy", "sekrets:upload_key"
17
37
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "sekrets"
6
- spec.version = "1.1.0"
6
+ spec.version = "1.2.0"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "sekrets"
9
9
  spec.description = "description: sekrets kicks the ass"
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: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: