totem 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e194d34b889459966ba773b680f2de71bfe1138a
4
- data.tar.gz: 568a146bb66b1450c638f1617378e4b615c2550f
3
+ metadata.gz: f1e1fef0efa244f9ddb47614e6d7abe6bfe9bbc8
4
+ data.tar.gz: 36e76c0eb66c1b3cad43d3075681d9610c5e7e31
5
5
  SHA512:
6
- metadata.gz: a2c70cf3c2a6ba728dc6988a100a116ffdf55f8b79514aa73129eac6c3071b8b5f582bb2fca8c8596830153852e5378d49596c56ae23241aa152831b287bd480
7
- data.tar.gz: 446e48f048e2001e4ab72350dc43d99a484ec470675ebd053ed4f43a508821df688b6dfe0931847c0e24430170d04291ff7d851fac80c1c8e31e6cfc6f3e30a8
6
+ metadata.gz: 6d8028e8a41664dbdad40914fd43decc587379f0938268d75ff07f371028660a0d03b3718d10259e9d517fe07ca2cd94e53faac7e6c16830830e82a05255cfa8
7
+ data.tar.gz: e4a432d15367fe08653fe82f320a7747ca7dcacac427a6cea4d7d720c6379559a27514c032c2088088c551a23f2d46477974e9cb41fa4d77abd5fc0cfe8a2f32
@@ -29,6 +29,11 @@ module Totem
29
29
  return (@env ||= (ENV['TOTEM_ENV'] || 'development'))
30
30
  end
31
31
 
32
+ def self.env=(val)
33
+ raise 'env may only be set once and must be set before calling logger' if @logger || @env
34
+ @env = val
35
+ end
36
+
32
37
  def self.load_app
33
38
  require "#{Totem.root}/app/loader.rb"
34
39
  end
@@ -37,10 +42,20 @@ module Totem
37
42
  return @component ||= ENV['TOTEM_COMPONENT']
38
43
  end
39
44
 
45
+ def self.component=(val)
46
+ raise 'component may only be set once and must be set before calling logger' if @logger || @component
47
+ @component = val
48
+ end
49
+
40
50
  def self.instance
41
51
  return @instance || ENV['TOTEM_INSTANCE']
42
52
  end
43
53
 
54
+ def self.instance=(val)
55
+ raise 'instance may only be set once and must be set before calling logger' if @logger || @instance
56
+ @instance = val
57
+ end
58
+
44
59
  def self.logger=(val)
45
60
  return @logger = val
46
61
  end
@@ -60,6 +75,18 @@ module Totem
60
75
  return true
61
76
  end
62
77
 
78
+ def self.process_name
79
+ name = "#{env}"
80
+ name << "_#{component}" if component && component.length > 0
81
+ name << "_#{instance}" if instance && instance.length > 0
82
+
83
+ return name
84
+ end
85
+
86
+ def self.log_file_path
87
+ return File.join(root, 'log', "#{process_name}.log")
88
+ end
89
+
63
90
  private
64
91
 
65
92
  def self.log_to_stdout
@@ -68,15 +95,6 @@ module Totem
68
95
  return nil
69
96
  end
70
97
 
71
- def self.log_file_path
72
- name = "#{env}"
73
- name << "_#{component}" if component && component.length > 0
74
- name << "_#{instance}" if instance && instance.length > 0
75
- name << '.log'
76
-
77
- return File.join(root, 'log', name)
78
- end
79
-
80
98
  def self.log_to_file
81
99
  init_logger(log_file_path)
82
100
 
@@ -5,7 +5,7 @@ module Totem
5
5
  class New < Totem::ShellCmds::Base
6
6
  def run
7
7
  if @args[0].nil?
8
- puts "You must provide a name for the new project."
8
+ puts 'ERROR: You must provide a name for the new project.'
9
9
  return
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
1
  module Totem
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7' unless defined?(Totem::VERSION)
3
3
  end
@@ -15,8 +15,8 @@ Gem::Specification.new do |gem|
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
18
+ gem.require_paths = ['lib']
19
19
 
20
- gem.add_development_dependency("bundler", "~> 1.5")
21
- gem.add_development_dependency("rake")
20
+ gem.add_development_dependency('bundler', '~> 1.5')
21
+ gem.add_development_dependency('rake')
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Remesch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-14 00:00:00.000000000 Z
11
+ date: 2014-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler