evertils 0.3.1.1 → 0.3.1.2

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
  SHA1:
3
- metadata.gz: 05122815f6b5d6da37cead7cb46c3a5e1fbd9cf6
4
- data.tar.gz: 42fcdf313a91bae68c3798e64c685e60b53560a3
3
+ metadata.gz: 9bfbec7f3599e451794675eba97e020e1a2c478a
4
+ data.tar.gz: 79c2d40edeeb68ff45eb1053aed8a518f39be78b
5
5
  SHA512:
6
- metadata.gz: fc7fb2cea73e2f8d5796ac73d920f49637a347ba616f4693b2cd65a456ab2715e21ef87881fb0904dd3dafe95ae846d6ec3ce14cc64492dfe6e4aedb058a2886
7
- data.tar.gz: 98e07f683a6400fe0179a7a38c06613f1e361103248fa3a2c36b185dc6b80641afba379ba08f7ae6f91c758c19fbe979fe27e96c636503ac4e8791aca65fa198
6
+ metadata.gz: 62553e2671eb2a96110ee10e706392a7a48ea825853e07daa33a93d926025b898bbb87948a137e73d86bf802e4b727e55fcf2bcbf67414cdf557447776039485
7
+ data.tar.gz: 46d7dcc874f6ad43aa4141f7ea34116aa313638774a11e0da2743351b6b156435304bebc643a467ffc6d3124e09f7c15553e2e470b4294651b3e02afece7caa8
data/lib/config.rb CHANGED
@@ -11,7 +11,7 @@ module Evertils
11
11
  DEBUG = false
12
12
 
13
13
  class Cfg
14
- attr_accessor :custom_sections, :custom_templates
14
+ attr_accessor :custom_sections, :custom_templates, :custom_path
15
15
 
16
16
  def bootstrap!
17
17
  begin
@@ -45,8 +45,10 @@ module Evertils
45
45
  #
46
46
  # @since 0.3.1
47
47
  def load_user_customizations
48
- conf = recursive_symbolize_keys(YAML::load_file(Dir.home + '/.evertils/config.yml'))
48
+ conf_path = Dir.home + '/.evertils/'
49
+ conf = recursive_symbolize_keys(YAML::load_file(conf_path + 'config.yml'))
49
50
 
51
+ @custom_path = conf_path
50
52
  @custom_sections = conf[:sections] if conf[:sections]
51
53
  @custom_templates = conf[:templates] if conf[:templates]
52
54
  end
@@ -51,7 +51,7 @@ module Evertils
51
51
 
52
52
  if !@force
53
53
  if !Date.today.monday?
54
- Notify.error("Sorry, you can only create new weekly logs on Mondays")
54
+ Notify.error("Sorry, you can only create new weekly logs on Mondays", {})
55
55
  end
56
56
  end
57
57
 
@@ -78,7 +78,7 @@ module Evertils
78
78
 
79
79
  # generate monthly task summary templates
80
80
  def mts
81
- Notify.error("Name argument is required") if @name.nil?
81
+ Notify.error("Name argument is required", {}) if @name.nil?
82
82
 
83
83
  title = "#{@name} #{DateTime.now.strftime('%m-%Y')}"
84
84
  body = @format.template_contents
@@ -71,13 +71,20 @@ module Evertils
71
71
  def local_template_override?(default)
72
72
  return default if $config.custom_templates.nil?
73
73
 
74
+ rval = default
74
75
  tmpl = $config.custom_templates[command]
75
76
 
76
- if tmpl.nil?
77
- default
78
- else
79
- tmpl.gsub!(/~/, Dir.home) if tmpl.include?('~')
77
+ if !tmpl.nil?
78
+ rval = $config.custom_path
79
+
80
+ if tmpl.include?('~')
81
+ rval += tmpl.gsub!(/~/, Dir.home)
82
+ else
83
+ rval += tmpl
84
+ end
80
85
  end
86
+
87
+ rval
81
88
  end
82
89
 
83
90
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Evertils
2
- VERSION = '0.3.1.1'
2
+ VERSION = '0.3.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evertils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.1
4
+ version: 0.3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Priebe