Class: WordpressDirectory
- Inherits:
-
Object
- Object
- WordpressDirectory
- Defined in:
- lib/wordmove/wordpress_directory.rb
Defined Under Namespace
Modules: LocalHelperMethods, Path, RemoteHelperMethods
Constant Summary collapse
- DEFAULT_PATHS =
{ Path::WP_CONTENT => 'wp-content', Path::WP_CONFIG => 'wp-config.php', Path::PLUGINS => 'wp-content/plugins', Path::MU_PLUGINS => 'wp-content/mu-plugins', Path::THEMES => 'wp-content/themes', Path::UPLOADS => 'wp-content/uploads', Path::LANGUAGES => 'wp-content/languages' }.freeze
Instance Attribute Summary collapse
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(folder, options) ⇒ WordpressDirectory
constructor
A new instance of WordpressDirectory.
- #path ⇒ Object
- #relative_path ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(folder, options) ⇒ WordpressDirectory
Returns a new instance of WordpressDirectory.
4 5 6 7 |
# File 'lib/wordmove/wordpress_directory.rb', line 4 def initialize(folder, ) @folder = folder @options = end |
Instance Attribute Details
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
2 3 4 |
# File 'lib/wordmove/wordpress_directory.rb', line 2 def folder @folder end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'lib/wordmove/wordpress_directory.rb', line 2 def @options end |
Class Method Details
.default_path_for(sym) ⇒ Object
29 30 31 |
# File 'lib/wordmove/wordpress_directory.rb', line 29 def self.default_path_for(sym) DEFAULT_PATHS[sym] end |
Instance Method Details
#path ⇒ Object
33 34 35 |
# File 'lib/wordmove/wordpress_directory.rb', line 33 def path(*) File.join([:wordpress_path], relative_path(*)) end |
#relative_path ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/wordmove/wordpress_directory.rb', line 41 def relative_path(*) path = if [:paths] && [:paths][folder] [:paths][folder] else DEFAULT_PATHS[folder] end File.join(path, *) end |
#url ⇒ Object
37 38 39 |
# File 'lib/wordmove/wordpress_directory.rb', line 37 def url(*) File.join([:vhost], relative_path(*)) end |