fedux_org-stdlib 0.10.5 → 0.10.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/fedux_org_stdlib/template_directory.rb +4 -4
- data/lib/fedux_org_stdlib/version.rb +1 -1
- data/spec/template_directory_spec.rb +16 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38a7a8abc9d4d7cf4c50f92c9b70e5ea646fcdc6
|
4
|
+
data.tar.gz: 357914ff9e53a7e399355cfd3ea5d5993b8b5c0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac9ea48663fca754aa7abc3df0f488db467bc75510c7febb8644cc43db1349c90f018b4428beb3bd11625acc2a22163569b61d3217c1277cee966551da2b232e
|
7
|
+
data.tar.gz: 98fc091c17ba1e341a7e7451ae774630cff1292f32bc777bb08fa952572e64b5088eb4cbf9588547141734196259ae14a3147b11899f3e1987458f6ede501e08
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fedux_org-stdlib (0.10.
|
4
|
+
fedux_org-stdlib (0.10.5)
|
5
5
|
activesupport
|
6
6
|
|
7
7
|
PATH
|
@@ -79,7 +79,7 @@ GEM
|
|
79
79
|
mime-types (>= 1.16, < 3)
|
80
80
|
method_source (0.8.2)
|
81
81
|
mime-types (2.4.3)
|
82
|
-
minitest (5.4.
|
82
|
+
minitest (5.4.3)
|
83
83
|
multi_json (1.10.1)
|
84
84
|
multi_test (0.1.1)
|
85
85
|
netrc (0.8.0)
|
@@ -154,10 +154,10 @@ module FeduxOrgStdlib
|
|
154
154
|
def allowed_template_directory_paths
|
155
155
|
paths = []
|
156
156
|
|
157
|
-
paths << resolve_path(working_directory,
|
158
|
-
paths << resolve_path('~', '.config', application_name,
|
159
|
-
paths << resolve_path('~', format('.%s', application_name),
|
160
|
-
paths << resolve_path('/etc', application_name,
|
157
|
+
paths << resolve_path(working_directory, template_directory)
|
158
|
+
paths << resolve_path('~', '.config', application_name, template_directory)
|
159
|
+
paths << resolve_path('~', format('.%s', application_name), template_directory)
|
160
|
+
paths << resolve_path('/etc', application_name, template_directory)
|
161
161
|
paths << resolve_path(fallback_template_directory, template_directory) if fallback_template_directory
|
162
162
|
|
163
163
|
paths
|
@@ -6,7 +6,7 @@ RSpec.describe TemplateDirectory do
|
|
6
6
|
|
7
7
|
context '#preferred_template_directory' do
|
8
8
|
it 'has a default template file which is the preferred place to store the template' do
|
9
|
-
touch_file '.config/my_application/
|
9
|
+
touch_file '.config/my_application/tests.d/test.tt'
|
10
10
|
|
11
11
|
template_klass = Class.new(TemplateDirectory) do
|
12
12
|
def class_name
|
@@ -20,12 +20,12 @@ RSpec.describe TemplateDirectory do
|
|
20
20
|
|
21
21
|
with_env 'HOME' => absolute_path('.') do
|
22
22
|
template = template_klass.new
|
23
|
-
expect(template.preferred_template_directory).to eq File.expand_path('~/.config/my_application/
|
23
|
+
expect(template.preferred_template_directory).to eq File.expand_path('~/.config/my_application/tests.d')
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'works with nested module names' do
|
28
|
-
touch_file '.config/my_application/my_sub/
|
28
|
+
touch_file '.config/my_application/my_sub/tests.d/test.tt'
|
29
29
|
|
30
30
|
template_klass = Class.new(TemplateDirectory) do
|
31
31
|
def class_name
|
@@ -39,14 +39,14 @@ RSpec.describe TemplateDirectory do
|
|
39
39
|
|
40
40
|
with_env 'HOME' => absolute_path('.') do
|
41
41
|
template = template_klass.new
|
42
|
-
expect(template.preferred_template_directory).to eq File.expand_path('~/.config/my_application/my_sub/
|
42
|
+
expect(template.preferred_template_directory).to eq File.expand_path('~/.config/my_application/my_sub/tests.d')
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
context 'template files' do
|
48
|
-
it 'looks at ~/.config/my_application/
|
49
|
-
write_file '.config/my_application/
|
48
|
+
it 'looks at ~/.config/my_application/tests.d/test.tt' do
|
49
|
+
write_file '.config/my_application/tests.d/test.tt', <<-EOS.strip_heredoc
|
50
50
|
<%= hello world %>
|
51
51
|
EOS
|
52
52
|
|
@@ -62,12 +62,12 @@ RSpec.describe TemplateDirectory do
|
|
62
62
|
|
63
63
|
with_env 'HOME' => absolute_path('.') do
|
64
64
|
template = template_klass.new
|
65
|
-
expect(template.template_files).to include absolute_path('.config/my_application/
|
65
|
+
expect(template.template_files).to include absolute_path('.config/my_application/tests.d/test.tt')
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
it 'looks at ~/.my_application/
|
70
|
-
write_file '.my_application/
|
69
|
+
it 'looks at ~/.my_application/tests.d/test.tt' do
|
70
|
+
write_file '.my_application/tests.d/test.tt', <<-EOS.strip_heredoc
|
71
71
|
<%= hello world %>
|
72
72
|
EOS
|
73
73
|
|
@@ -83,12 +83,12 @@ RSpec.describe TemplateDirectory do
|
|
83
83
|
|
84
84
|
with_env 'HOME' => absolute_path('.') do
|
85
85
|
template = template_klass.new
|
86
|
-
expect(template.template_files).to include absolute_path('.my_application/
|
86
|
+
expect(template.template_files).to include absolute_path('.my_application/tests.d/test.tt')
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'returns templates in subdirectories as well' do
|
91
|
-
write_file '.my_application/
|
91
|
+
write_file '.my_application/tests.d/blub/test.tt', <<-EOS.strip_heredoc
|
92
92
|
<%= hello world %>
|
93
93
|
EOS
|
94
94
|
|
@@ -104,18 +104,18 @@ RSpec.describe TemplateDirectory do
|
|
104
104
|
|
105
105
|
with_env 'HOME' => absolute_path('.') do
|
106
106
|
template = template_klass.new
|
107
|
-
expect(template.template_files).to include absolute_path('.my_application/
|
107
|
+
expect(template.template_files).to include absolute_path('.my_application/tests.d/blub/test.tt')
|
108
108
|
end
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
112
|
context '#template_files' do
|
113
113
|
it 'returns template_files in template directory' do
|
114
|
-
write_file '.my_application/
|
114
|
+
write_file '.my_application/tests.d/test1.tt', <<-EOS.strip_heredoc
|
115
115
|
<%= hello world %>
|
116
116
|
EOS
|
117
117
|
|
118
|
-
write_file '.my_application/
|
118
|
+
write_file '.my_application/tests.d/test2.tt', <<-EOS.strip_heredoc
|
119
119
|
<%= hello world %>
|
120
120
|
EOS
|
121
121
|
|
@@ -131,8 +131,8 @@ RSpec.describe TemplateDirectory do
|
|
131
131
|
|
132
132
|
with_env 'HOME' => absolute_path('.') do
|
133
133
|
template = template_klass.new
|
134
|
-
expect(template.template_files).to include absolute_path('.my_application/
|
135
|
-
expect(template.template_files).to include absolute_path('.my_application/
|
134
|
+
expect(template.template_files).to include absolute_path('.my_application/tests.d/test1.tt')
|
135
|
+
expect(template.template_files).to include absolute_path('.my_application/tests.d/test2.tt')
|
136
136
|
end
|
137
137
|
end
|
138
138
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fedux_org-stdlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Meyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|