Ejemplo n.º 1
0
 def _find_helper_files(self):
     l = finder_utils.glob_project(self.root_path, self.HELPER_GLOB_PATTERN)
     return [
         x for x in l
         if self.pluralized_name in finder_utils.remove_base_directory(
             x, self.root_path, 'app/helpers/')
     ]
Ejemplo n.º 2
0
 def _find_model_files(self):
     l = finder_utils.glob_project(self.root_path, self.MODEL_GLOB_PATTERN)
     return [
         x for x in l
         if self.singularized_name in finder_utils.remove_base_directory(
             x, self.root_path, 'app/models/')
     ]
Ejemplo n.º 3
0
 def _find_controller_spec_files(self):
     l = finder_utils.glob_project(self.root_path,
                                   self.CONTROLLER_SPEC_GLOB_PATTERN)
     return [
         x for x in l
         if self.pluralized_name in finder_utils.remove_base_directory(
             x, self.root_path, 'spec/controllers/')
         or self.singularized_name in finder_utils.remove_base_directory(
             x, self.root_path, 'spec/controllers/')
     ]
Ejemplo n.º 4
0
 def find_files(self):
     files = finder_utils.glob_project(self.root_path, self.GLOB_PATTERN)
     return [CommandFile(filename) for filename in files]
Ejemplo n.º 5
0
 def _find_view_files(self):
     l = finder_utils.glob_project(self.root_path, self.VIEW_GLOB_PATTERN)
     return [
         x for x in l if os.path.isfile(x) and self.pluralized_name in
         finder_utils.remove_base_directory(x, self.root_path, 'app/views/')
     ]
Ejemplo n.º 6
0
 def find_files(self, glob_root_path, extension='rb'):
     files = finder_utils.glob_project(
         self.root_path, glob_root_path + '/**/*.' + extension)
     return [GeneralFile(filename, glob_root_path) for filename in files]
Ejemplo n.º 7
0
 def find_files(self):
     files = finder_utils.glob_project(self.root_path, self.GLOB_PATTERN)
     files = [filename for filename in files if os.path.isfile(filename)]
     return [AppFile(filename) for filename in files]