Class: Brut::CLI::Apps::BuildAssets::Images

Inherits:
Commands::BaseCommand show all
Defined in:
lib/brut/cli/apps/build_assets.rb

Instance Attribute Summary

Attributes inherited from Commands::BaseCommand

#parent_command

Instance Method Summary collapse

Methods inherited from Commands::BaseCommand

#accepts, #args_description, #argv, #commands, #default_command, #default_command_class, #env, #env_vars, #execute, #name, #options, #opts, #puts, #stderr, #stdin, #stdout, #system!

Instance Method Details

#bootstrap?Boolean

Returns:

  • (Boolean)


50
# File 'lib/brut/cli/apps/build_assets.rb', line 50

def bootstrap? = false

#default_rack_envObject



45
# File 'lib/brut/cli/apps/build_assets.rb', line 45

def default_rack_env = "development"

#descriptionObject



46
# File 'lib/brut/cli/apps/build_assets.rb', line 46

def description = "Copy images to the public folder"

#detailed_descriptionObject



47
48
49
# File 'lib/brut/cli/apps/build_assets.rb', line 47

def detailed_description = %{
This is to ensure that any images your code references will end up in the public directory, so they are served properly. This is not for managing images that may be referenced in CSS files. See the `css` command for information on that.
}

#runObject



52
53
54
55
56
57
# File 'lib/brut/cli/apps/build_assets.rb', line 52

def run
  src_dir  = Brut.container.images_src_dir
  dest_dir = Brut.container.images_root_dir

  system! "rsync --archive --delete --verbose \"#{src_dir}/\" \"#{dest_dir}\""
end