work_md 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/work_md/config.rb +9 -4
- data/lib/work_md/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f60288ea3fcd8489f2954550b208575e6b1a1fcb1b34aaeca43e9a4c0132a55
|
4
|
+
data.tar.gz: 220ac9954f8cf8c654023f5f2a0cb24d82942f103f06b7045aca90c6684657a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de934d77253bad8c9569d1461f6eef015a56ec2b317fdc7547952271f1a7780e2d4e59fd95705454f4f40f49ddfa67eb75593206142bd9ba76a625faf170dae7
|
7
|
+
data.tar.gz: 1c24f71868455beee3c8cf80300cff9a768d3745aee2ae33545ce750ca6e5ccd9d05f8c4ef7303611ed72cca652178d5a356ba34274e45f367d23335e6330dd9
|
data/lib/work_md/config.rb
CHANGED
@@ -5,7 +5,6 @@ require 'yaml'
|
|
5
5
|
module WorkMd
|
6
6
|
module Config
|
7
7
|
DEFAULT_WORK_DIR = Dir.home + '/work_md'
|
8
|
-
YAML_FILE = YAML.load_file(DEFAULT_WORK_DIR + '/config.yml')
|
9
8
|
DEFAULT_EDITOR = 'vi'
|
10
9
|
TRANSLATIONS = {
|
11
10
|
'pt' =>
|
@@ -31,11 +30,11 @@ module WorkMd
|
|
31
30
|
}.freeze
|
32
31
|
|
33
32
|
def self.title
|
34
|
-
|
33
|
+
yaml_file['title'] || ''
|
35
34
|
end
|
36
35
|
|
37
36
|
def self.editor
|
38
|
-
ENV['EDITOR'] || ENV['VISUAL'] ||
|
37
|
+
ENV['EDITOR'] || ENV['VISUAL'] || yaml_file['editor'] || DEFAULT_EDITOR
|
39
38
|
end
|
40
39
|
|
41
40
|
def self.work_dir
|
@@ -44,8 +43,14 @@ module WorkMd
|
|
44
43
|
|
45
44
|
def self.translations
|
46
45
|
TRANSLATIONS[ENV['WORK_MD_LANG']] ||
|
47
|
-
TRANSLATIONS[
|
46
|
+
TRANSLATIONS[yaml_file['lang']] ||
|
48
47
|
TRANSLATIONS['en']
|
49
48
|
end
|
49
|
+
|
50
|
+
def self.yaml_file
|
51
|
+
YAML.load_file(DEFAULT_WORK_DIR + '/config.yml')
|
52
|
+
rescue StandardError
|
53
|
+
{}
|
54
|
+
end
|
50
55
|
end
|
51
56
|
end
|
data/lib/work_md/version.rb
CHANGED