lib/lanes/command/generate_view.rb in lanes-0.1.8 vs lib/lanes/command/generate_view.rb in lanes-0.1.9
- old
+ new
@@ -7,28 +7,29 @@
OPTIONS ||= {
namespace: nil,
screen: 'global'
}
class_options( OPTIONS )
+ attr_reader :view_class
def set_variables
super
if options[:screen] == 'global'
@client_dir << "/views"
@spec_dir << "/views"
+ @view_class = "#{namespace}.Views.#{class_name}"
else
- @client_dir << "/screens/#{options[:screen].underscore.dasherize}"
- @spec_dir << "/screens/#{options[:screen].underscore.dasherize}"
+ screen_directory = options[:screen].underscore.dasherize
+ @client_dir << "/screens/#{screen_directory}"
+ @spec_dir << "/screens/#{screen_directory}"
+ @view_class = "#{namespace}.Screens.#{options[:screen]}.#{class_name}"
end
end
- # desc "foo bar"
- # option :from, :required => true
-
def create_screen
template "client/views/View.coffee", "#{client_dir}/#{class_name}.coffee"
template "spec/client/views/ViewSpec.coffee", \
- "#{spec_dir}/#{class_name}Spec.coffee"
+ "#{spec_dir}/#{class_name}Spec.coffee"
end
end