wordless 1.1.5 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.rubocop.yml +146 -0
- data/.ruby-version +1 -1
- data/.vscode/launch.json +74 -0
- data/.vscode/settings.json +4 -0
- data/Gemfile.lock +117 -0
- data/LICENSE +1 -1
- data/README.mdown +51 -69
- data/Rakefile +5 -3
- data/bin/rake +17 -0
- data/bin/rubocop +17 -0
- data/bin/setup.sh +1 -7
- data/exe/wordless +1 -1
- data/lib/wordless/cli.rb +8 -30
- data/lib/wordless/cli_helper.rb +3 -3
- data/lib/wordless/version.rb +1 -1
- data/lib/wordless/wordless_cli.rb +68 -67
- data/wordless.gemspec +24 -19
- metadata +58 -56
- data/.ruby-gemset +0 -1
- data/lib/wordless/compile_assets.php +0 -36
- data/lib/wordless/theme_builder.php +0 -23
- data/lib/wordless/wordless_bridge.php +0 -26
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
wordless_gem
|
@@ -1,36 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
require 'wordless_bridge.php';
|
4
|
-
|
5
|
-
class CompileAssets extends WordlessBridge {
|
6
|
-
public static function start() {
|
7
|
-
parent::initialize();
|
8
|
-
|
9
|
-
// Determine theme name
|
10
|
-
foreach (scandir(self::$current_dir . '/wp-content/themes') as $theme_dir) {
|
11
|
-
if (in_array($theme_dir, array('.', '..', 'index.php')) && !is_dir($theme_dir)) {
|
12
|
-
continue;
|
13
|
-
}
|
14
|
-
|
15
|
-
$previous_theme_name = WordlessBridge::$theme_name;
|
16
|
-
WordlessBridge::$theme_name = $theme_dir;
|
17
|
-
if (Wordless::theme_is_wordless_compatible()) {
|
18
|
-
if (basename(self::$current_dir) == $theme_dir) {
|
19
|
-
// A theme with the same name as the site is Wordless-compatible, this is probably the one we want
|
20
|
-
break;
|
21
|
-
}
|
22
|
-
} else {
|
23
|
-
WordlessBridge::$theme_name = $previous_theme_name;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
require(get_template_directory() . '/config/initializers/wordless_preferences.php');
|
28
|
-
|
29
|
-
Wordless::register_preprocessors();
|
30
|
-
Wordless::compile_assets();
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
CompileAssets::start();
|
35
|
-
|
36
|
-
?>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
require 'wordless_bridge.php';
|
4
|
-
|
5
|
-
class ThemeBuilder extends WordlessBridge {
|
6
|
-
public static function start() {
|
7
|
-
global $argv, $theme_name;
|
8
|
-
|
9
|
-
parent::initialize();
|
10
|
-
|
11
|
-
require_once Wordless::join_paths(self::$plugin_dir, "wordless", "theme_builder.php");
|
12
|
-
|
13
|
-
$theme_name = $argv[1] ? $argv[1] : 'wordless';
|
14
|
-
$permissions = substr(sprintf('%o', fileperms(self::$plugin_dir)), -4);
|
15
|
-
|
16
|
-
$builder = new WordlessThemeBuilder($theme_name, $theme_name, intval($permissions, 8));
|
17
|
-
$builder->build();
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
ThemeBuilder::start();
|
22
|
-
|
23
|
-
?>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
// WordPress function stubs
|
4
|
-
|
5
|
-
function get_template_directory() {
|
6
|
-
return Wordless::join_paths(getcwd(), "wp-content", "themes", WordlessBridge::$theme_name);
|
7
|
-
}
|
8
|
-
|
9
|
-
function __($string) {
|
10
|
-
return $string;
|
11
|
-
}
|
12
|
-
|
13
|
-
class WordlessBridge {
|
14
|
-
public static $current_dir;
|
15
|
-
public static $plugin_dir;
|
16
|
-
public static $theme_name = 'stub';
|
17
|
-
|
18
|
-
public static function initialize() {
|
19
|
-
self::$current_dir = getcwd();
|
20
|
-
self::$plugin_dir = self::$current_dir . '/wp-content/plugins/wordless';
|
21
|
-
|
22
|
-
require_once self::$plugin_dir . "/wordless/wordless.php";
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
?>
|