mayaml-mutt 1.0.0 → 1.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/bin/mayaml-mutt-creds +6 -0
- data/lib/mayaml-mutt/account_creds.mustache +1 -0
- data/lib/mayaml-mutt/account_creds.rb +1 -0
- data/lib/mayaml-mutt/configs_generator.rb +1 -0
- data/lib/mayaml-mutt/version.rb +1 -1
- data/lib/mayaml-mutt.rb +4 -2
- metadata +19 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91df2c92def7a4be5fc092156e5eebb226f099a0
|
4
|
+
data.tar.gz: 7ea207e80ebc993d753d9e20b05ac187401aed4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b02b1f541ec28683616dfe940316c641c6ffbe23a8c096eb0c81c556cd87a268a0f5ea1514820b508c5a50e7083e91309e31a9006268142709affb17bc1de683
|
7
|
+
data.tar.gz: 9e9d8f6706041fcc55dbbe5a30ec52c318048ab2762a9d64d7be425dbbb63c5e72abee05b3b8211eb7701614ee591ac5f530c91d608e235e88026d893ea0fd90
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# MAYaml for Mutt
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/mayaml-mutt)
|
4
|
+
[](https://codeclimate.com/github/skopciewski/mayaml-mutt)
|
4
5
|
|
5
6
|
This is the mutt configs generator which gets the accounts settigns from yaml file. See [Mayaml][mayaml_url]
|
6
7
|
The mutt configuration is designed to handle many accounts and one inbox. (example implementation: [DockerMutt][docker_mutt_url])
|
data/bin/mayaml-mutt-creds
CHANGED
@@ -27,6 +27,8 @@ def puts_ussage_message
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def present_configs(configs)
|
30
|
+
default_acc = configs.delete(:default)
|
31
|
+
puts "### Default account: #{default_acc}"
|
30
32
|
configs.each do |name, config|
|
31
33
|
puts "### Name: #{name} " + "=" * 50
|
32
34
|
puts config
|
@@ -36,10 +38,14 @@ end
|
|
36
38
|
|
37
39
|
def store_configs(configs, destination_dir)
|
38
40
|
FileUtils.mkdir_p destination_dir
|
41
|
+
default_acc = configs.delete(:default)
|
39
42
|
configs.each do |name, config|
|
40
43
|
file_path = File.join destination_dir, name.to_s
|
41
44
|
File.open(file_path, "w") { |f| f.write(config) }
|
42
45
|
end
|
46
|
+
FileUtils.ln_s(
|
47
|
+
File.join(destination_dir, default_acc), File.join(destination_dir, "current_acc")
|
48
|
+
)
|
43
49
|
end
|
44
50
|
|
45
51
|
def check_yaml_path(yaml_path)
|
@@ -40,6 +40,7 @@ module MayamlMutt
|
|
40
40
|
accounts.each_with_object({}) do |mail_account, result|
|
41
41
|
key = mail_account.name.to_sym
|
42
42
|
result[key] = @creds_templater.render(mail_account)
|
43
|
+
result[:default] = mail_account.name if mail_account.default || !result.key?(:default)
|
43
44
|
result
|
44
45
|
end
|
45
46
|
end
|
data/lib/mayaml-mutt/version.rb
CHANGED
data/lib/mayaml-mutt.rb
CHANGED
@@ -27,13 +27,15 @@ require "mayaml-mutt/accounts_alternates"
|
|
27
27
|
module MayamlMutt
|
28
28
|
def self.accounts_init_from_file(yaml_accounts)
|
29
29
|
accounts = ::Mayaml.accounts_from_file(yaml_accounts)
|
30
|
-
generator = ConfigsGenerator.new(AccountInit.new, AccountsAlternates.new, AccountCreds.new)
|
31
30
|
generator.generates_init(accounts)
|
32
31
|
end
|
33
32
|
|
34
33
|
def self.accounts_creds_from_file(yaml_accounts)
|
35
34
|
accounts = ::Mayaml.accounts_from_file(yaml_accounts)
|
36
|
-
generator = ConfigsGenerator.new(AccountInit.new, AccountsAlternates.new, AccountCreds.new)
|
37
35
|
generator.generates_creds(accounts)
|
38
36
|
end
|
37
|
+
|
38
|
+
def self.generator
|
39
|
+
ConfigsGenerator.new(AccountInit.new, AccountsAlternates.new, AccountCreds.new)
|
40
|
+
end
|
39
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mayaml-mutt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Szymon Kopciewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mayaml
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mustache
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: codeclimate-test-reporter
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Generates mutt configuration from mayaml parser
|
98
112
|
email:
|
99
113
|
- s.kopciewski@gmail.com
|
@@ -138,9 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
152
|
version: '0'
|
139
153
|
requirements: []
|
140
154
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.4.8
|
142
156
|
signing_key:
|
143
157
|
specification_version: 4
|
144
158
|
summary: Generates mutt configuration from mayaml parser
|
145
159
|
test_files: []
|
146
|
-
has_rdoc:
|