Class: SupportingCast::Generators::RedisConfigGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SupportingCast::Generators::RedisConfigGenerator
show all
- Includes:
- GeneratorHelpers
- Defined in:
- lib/generators/supporting_cast/redis_config_generator.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#application_name, #development_port, #rails_root, #test_port
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
11
12
13
|
# File 'lib/generators/supporting_cast/redis_config_generator.rb', line 11
def env
@env
end
|
#port ⇒ Object
Returns the value of attribute port.
11
12
13
|
# File 'lib/generators/supporting_cast/redis_config_generator.rb', line 11
def port
@port
end
|
Instance Method Details
#default_port ⇒ Object
13
14
15
|
# File 'lib/generators/supporting_cast/redis_config_generator.rb', line 13
def default_port
6379
end
|
#development_redis_conf ⇒ Object
21
22
23
24
25
|
# File 'lib/generators/supporting_cast/redis_config_generator.rb', line 21
def development_redis_conf
@env = 'development'
@port = development_port
template 'redis.conf.erb', "config/redis/#{env}.conf"
end
|
#mkdir_redis_conf ⇒ Object
17
18
19
|
# File 'lib/generators/supporting_cast/redis_config_generator.rb', line 17
def mkdir_redis_conf
empty_directory "config/redis"
end
|
#redis_yml ⇒ Object
33
34
35
|
# File 'lib/generators/supporting_cast/redis_config_generator.rb', line 33
def redis_yml
template 'redis.yml.erb', "config/redis.yml"
end
|
#test_redis_conf ⇒ Object
27
28
29
30
31
|
# File 'lib/generators/supporting_cast/redis_config_generator.rb', line 27
def test_redis_conf
@env = 'test'
@port = test_port
template 'redis.conf.erb', "config/redis/#{env}.conf"
end
|