bonethug 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/bonethug/installer.rb
CHANGED
@@ -234,11 +234,7 @@ module Bonethug
|
|
234
234
|
bonethug_files = @@conf.get 'project_types.' + project_type + '.bonethug_files'
|
235
235
|
bonethug_files.each do |index, file|
|
236
236
|
puts 'Handling ' + index.to_s + ':' + file.to_s
|
237
|
-
src_file = @@bonthug_gem_dir +
|
238
|
-
'/skel/project_types/' +
|
239
|
-
project_type +
|
240
|
-
'/' +
|
241
|
-
file
|
237
|
+
src_file = @@bonthug_gem_dir + '/skel/project_types/' + project_type + '/' + file
|
242
238
|
dst_file = target + '/' + file
|
243
239
|
FileUtils.cp src_file, dst_file
|
244
240
|
end
|
data/lib/bonethug/version.rb
CHANGED
@@ -7,6 +7,7 @@ use Symfony\Component\Yaml\Yaml;
|
|
7
7
|
class SS_LoadConf {
|
8
8
|
|
9
9
|
protected static $constants_set = false;
|
10
|
+
|
10
11
|
// ss env translation
|
11
12
|
protected static $ss_env = array(
|
12
13
|
'development' => 'dev',
|
@@ -14,12 +15,41 @@ class SS_LoadConf {
|
|
14
15
|
'production' => 'live'
|
15
16
|
);
|
16
17
|
|
18
|
+
protected static $application_env = null;
|
19
|
+
protected static $ss_environment_type = null;
|
20
|
+
|
21
|
+
public static function get_application_env() {
|
22
|
+
self::set_constants();
|
23
|
+
return self::$application_env;
|
24
|
+
}
|
25
|
+
|
26
|
+
public static function env() {
|
27
|
+
return self::get_application_env();
|
28
|
+
}
|
29
|
+
|
30
|
+
public static function get_ss_environment_type() {
|
31
|
+
// ensure constants are set;
|
32
|
+
self::set_constants();
|
33
|
+
return self::$ss_environment_type;
|
34
|
+
}
|
35
|
+
|
36
|
+
public static function translate_env($env) {
|
37
|
+
if (!empty(self::$ss_env[$env])) {
|
38
|
+
return self::$ss_env[$env];
|
39
|
+
} else {
|
40
|
+
return $env;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
17
44
|
public static function set_constants() {
|
18
45
|
|
19
46
|
if (!self::$constants_set) {
|
20
47
|
|
21
48
|
// Transfer environmental vars to constants
|
22
|
-
|
49
|
+
$env = getenv('APPLICATION_ENV');
|
50
|
+
if (!$env) $env = 'production';
|
51
|
+
|
52
|
+
if (!defined('APPLICATION_ENV')) define('APPLICATION_ENV', $env);
|
23
53
|
if (!defined('PATH')) define('PATH', getenv('PATH'));
|
24
54
|
if (!defined('SS_SEND_ALL_EMAILS_TO')) define('SS_SEND_ALL_EMAILS_TO', getenv('SS_SEND_ALL_EMAILS_TO'));
|
25
55
|
|
@@ -30,16 +60,11 @@ class SS_LoadConf {
|
|
30
60
|
}
|
31
61
|
|
32
62
|
self::$constants_set = true;
|
33
|
-
|
34
|
-
|
35
|
-
}
|
63
|
+
self::$application_env = APPLICATION_ENV;
|
64
|
+
self::$ss_environment_type = self::$ss_env[APPLICATION_ENV];
|
36
65
|
|
37
|
-
public static function translate_env($env) {
|
38
|
-
if (!empty(self::$ss_env[$env])) {
|
39
|
-
return self::$ss_env[$env];
|
40
|
-
} else {
|
41
|
-
return $env;
|
42
66
|
}
|
67
|
+
|
43
68
|
}
|
44
69
|
|
45
70
|
public static function cnf() {
|