Sha256: 6ef12c518cf3e4c3d48d7ba8a6ee24a3eb9d99b6e308e2a88ccf7ebf7b78b547

Contents?: true

Size: 546 Bytes

Versions: 5

Compression:

Stored size: 546 Bytes

Contents

module CodeigniterScaffold
  module Command
    class Init

      def run(args)
        ci_dir = File.dirname(__FILE__) + "/../../resources/ci_2.1.2.zip"
        unzip_file(ci_dir, Dir.pwd)
      end

      def unzip_file(file, destination)
        ::Zip::ZipFile.open(file) do |zip_file|
          zip_file.each do |f|
            f_path = File.join(destination, f.name)
            FileUtils.mkdir_p(File.dirname(f_path))
            zip_file.extract(f, f_path) unless File.exist?(f_path)
          end
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
codeigniter-scaffold-2.0 lib/codeigniter_scaffold/command/init.rb
codeigniter-scaffold-1.0.0 lib/codeigniter_scaffold/command/init.rb
codeigniter-scaffold-0.0.3 lib/codeigniter_scaffold/command/init.rb
codeigniter-scaffold-0.0.2 lib/codeigniter_scaffold/command/init.rb
codeigniter-scaffold-0.0.1 lib/codeigniter_scaffold/command/init.rb