ktec-subtrac 0.1.24 → 0.1.25

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.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/subtrac.rb +41 -38
  3. metadata +1 -1
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 24
4
+ :patch: 25
data/lib/subtrac.rb CHANGED
@@ -46,10 +46,45 @@ module Subtrac
46
46
 
47
47
  SUBTRAC_ROOT = "#{File.dirname(__FILE__)}/" unless defined?(SUBTRAC_ROOT)
48
48
  SUBTRAC_ENV = (ENV['SUBTRAC_ENV'] || 'development').dup unless defined?(SUBTRAC_ENV)
49
- USER_CONFIG = 'config/user.yml'
49
+ USER_CONFIG_FILE = 'config/user.yml'
50
50
 
51
51
  class << self
52
52
 
53
+ # User configured options
54
+ def server_name
55
+ @server_name ||= @APP_CONFIG[:server_name]
56
+ end
57
+
58
+ def server_name=(name)
59
+ @APP_CONFIG[:server_name] = @@server_name = name
60
+ end
61
+
62
+ def server_hostname
63
+ @server_hostname ||= @APP_CONFIG[:server_hostname]
64
+ end
65
+
66
+ def server_hostname=(name)
67
+ @APP_CONFIG[:server_hostname] = @@server_hostname = name
68
+ end
69
+
70
+ def default_client
71
+ @default_client ||= @APP_CONFIG[:default_client]
72
+ end
73
+
74
+ def default_client=(name)
75
+ @APP_CONFIG[:default_client] = @@default_client = name
76
+ end
77
+
78
+ def default_project
79
+ @default_project ||= @APP_CONFIG[:default_project]
80
+ end
81
+
82
+ def default_project=(name)
83
+ puts "Updating default_project to #{name}"
84
+ @APP_CONFIG[:default_project] = @@default_project = name
85
+ end
86
+
87
+
53
88
  # Filesystem directories
54
89
 
55
90
  def root
@@ -74,7 +109,7 @@ module Subtrac
74
109
 
75
110
  def install_dir=(name)
76
111
  puts "Setting new install_dir variable to #{name}"
77
- @install_dir = name
112
+ @APP_CONFIG[:installation_dir] = @install_dir = name
78
113
  end
79
114
 
80
115
  def apache_conf_dir
@@ -109,39 +144,6 @@ module Subtrac
109
144
  @locations_dir ||= File.join(install_dir,@APP_CONFIG[:dirs][:locations])
110
145
  end
111
146
 
112
- def server_name
113
- @server_name ||= @APP_CONFIG[:server_name]
114
- end
115
-
116
- def server_name=(name)
117
- @APP_CONFIG[:server_name] = @@server_name = name
118
- end
119
-
120
- def server_hostname
121
- @server_hostname ||= @APP_CONFIG[:server_hostname]
122
- end
123
-
124
- def server_hostname=(name)
125
- @APP_CONFIG[:server_hostname] = @@server_hostname = name
126
- end
127
-
128
- def default_client
129
- @default_client ||= @APP_CONFIG[:default_client]
130
- end
131
-
132
- def default_client=(name)
133
- @APP_CONFIG[:default_client] = @@default_client = name
134
- end
135
-
136
- def default_project
137
- @default_project ||= @APP_CONFIG[:default_project]
138
- end
139
-
140
- def default_project=(name)
141
- puts "Updating default_project to #{name}"
142
- @APP_CONFIG[:default_project] = @@default_project = name
143
- end
144
-
145
147
  # LDAP
146
148
 
147
149
  def enable_ldap
@@ -183,7 +185,7 @@ module Subtrac
183
185
  # TODO: We need to refactor this code so it will load the default configuration only if one has not been created
184
186
  puts "\n==== Loading configuration file ===="
185
187
  # load configuration file
186
- file_path = File.join(subtrac_path, USER_CONFIG)
188
+ file_path = File.join(subtrac_path, USER_CONFIG_FILE)
187
189
  file_path = File.join(subtrac_path,"/config/config.yml") if not File.exists?(file_path)
188
190
  puts "Attempting to read config file: #{file_path}"
189
191
  begin
@@ -272,8 +274,9 @@ module Subtrac
272
274
  # Write the changes configuration to disk
273
275
  def self.save_config
274
276
  # save the things that might have changed
275
- file_path = File.join(subtrac_path, USER_CONFIG)
276
- open(file_path, 'w') {|f| YAML.dump({SUBTRAC_ENV => @APP_CONFIG}, f)}
277
+ file_path = File.join(subtrac_path, USER_CONFIG_FILE)
278
+ user_config = {SUBTRAC_ENV => @APP_CONFIG}
279
+ open(file_path, 'w') {|f| YAML.dump(user_config, f)}
277
280
  end
278
281
 
279
282
  # creates a directory if it does not exist
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ktec-subtrac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Salisbury