totem 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7dd860951dbcc374badc7017f380f07a8aa36d1
4
- data.tar.gz: 5e81108d1c625256ddefe12d65b312ba7035d33c
3
+ metadata.gz: 1642673b0d6a2651e9c4d5b6b92042d1ff2762da
4
+ data.tar.gz: 005d524961253413c80a226d6cd7fbb19372886f
5
5
  SHA512:
6
- metadata.gz: 3f0a3b77364746a25eb863f7238401c67a0c850520084bf81a0c4d5eac1f3cbb8020624864c32f982a788f9eb8766fa798347bdd9202ff1ac4d3b3c5e0ed46d3
7
- data.tar.gz: 2bdba58062c6acea84cb16b5a636a8872d5c67a92ad55b8bc6701b245415044c9f24150e34d46e1bc1aeed096f01eddbf3c16f6f71d867c04a62aeede8347527
6
+ metadata.gz: 153b35b769aeafb208e237efb13efb6d5b1fed0692a168da4a77f607715c137fa27f28180fb206669f64d857e2d5e52a92b731e994394a4ce6bee1f6041a5b33
7
+ data.tar.gz: ceac5fb168525595f9062d3a37f7c12100184c0b03fb25fbe3293796639e4bfb1b9349e8a04878964f65a40db82673652e3f916ec67a92b7bc312a2bf9071cf8
data/README.md CHANGED
@@ -9,9 +9,7 @@ Features:
9
9
  - Integrated console.
10
10
  - Uses built in Ruby classes and avoids depending on 3rd party gems.
11
11
  - Designed for MRI and JRuby.
12
- - Easily extensible through gems or directly in your project.
13
- - ActiveRecord (coming soon).
14
- - Tribe (coming soon).
12
+ - Easily extensible through gems or directly in your project (ActiveRecord gem coming soon).
15
13
  - Designed for multi-threaded applications.
16
14
 
17
15
  ## Installation
@@ -28,6 +26,23 @@ Or install it yourself as:
28
26
 
29
27
  $ gem install totem
30
28
 
29
+ ## Usage
30
+
31
+ Create a new project called "my_app" in the current directory:
32
+
33
+ $ totem new my_app
34
+
35
+ You must now setup Bundler (and rvm, rbenv, etc) for your new project:
36
+
37
+ $ bundle
38
+
39
+ You can now create your custom classes in the "app" directory.
40
+ You will need to manually "require" your classes in "app/loader.rb" since there isn't an auto-loader.
41
+
42
+ Totem comes with an IRB based console similar to Rails:
43
+
44
+ $ totem console
45
+
31
46
  ## Contributing
32
47
 
33
48
  1. Fork it
data/lib/totem.rb CHANGED
@@ -58,7 +58,7 @@ module Totem
58
58
  end
59
59
 
60
60
  def self.log_file_path
61
- name = env
61
+ name = "#{env}"
62
62
  name << "_#{component}" if component && component.length > 0
63
63
  name << "_#{instance}" if instance && instance.length > 0
64
64
  name << '.log'
data/lib/totem/shell.rb CHANGED
@@ -14,9 +14,7 @@ module Totem
14
14
 
15
15
  def run
16
16
  if @args[0].nil?
17
- puts "Usage:\n totem <command>"
18
- puts
19
- puts "Commands:\n #{self.class.cmds.keys.join(', ')}"
17
+ puts_usage
20
18
  return
21
19
  end
22
20
 
@@ -30,7 +28,23 @@ module Totem
30
28
  end
31
29
 
32
30
  def cmd_to_class(cmd)
33
- return self.class.cmds[cmd.to_sym] || raise("Unknown cmd: #{cmd}")
31
+ if result = self.class.cmds[cmd.to_sym]
32
+ return result
33
+ end
34
+
35
+ puts "ERROR: Unknown command: #{cmd}"
36
+ puts
37
+ puts_usage
38
+
39
+ exit
40
+ end
41
+
42
+ private
43
+
44
+ def puts_usage
45
+ puts "Usage:\n totem <command>"
46
+ puts
47
+ puts "Commands:\n #{self.class.cmds.keys.join(', ')}"
34
48
  end
35
49
  end
36
50
  end
@@ -4,6 +4,14 @@ module Totem
4
4
  module ShellCmds
5
5
  class Console < Totem::ShellCmds::Base
6
6
  def run
7
+ env_path = 'config/environment.rb'
8
+ if File.exists?(env_path)
9
+ load(env_path)
10
+ else
11
+ puts "Unable to find #{env_path}. You must run this command from your project root directory."
12
+ exit
13
+ end
14
+
7
15
  ARGV.clear
8
16
  IRB.start
9
17
  end
data/lib/totem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Totem
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Remesch