lib/lanes/command/generate_view.rb in lanes-0.1.2 vs lib/lanes/command/generate_view.rb in lanes-0.1.5

- old
+ new

@@ -8,27 +8,30 @@ namespace: nil, screen: 'global' } class_options( OPTIONS ) + def set_variables + super + if options[:screen] == 'global' + @client_dir << "/views" + @spec_dir << "/views" + else + @client_dir << "/screens/#{options[:screen].underscore.dasherize}" + @spec_dir << "/screens/#{options[:screen].underscore.dasherize}" + end + end + # desc "foo bar" # option :from, :required => true def create_screen template "client/views/View.coffee", "#{client_dir}/#{name.classify}.coffee" template "spec/client/views/ViewSpec.coffee", \ - "#{spec_dir}/views/#{class_name}Spec.coffee" + "#{spec_dir}/#{class_name}Spec.coffee" end - private - def client_dir - if options[:screen] == 'global' - "client/#{namespace}/views" - else - "client/#{namespace}/screens/#{options[:screen].dasherize}" - end - end end end end