Module: Cream::Generators::Config::Helpers
- Defined in:
- lib/generators/cream/config/modules/helper.rb
Constant Summary collapse
- ORM_MAP =
{ :data_mapper => 'dm-devise', :mongo_mapper => 'mm-devise', :mongoid => 'rails3-mongoid-devise' }
Instance Method Summary collapse
- #admin_user? ⇒ Boolean
- #default_roles ⇒ Object
- #execute(command) ⇒ Object
- #here ⇒ Object
- #logfile ⇒ Object
- #orm ⇒ Object
- #permission_config? ⇒ Boolean
- #roles ⇒ Object
- #roles_config? ⇒ Boolean
- #root_dir ⇒ Object
- #strategy ⇒ Object
Instance Method Details
#admin_user? ⇒ Boolean
44 45 46 |
# File 'lib/generators/cream/config/modules/helper.rb', line 44 def admin_user? [:admin] end |
#default_roles ⇒ Object
24 25 26 |
# File 'lib/generators/cream/config/modules/helper.rb', line 24 def default_roles [:default_roles] ? '--default-roles' : '--no-default-roles' end |
#execute(command) ⇒ Object
11 12 13 14 |
# File 'lib/generators/cream/config/modules/helper.rb', line 11 def execute command logger.debug command run command end |
#here ⇒ Object
48 49 50 |
# File 'lib/generators/cream/config/modules/helper.rb', line 48 def here File.dirname(__FILE__) end |
#logfile ⇒ Object
20 21 22 |
# File 'lib/generators/cream/config/modules/helper.rb', line 20 def logfile [:logfile] end |
#orm ⇒ Object
32 33 34 |
# File 'lib/generators/cream/config/modules/helper.rb', line 32 def orm [:orm] end |
#permission_config? ⇒ Boolean
40 41 42 |
# File 'lib/generators/cream/config/modules/helper.rb', line 40 def [:permission_config] end |
#roles ⇒ Object
28 29 30 |
# File 'lib/generators/cream/config/modules/helper.rb', line 28 def roles [:roles].join(' ') end |
#roles_config? ⇒ Boolean
36 37 38 |
# File 'lib/generators/cream/config/modules/helper.rb', line 36 def roles_config? [:roles_config] end |
#root_dir ⇒ Object
52 53 54 |
# File 'lib/generators/cream/config/modules/helper.rb', line 52 def root_dir File.dirname(__FILE__).up(4) end |
#strategy ⇒ Object
16 17 18 |
# File 'lib/generators/cream/config/modules/helper.rb', line 16 def strategy [:strategy] end |