handsome_fencer-circle_c_i 0.1.11 → 0.1.12

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: 2c39e092e02889002eecd453021ea081461ce3485419980123e214afa3ba1d95
4
- data.tar.gz: 45c1c0eba7545924fa0eb237816607ee65608858b15431ea6553e09d9e8a3d0b
3
+ metadata.gz: 3a4536073e8d98a4adaadb671df91de15ac1645d95fffd44aec476df402e28b3
4
+ data.tar.gz: 88c97270624ff3d7de942b59143b6dc69d95b45852eddf596fcbcced353a24e1
5
5
  SHA512:
6
- metadata.gz: 0d4108d73001085e58d0a6a59a762ac762b2950c5bb7d8b1fd0bc1fa6e07463ba01e9660b0faf348d4da7c880e82b659caab4a314cf5c55829ff6a1ce90403a0
7
- data.tar.gz: 7d13310aa34fbf29899c4e287cb8636fd0efa232c796f3dfad36772fbdc23b49ec8512f3fc1817958e00217ea6c5f4306189a762e3e653d0d7fc3780face8f4b
6
+ metadata.gz: cae21dd0094dbf203f92e32384a6a1d2c959ed37a869fad3125227a9a4e59b05f85feb2105e0e67da5bee31020cd07e0e17848ce36cc8832159a8261e15d3aa3
7
+ data.tar.gz: 9f9ec021ccb1c2bf59e2235c8296bf866382ec61373b85b45d121300dfea294da1080135445d148906a22f67352fd555554e42194855f88e79a807a9d49521a3
@@ -1,5 +1,6 @@
1
1
  require 'openssl'
2
2
  require 'base64'
3
+ require 'byebug'
3
4
 
4
5
  module HandsomeFencer
5
6
  module CircleCI
@@ -10,7 +11,7 @@ module HandsomeFencer
10
11
  def initialize(options={})
11
12
  @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
12
13
  @salt = '8 octets'
13
- @dkfile = options[:dkfile] ? options[:dkfile] : dkfile
14
+ @dkfile = options[:dkfile] ? ('.circleci/' + options[:dkfile] + '.key') : dkfile
14
15
  @pass_phrase = get_deploy_key
15
16
  end
16
17
 
@@ -49,15 +50,14 @@ module HandsomeFencer
49
50
  end
50
51
 
51
52
  def encrypt(file)
52
- file = Rails.root.join(file).to_s
53
+ file = file
53
54
  @cipher.encrypt.pkcs5_keyivgen @pass_phrase, @salt
54
55
  encrypted = @cipher.update(File.read file) + @cipher.final
55
56
  write_to_file(Base64.encode64(encrypted), file + '.enc')
56
57
  end
57
58
 
58
59
  def decrypt(file)
59
-
60
- encrypted = Base64.decode64 File.read(Rails.root(file.to_s))
60
+ encrypted = Base64.decode64 File.read(file)
61
61
  @cipher.decrypt.pkcs5_keyivgen @pass_phrase, @salt
62
62
  decrypted = @cipher.update(encrypted) + @cipher.final
63
63
  decrypted_file = file.split('.enc').first
@@ -83,7 +83,7 @@ module HandsomeFencer
83
83
  private
84
84
 
85
85
  def dkfile
86
- Rails.root.join(".circleci/deploy.key")
86
+ ".circleci/deploy.key"
87
87
  end
88
88
 
89
89
  def write_to_file(data, filename)
@@ -1,5 +1,5 @@
1
1
  module HandsomeFencer
2
2
  module CircleCI
3
- VERSION = '0.1.11'
3
+ VERSION = '0.1.12'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handsome_fencer-circle_c_i
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - schadenfred
@@ -113,7 +113,7 @@ files:
113
113
  - lib/handsome_fencer/circle_c_i/railtie.rb
114
114
  - lib/handsome_fencer/circle_c_i/version.rb
115
115
  - lib/tasks/handsome_fencer/circle_c_i_tasks.rake
116
- homepage: https://github.com/schadenfred/handsomefencer-environment
116
+ homepage: https://github.com/schadenfred/handsome_fencer-circle_c_i
117
117
  licenses:
118
118
  - MIT
119
119
  metadata: {}