leml 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 835b190cfc6a22374bef64a72a7a1879bd4e9519
4
- data.tar.gz: 3e8e4733d55da087884afd1e8ae32a19c7c9c87e
3
+ metadata.gz: 8066148d2d71caaa92c3c4e79b8b3a1585e7c611
4
+ data.tar.gz: c21b6ea3221e2b5202325e86c74597515a2273a5
5
5
  SHA512:
6
- metadata.gz: fcfc7e52d1413785bd69cf52de65bb0c4051f7fb97e2b616dc6b888dc899ce5afc3f52de72cf0d016398d1029a1a85f9e36f3117595d9d3748a7445f2ecf630d
7
- data.tar.gz: 8cd17e2353b48da0544093932f888cc56ea9a8d886301036861b70be4386521b20acc15717a9a76b5725f58b068922b644353da7308479807a8f435b9d13bb1b
6
+ metadata.gz: 04c21d0fe7ea3c84bf460ac78e82175fc7ce68fb73946b76205508de2eae70355642d1dfdec2be2d3cd96084096d9f2121d79e83d6cc013f0315d4e6780d4762
7
+ data.tar.gz: e624c9a540ac14448bb3eb9b8fe44dc30489d0f896bbdda86a03fdffd750d3f0e6d80e9038a4869df0a1e8dc000b831773b54c504cd8ed1ebac6658460b501b4
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # Leml
2
- Short description and motivation.
3
-
4
- ## Usage
5
- How to use my plugin.
1
+ # Leml(Leaf Enrypted YAML)
2
+ Leml encrypt your secrets only leaf.
3
+ You and member can see only keys without decrypt.
4
+ It depend on rails.
6
5
 
7
6
  ## Installation
8
7
  Add this line to your application's Gemfile:
@@ -21,8 +20,30 @@ Or install it yourself as:
21
20
  $ gem install leml
22
21
  ```
23
22
 
24
- ## Contributing
25
- Contribution directions go here.
23
+ ## Usage
24
+ ```bash
25
+ $ gem install leml
26
+
27
+ # Initialize your secrets
28
+ $ rake leml:init
29
+ Complete!
30
+ create config/leml.key
31
+ create config/leml.yml
32
+
33
+ Caution Don't forget add key file in gitignore
34
+
35
+ # Edit your secrets
36
+ # It use environmental variable `EDITOR`, please set your editor.
37
+ $ EDITOR=vim rake leml:edit
38
+ ## edit your secrets
39
+ OK, your secrets is encrypted.
40
+
41
+ # You can also see secrets
42
+ $ rake leml:show
43
+ ---
44
+ development:
45
+ author: onunu
46
+ ```
26
47
 
27
48
  ## License
28
49
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,4 +1,5 @@
1
1
  require 'rails'
2
+ require 'pry'
2
3
 
3
4
  module Leml
4
5
  class Core
@@ -62,6 +63,7 @@ module Leml
62
63
  end
63
64
 
64
65
  def initialize
66
+ return unless File.exist?(KEY)
65
67
  key = File.read(KEY).chop
66
68
  @encryptor = ActiveSupport::MessageEncryptor.new(key, cipher: 'aes-256-cbc')
67
69
  @secrets = YAML.load_file(SECRETS)
@@ -131,6 +133,7 @@ module Leml
131
133
 
132
134
  def reload_secrets_file(tmp_file)
133
135
  raw_secrets = YAML.load_file(tmp_file)
136
+ return unless raw_secrets
134
137
  File.open(SECRETS, 'w') do |file|
135
138
  file.puts encrypt(raw_secrets).to_yaml
136
139
  end
@@ -1,3 +1,3 @@
1
1
  module Leml
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - onunu