Sha256: 29dd94333500693c94e927dc65aa66725816df2e470bae2458a23b484183b376

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

module Optimacms
  class DevController < ApplicationController

    before_filter :check_env

    def check_env
      return false unless Rails.env.development?
    end

    def file
      from = 'D:/mmx/projects/www/myrails/cms/site/test/dummy/public/files/1/cat_red.jpg'
      to = 'D:/mmx/projects/www/myrails/cms/site/test/dummy/public/files/1/supercat.jpg'

      f = 'D:/mmx/projects/www/myrails/cms/site/test/dummy/public/uploads/funny-cats-and-kittens-wallpapers-12.jpg'


      #FileUtils.move(from, to)

      require 'pathname'
      p = Pathname.new(f)
      p.unlink

      #FileUtils.rm(f)
    end

    def addadminuser
      #return

      row = Optimacms::CmsAdminUser.where(email: 'admin@example.com').first || Optimacms::CmsAdminUser.new
      row.email = 'admin@example.com'
      row.password = 'password'
      row.password_confirmation = row.password

      row.save!
    end

    def url1
      v = '[a-z\d\_]+'

      p = '(:pg)'
      p.gsub! /(\(\:#{v}\))([-\.]|$)/, '([^/]+|)\2'

      x = 0

    end

    def url2
      u = "news/3"
      r = /^news\/([^\/]+|)$/

      if u =~ /^news(\/.*|)$/

        x = $1
        y = $2

        z=0

      end
    end
  end



end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
optimacms-0.1.59 app/controllers/optimacms/dev_controller.rb
optimacms-0.1.58 app/controllers/optimacms/dev_controller.rb
optimacms-0.1.57 app/controllers/optimacms/dev_controller.rb