ruby_storm 0.0.16 → 0.0.17

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: 55bf44821aee06cc47a36629b0e363bc46891dc4
4
- data.tar.gz: 7131c90b7eb8242c5a184c8d18bbb215905c759c
3
+ metadata.gz: a49d15e246556be22ee0a729792b950caa03c484
4
+ data.tar.gz: 6a3ef042e11f0065e35a25a326875433522aa98d
5
5
  SHA512:
6
- metadata.gz: fab9378bf87c48397a551158136f220b706624972d58192f5bad2041544a8e1322c2e6064524e0c744bff3dccf3ab7d6c26e8576c1d40d0e7b3e3fd62688865d
7
- data.tar.gz: 5eb1bf5f299d596ee8033d7dfea99fe83962215cb7b63497e7d910af6d3f09ef63d04096ffa64239f5a55db09cf31d25b3ff4f2cb95ed22967453036c237c871
6
+ metadata.gz: 05c9f1c05bdad4daadceea633e9e24f11299c1bb0bc838f317406e71169fe6ac06af7ef977f38c24ab04c231cf0c54d3aa6805341eedd25bfb958228eb6e8d2e
7
+ data.tar.gz: 5d44112719d8b91bf35f7b84b120fcfe8ff8243ab3b6ac3a321c510289236e2e49af024f4b9fde7d29daca8df224d29fcd30c29d2ab5beb83027ed781af1c8e2
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'fileutils'
3
3
  require_relative '../generators/version'
4
+ require File.expand_path("./../../vendor/inflector", __FILE__)
4
5
 
5
6
  module Storm
6
7
  STORM_DIR = File.expand_path("#{File.dirname(__FILE__)}/../")
@@ -30,4 +31,25 @@ module Storm
30
31
  def self.db_config
31
32
  ::YAML.load_file('./db/database.yml')[Storm.env.to_s]
32
33
  end
34
+
35
+ def self.load_environment
36
+ require 'active_record'
37
+ require 'bundler'
38
+ require 'awesome_print'
39
+ ::Bundler.require(:default, :development)
40
+ Dir["./package.rb"].each{|file| next if /db\// =~ file; require file }
41
+ Dir["./*.rb"].sort.each{|file| next if /db\// =~ file; require file }
42
+ Dir["./**/*.rb"].sort.each{|file| next if /db\// =~ file; require file }
43
+ end
44
+
45
+ def self.connect
46
+ ActiveRecord::Base.establish_connection YAML.load_file('./db/database.yml')[Storm::STORM_ENV]
47
+ begin
48
+ require 'pry'
49
+ Pry.color = true
50
+ Pry.config.print = proc { |output, value| output.puts "=> #{value.ai}" }
51
+ rescue Exception => e
52
+ puts e
53
+ end
54
+ end
33
55
  end
data/bin/storm CHANGED
@@ -2,7 +2,6 @@
2
2
  require 'thread_safe'
3
3
  module Storm
4
4
 
5
- require File.expand_path("./../../vendor/inflector", __FILE__)
6
5
  require File.expand_path("./../../application/application", __FILE__)
7
6
 
8
7
  def self.perform!(namespace, args=ARGV)
@@ -27,27 +26,6 @@ module Storm
27
26
  return 0
28
27
  end
29
28
 
30
- def self.load_environment
31
- puts "Loading storm environment"
32
- require 'active_record'
33
- require 'bundler'
34
- require 'awesome_print'
35
- ::Bundler.require(:default, :development)
36
- Dir["./*.rb"].sort.each{|file| next if /db\// =~ file; require file }
37
- Dir["./**/*.rb"].sort.each{|file| next if /db\// =~ file; require file }
38
- end
39
-
40
- def self.connect
41
- ActiveRecord::Base.establish_connection YAML.load_file('./db/database.yml')[Storm::STORM_ENV]
42
- begin
43
- require 'pry'
44
- Pry.color = true
45
- Pry.config.print = proc { |output, value| output.puts "=> #{value.ai}" }
46
- rescue Exception => e
47
- puts e
48
- end
49
- end
50
-
51
29
  def self.generator(names)
52
30
  generators_and_paths = names.map{|name|
53
31
  [name.capitalize,name.downcase]
@@ -14,6 +14,7 @@ module Storm
14
14
  rescue Exception
15
15
  if @@reload
16
16
  @@reload = false
17
+ Storm.reload_environment
17
18
  self.start(*args)
18
19
  else
19
20
  require 'irb'
@@ -1,7 +1,7 @@
1
1
  module Storm
2
2
  class Version
3
3
  def self.to_s(*args)
4
- "0.0.16"
4
+ "0.0.17"
5
5
  end
6
6
 
7
7
  def self.start(*args)
@@ -0,0 +1,5 @@
1
+ require 'thread_safe'
2
+ require 'active_record'
3
+ require File.expand_path("./../../application/application", __FILE__)
4
+ Storm.connect
5
+ Storm.load_environment
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_storm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters
@@ -123,6 +123,7 @@ files:
123
123
  - generators/init.rb
124
124
  - generators/start.rb
125
125
  - generators/version.rb
126
+ - lib/ruby_storm.rb
126
127
  - ruby_storm.gemspec
127
128
  - rubystorm.todo
128
129
  - vendor/inflector.rb