Sha256: 64d097f4e6a24f1201f11e7ba21623418ed4c2ab66889bc417b79f31996b8042

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require "jdl/version"

module Jdl
  # Your code goes here...
  # create runtest.rb for rails.
  # e.g. :(the name of this file is createruntest.rb)
  # #>ruby createruntest.rb ./test > runtest.sh
  # #>chmod 777 runtest.sh
  #
  def self.getfiles(path,fname,output_name)
    re = []
    allre = []
    ff = []
    Dir.foreach(path) do |f|
    	allre << f
    end
    allre.each do |f|
    	fullfilename = path + "/" + f
      
      # p fullfilename
      
    	if f == "." or f == ".." 
         
      elsif File.directory?(fullfilename)
      	resub = []
    		resub = getfiles(fullfilename,fname,output_name)
		
    		if resub.length > 0
    			ref = {}
    			ref[f] = resub
    			re << ref
    		end
      
      elsif File.exist?(fullfilename) and (f =~ /\.#{fname}$/) # only rb file
        self.print_arr(fullfilename,output_name)
        # p  ff
      	re << f
        ff << fullfilename
      end
    end
    
    # p extname
    return re
    # return ff
  end
 

  def self.print_arr(content,filename='jdl.js')
    f=open(filename,"a") 
    f.puts(content) 
    f.close
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jdl-0.0.1 lib/jdl.rb