22
33BASIC = <<-CODE
44def setup
5- sketch_title '%s'
5+ sketch_title '%s'
66end
77
88def draw
99
1010end
1111
1212def settings
13- size %s, %s
14- # pixel_density(2) # here for hi-dpi displays only
15- # smooth # here
13+ size %s, %s
14+ # pixel_density(2) # here for hi-dpi displays only
15+ # smooth # here
1616end
1717
1818CODE
1919
2020BASIC_MODE = <<-CODE
2121def setup
22- sketch_title '%s'
22+ sketch_title '%s'
2323end
2424
2525def draw
2626
2727end
2828
2929def settings
30- size %s, %s, %s
31- # smooth # here
30+ size %s, %s, %s
31+ # smooth # here
3232end
3333
3434CODE
@@ -37,19 +37,19 @@ def settings
3737# encoding: utf-8
3838# frozen_string_literal: false
3939class %s < Processing::App
40- def setup
41- sketch_title '%s'
42- end
40+ def setup
41+ sketch_title '%s'
42+ end
4343
44- def draw
44+ def draw
4545
46- end
46+ end
4747
48- def settings
49- size %s, %s
50- # pixel_density(2) # here for hi-dpi displays only
51- # smooth # here
52- end
48+ def settings
49+ size %s, %s
50+ # pixel_density(2) # here for hi-dpi displays only
51+ # smooth # here
52+ end
5353end
5454CODE
5555
@@ -59,21 +59,21 @@ def settings
5959require 'jruby_art'
6060require 'jruby_art/app'
6161
62- Processing::App::SKETCH_PATH = __FILE__
62+ Processing::App::SKETCH_PATH = __FILE__.freeze
6363
6464class %s < Processing::App
65- def setup
66- sketch_title '%s'
67- end
65+ def setup
66+ sketch_title '%s'
67+ end
6868
69- def draw
69+ def draw
7070
71- end
71+ end
7272
73- def settings
74- size %s, %s
75- # smooth # here
76- end
73+ def settings
74+ size %s, %s
75+ # smooth # here
76+ end
7777end
7878
7979%s.new unless defined? $app
@@ -83,18 +83,18 @@ def settings
8383# encoding: utf-8
8484# frozen_string_literal: false
8585class %s < Processing::App
86- def setup
87- sketch_title '%s'
88- end
86+ def setup
87+ sketch_title '%s'
88+ end
8989
90- def draw
90+ def draw
9191
92- end
92+ end
9393
94- def settings
95- size %s, %s, %s
96- # smooth # here
97- end
94+ def settings
95+ size %s, %s, %s
96+ # smooth # here
97+ end
9898end
9999CODE
100100
@@ -104,21 +104,21 @@ def settings
104104require 'jruby_art'
105105require 'jruby_art/app'
106106
107- Processing::App::SKETCH_PATH = __FILE__
107+ Processing::App::SKETCH_PATH = __FILE__.freeze
108108
109109class %s < Processing::App
110- def setup
111- sketch_title '%s'
112- end
110+ def setup
111+ sketch_title '%s'
112+ end
113113
114- def draw
114+ def draw
115115
116- end
116+ end
117117
118- def settings
119- size %s, %s, %s
120- # smooth # here
121- end
118+ def settings
119+ size %s, %s, %s
120+ # smooth # here
121+ end
122122end
123123
124124%s.new unless defined? $app
@@ -128,21 +128,20 @@ def settings
128128# encoding: utf-8
129129# frozen_string_literal: false
130130class %s
131- include Processing::Proxy
131+ include Processing::Proxy
132132
133133end
134134CODE
135135
136136# creator wrapper module using StringExtra
137137module Creator
138138 require_relative '../helpers/string_extra'
139- using StringExtra
140139 # Write file to disk
141140 class SketchWriter
142141 attr_reader :file
143142
144143 def initialize ( path )
145- underscore = path . underscore
144+ underscore = StringExtra . new ( path ) . underscore
146145 @file = "#{ File . dirname ( path ) } /#{ underscore } .rb"
147146 end
148147
@@ -157,7 +156,7 @@ def save(template)
157156 class Base
158157 ALL_DIGITS = /\A \d +\Z /
159158 def already_exist ( path )
160- underscore = path . underscore
159+ underscore = StringExtra . new ( path ) . underscore
161160 new_file = "#{ File . dirname ( path ) } /#{ underscore } .rb"
162161 return if !FileTest . exist? ( path ) && !FileTest . exist? ( new_file )
163162 puts 'That file already exists!'
@@ -197,7 +196,7 @@ def create!(path, args)
197196 already_exist ( path )
198197 main_file = File . basename ( path , '.rb' ) # allow uneeded extension input
199198 writer = SketchWriter . new ( main_file )
200- @title = main_file . titleize
199+ @title = StringExtra . new ( main_file ) . titleize
201200 @width = args [ 0 ]
202201 @height = args [ 1 ]
203202 @mode = args [ 2 ] . upcase unless args [ 2 ] . nil?
@@ -222,9 +221,9 @@ def create!(path, args)
222221 main_file = File . basename ( path , '.rb' ) # allow uneeded extension input
223222 # Check to make sure that the main file doesn't exist already
224223 already_exist ( path )
225- @name = main_file . camelize
224+ @name = StringExtra . new ( main_file ) . camelize
226225 writer = SketchWriter . new ( main_file )
227- @title = main_file . titleize
226+ @title = StringExtra . new ( main_file ) . titleize
228227 @width , @height = args [ 0 ] , args [ 1 ]
229228 @mode = args [ 2 ] . upcase unless args [ 2 ] . nil?
230229 template = @mode . nil? ? class_template : class_template_mode
@@ -247,9 +246,9 @@ def create!(path, args)
247246 main_file = File . basename ( path , '.rb' ) # allow uneeded extension input
248247 # Check to make sure that the main file doesn't exist already
249248 already_exist ( path )
250- @name = main_file . camelize
249+ @name = StringExtra . new ( main_file ) . camelize
251250 writer = SketchWriter . new ( main_file )
252- @title = main_file . titleize
251+ @title = StringExtra . new ( main_file ) . titleize
253252 @width , @height = args [ 0 ] , args [ 1 ]
254253 @mode = args [ 2 ] . upcase unless args [ 2 ] . nil?
255254 template = @mode . nil? ? emacs_template : emacs_template_mode
0 commit comments