fedux_org-stdlib 0.6.43 → 0.6.44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fedux_org_stdlib/file_template.rb +2 -7
- data/lib/fedux_org_stdlib/version.rb +1 -1
- data/spec/template_file_spec.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ab9eab77447837bb0124400b28bd0a9f62d1bda
|
4
|
+
data.tar.gz: f853c8bc629d5468badaf9414036b7b30bbcd513
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d1370737ae977ff394cb50521d8f3d63da9216cc669cdc36796c67dc28813fedb9dd8dabca9481a0bcff0d3c90d54ab9122c1a67094732dd8cd798c793bba32
|
7
|
+
data.tar.gz: 4dea91fa7b5937e1a17f7529bd31dde86eed1c526237baa9673b6f8ff9637b516af8cd9c886cda22b320dd27485a5fd0c279409ee2457018adf442d625186365
|
data/Gemfile.lock
CHANGED
@@ -79,13 +79,8 @@ module FeduxOrgStdlib
|
|
79
79
|
@working_directory = working_directory
|
80
80
|
|
81
81
|
@file ||= available_template_file
|
82
|
-
|
83
|
-
unless @file
|
84
|
-
logger.debug "No template file found at #{allowed_template_file_paths.to_list}, therefor I'm going to use an empty template object instead."
|
85
|
-
@content = ''
|
86
|
-
|
87
|
-
return
|
88
|
-
end
|
82
|
+
|
83
|
+
fail Exceptions::NoTemplateFileFound, "No template file found at #{allowed_template_file_paths.to_list}, therefor I'm stop working as there are methods which depend on an available template file path." unless @file
|
89
84
|
|
90
85
|
begin
|
91
86
|
@content = File.read(@file).chomp
|
data/spec/template_file_spec.rb
CHANGED
@@ -7,6 +7,8 @@ RSpec.describe FileTemplate do
|
|
7
7
|
context '#proposed_file' do
|
8
8
|
it 'generates a propose file path based on template basename' do
|
9
9
|
with_environment 'HOME' => working_directory do
|
10
|
+
create_file '.config/my_application/templates/test.tt'
|
11
|
+
|
10
12
|
template_klass = Class.new(FileTemplate) do
|
11
13
|
def class_name
|
12
14
|
'TestTemplate'
|
@@ -26,6 +28,8 @@ RSpec.describe FileTemplate do
|
|
26
28
|
context '#preferred_template_file' do
|
27
29
|
it 'has a default template file which is the preferred place to store the template' do
|
28
30
|
with_environment 'HOME' => working_directory do
|
31
|
+
create_file '.config/my_application/templates/test.tt'
|
32
|
+
|
29
33
|
template_klass = Class.new(FileTemplate) do
|
30
34
|
def class_name
|
31
35
|
'TestTemplate'
|
@@ -43,8 +47,9 @@ RSpec.describe FileTemplate do
|
|
43
47
|
|
44
48
|
it 'works with nested module names' do
|
45
49
|
with_environment 'HOME' => working_directory do
|
46
|
-
|
50
|
+
create_file '.config/my_application/my_sub/templates/test.tt'
|
47
51
|
|
52
|
+
template_klass = Class.new(FileTemplate) do
|
48
53
|
def class_name
|
49
54
|
'TestTemplate'
|
50
55
|
end
|