File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def initialize(opts = {})
2525 # class name
2626 raise 'Name can not be empty!' if opts [ :name ] . empty?
2727 raise 'Name can not start with an underscore!' if opts [ :name ] . start_with? ( '_' )
28+
2829 @name = opts [ :name ] . to_camel
2930
3031 # [String] filename base without extension
@@ -95,7 +96,7 @@ class FileSystemHelper
9596 # @param text [String] text to be written to file
9697 #
9798 # @return [true, false] true if written
98- def write ( path , text )
99+ def write? ( path , text )
99100 return false unless ok_to_overwrite? path
100101
101102 File . write ( path , text )
@@ -133,7 +134,7 @@ def write_cpp_header
133134
134135 # create file
135136 path = "#{ dir } /#{ @controller . header_filename } "
136- return unless @fs . write ( path , gen_cpp_header )
137+ return unless @fs . write? ( path , gen_cpp_header )
137138
138139 @cmake . add_file ( path )
139140 end
@@ -144,7 +145,7 @@ def write_cpp_source
144145
145146 # create file
146147 path = "#{ dir } /#{ @controller . source_filename } "
147- return unless @fs . write ( path , gen_cpp_source )
148+ return unless @fs . write? ( path , gen_cpp_source )
148149
149150 @cmake . add_file ( path )
150151 end
You can’t perform that action at this time.
0 commit comments