Sha256: 9840359bae2c80adc1bf7715ddf7dd49ae03d354a3052a188a2408326caaa6b4
Contents?: true
Size: 826 Bytes
Versions: 6
Compression:
Stored size: 826 Bytes
Contents
class RedisConfigGenerator < Rails::Generators::Base def create_redis_file file_name = 'config/redis.yml' unless File.exists?(File.expand_path(file_name)) p "Creating #{file_name}" File.open(file_name, 'w') do |f| f.puts "redis: &redis" f.puts " redis_port: 6379" f.puts " redis_namespace: 'redis'" f.puts " redis_db: 0" f.puts "" f.puts "test: " f.puts " <<: *redis" f.puts " redis_host: 'localhost'" f.puts "" f.puts "development: " f.puts " <<: *redis" f.puts " redis_host: 'localhost'" f.puts "" f.puts "production: " f.puts " <<: *redis" f.puts " redis_host: 'localhost'" end else puts "Skipping #{file_name}, it already exists" end end end
Version data entries
6 entries across 6 versions & 1 rubygems