Top Level Namespace
Defined Under Namespace
Modules: Aina, Generable
Classes: Addable, PostType, String
Instance Method Summary
collapse
Instance Method Details
#aina_inclusion ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/aina/support.rb', line 25
def aina_inclusion
output = "\n/**\n"
output += " * Include Aina's framework\n"
output += " */\n"
output += "if ( file_exists( dirname(__FILE__) . '/inc/aina.php' ) ) {\n"
output += " require_once 'inc/aina.php';\n"
output += "}\n"
end
|
#create_empty_functions_php ⇒ Object
19
20
21
22
23
|
# File 'lib/aina/support.rb', line 19
def create_empty_functions_php
unless functions_php_exists?
File.open(functions_php, "w") {|file| file.puts "<?php\n"}
end
end
|
#functions_php ⇒ Object
11
12
13
|
# File 'lib/aina/support.rb', line 11
def functions_php
Dir.pwd + "/functions.php"
end
|
#functions_php_exists? ⇒ Boolean
15
16
17
|
# File 'lib/aina/support.rb', line 15
def functions_php_exists?
File.exists?(Dir.pwd + "/functions.php")
end
|
#is_wordpress_theme? ⇒ Boolean
1
2
3
4
5
|
# File 'lib/aina/support.rb', line 1
def is_wordpress_theme?
theme_path = Dir.pwd.split('/')
theme_path.pop
theme_path.last(2).join('/') == 'wp-content/themes'
end
|
#tests_being_runned? ⇒ Boolean
7
8
9
|
# File 'lib/aina/support.rb', line 7
def tests_being_runned?
ENV['HOME'] == 'tmp/aruba'
end
|