Class: WordpressDirectory
- Inherits:
-
Struct
- Object
- Struct
- WordpressDirectory
- Defined in:
- lib/wordmove/wordpress_directory.rb
Defined Under Namespace
Modules: PATH
Constant Summary collapse
- DEFAULT_PATHS =
{ PATH::WP_CONTENT => 'wp-content', PATH::PLUGINS => 'wp-content/plugins', PATH::THEMES => 'wp-content/themes', PATH::UPLOADS => 'wp-content/uploads', PATH::LANGUAGES => 'wp-content/languages' }
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
1 2 3 |
# File 'lib/wordmove/wordpress_directory.rb', line 1 def @options end |
#type ⇒ Object
Returns the value of attribute type
1 2 3 |
# File 'lib/wordmove/wordpress_directory.rb', line 1 def type @type end |
Instance Method Details
#path(*args) ⇒ Object
19 20 21 |
# File 'lib/wordmove/wordpress_directory.rb', line 19 def path(*args) File.join([:wordpress_path], relative_path(*args)) end |
#relative_path(*args) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/wordmove/wordpress_directory.rb', line 27 def relative_path(*args) path = if [:paths] && [:paths][type] [:paths][type] else DEFAULT_PATHS[type] end File.join(path, *args) end |
#url(*args) ⇒ Object
23 24 25 |
# File 'lib/wordmove/wordpress_directory.rb', line 23 def url(*args) File.join([:vhost], relative_path(*args)) end |