Module: RailsAssist::Artifact::Asset::FileName
- Included in:
- RailsAssist::Artifact::Asset, RailsAssist::Artifact::Asset
- Defined in:
- lib/rails_artifactor/artifact/file_name/asset.rb
Defined Under Namespace
Modules: Helper
Constant Summary collapse
- DIR =
RailsAssist::Artifact::Directory
Instance Method Summary collapse
Instance Method Details
#asset_file_name(*args) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/rails_artifactor/artifact/file_name/asset.rb', line 45 def asset_file_name *args folder, name, type = get_asset_args(args) = last_option args root_path = [:root_path] assets_path = [:assets_path] assets_path ||= File.join(root_path, 'app/assets') if root_path File. File.join(assets_path || DIR.asset_dirpath, folder.to_s, "#{name}.#{type}") end |
#get_asset_args(*args) ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/rails_artifactor/artifact/file_name/asset.rb', line 54 def get_asset_args *args args = args.flatten raise ArgumentError, "asset_file_name must be called with one or more arguments to return a asset file" if args.size == 0 case args.size when 1 SingleArg.get_asset_args *args else TwoArgs.get_asset_args *args end end |