Class: DiceBag::Project
- Inherits:
-
Object
- Object
- DiceBag::Project
- Defined in:
- lib/dice_bag/project.rb
Constant Summary collapse
- DEFAULT_NAME =
"project"
- DEFAULT_BUNDLE_PATH =
"vendor/bundle"
Class Method Summary collapse
- .config_files(filename) ⇒ Object
-
.name ⇒ Object
TODO: how to find the name of the project in non Rails apps?.
- .root ⇒ Object
- .templates_to_generate ⇒ Object
Class Method Details
.config_files(filename) ⇒ Object
17 18 19 |
# File 'lib/dice_bag/project.rb', line 17 def self.config_files(filename) File.join(root, filename) end |
.name ⇒ Object
TODO: how to find the name of the project in non Rails apps?
10 11 12 13 14 15 |
# File 'lib/dice_bag/project.rb', line 10 def self.name return DEFAULT_NAME unless defined?(Rails) parent_name_method = Module.respond_to?(:module_parent_name) ? :module_parent_name : :parent_name Rails.application.class.send(parent_name_method).downcase end |
.root ⇒ Object
21 22 23 |
# File 'lib/dice_bag/project.rb', line 21 def self.root Dir.pwd end |
.templates_to_generate ⇒ Object
25 26 27 28 29 30 |
# File 'lib/dice_bag/project.rb', line 25 def self.templates_to_generate bundle_path = (defined?(Bundler) && Bundler.settings[:path]) || DEFAULT_BUNDLE_PATH FileList.new("**/*.dice") do |fl| fl.exclude(File.join(bundle_path, "/**/*")) end end |