File tree 2 files changed +24
-19
lines changed
2 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 1
1
GEM
2
2
remote: https://rubygems.org/
3
3
specs:
4
- activesupport (4.1.6 )
4
+ activesupport (4.1.7 )
5
5
i18n (~> 0.6 , >= 0.6.9 )
6
6
json (~> 1.7 , >= 1.7.7 )
7
7
minitest (~> 5.1 )
8
8
thread_safe (~> 0.1 )
9
9
tzinfo (~> 1.1 )
10
- bootstrap-sass (3.2 .0.2 )
10
+ bootstrap-sass (3.3 .0.1 )
11
11
sass (~> 3.2 )
12
12
celluloid (0.16.0 )
13
13
timers (~> 4.0.0 )
29
29
eventmachine (1.0.3 )
30
30
ffi (1.9.6 )
31
31
files (0.3.1 )
32
- font-awesome-sass (4.2.1 )
32
+ font-awesome-sass (4.2.2 )
33
33
sass (~> 3.2 )
34
34
hike (1.2.3 )
35
35
hitimes (1.2.2 )
41
41
celluloid (>= 0.15.2 )
42
42
rb-fsevent (>= 0.9.3 )
43
43
rb-inotify (>= 0.9 )
44
- mini_portile (0.6.0 )
44
+ mini_portile (0.6.1 )
45
45
minitest (5.4.2 )
46
46
multi_json (1.10.1 )
47
- nokogiri (1.6.3 .1 )
48
- mini_portile (= 0.6.0 )
47
+ nokogiri (1.6.4 .1 )
48
+ mini_portile (~> 0.6.0 )
49
49
polyglot (0.3.5 )
50
50
predicated (0.2.6 )
51
51
rack (1.5.2 )
80
80
sexp_processor (~> 4.0 )
81
81
ruby_parser (3.6.3 )
82
82
sexp_processor (~> 4.1 )
83
- sass (3.4.6 )
83
+ sass (3.4.7 )
84
84
sexp_processor (4.4.4 )
85
85
sinatra (1.4.5 )
86
86
rack (~> 1.4 )
87
87
rack-protection (~> 1.4 )
88
88
tilt (~> 1.3 , >= 1.3.4 )
89
- sprockets (2.12.2 )
89
+ sprockets (2.12.3 )
90
90
hike (~> 1.2 )
91
91
multi_json (~> 1.0 )
92
92
rack (~> 1.0 )
Original file line number Diff line number Diff line change @@ -44,18 +44,23 @@ def insert file
44
44
45
45
# todo: other file types
46
46
47
- if File . exist? ( path = File . join ( dir , "_#{ file } .step" ) )
48
- src = File . read ( path )
49
- step = Step . new ( src : src , doc_path : path , container_page_name : page_name , step_stack : @step_stack )
50
- widget step
51
- elsif File . exist? ( path = File . join ( dir , "#{ file } .step" ) )
52
- src = File . read ( path )
53
- step = Step . new ( src : src , doc_path : path , container_page_name : page_name , step_stack : @step_stack )
54
- widget step
55
- elsif File . exist? ( path = File . join ( dir , "#{ file } .md" ) )
56
- src = File . read ( path )
57
- message src
47
+ possible_paths = [ "_#{ file } .step" , "#{ file } .step" , "#{ file } .md" ] . map do |path |
48
+ File . join ( dir , path )
58
49
end
50
+
51
+ possible_paths . each do |path |
52
+ if File . exist? ( path )
53
+ src = File . read ( path )
54
+ if path . end_with? ( '.step' )
55
+ step = Step . new ( src : src , doc_path : path , container_page_name : page_name , step_stack : @step_stack )
56
+ return widget step
57
+ else
58
+ return message src
59
+ end
60
+ end
61
+ end
62
+
63
+ raise "Couldn't find a partial for #{ file } !"
59
64
end
60
65
61
66
## steps
You can’t perform that action at this time.
0 commit comments