ruby_storm 0.0.11 → 0.0.12

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: 329eb0a85135061c979d8a8050e4cd348f83045d
4
- data.tar.gz: 80c82c4c95f372471eba16454b54dbf003c648d0
3
+ metadata.gz: d15153b99b083d3e2c8f183021c02d702c7f6816
4
+ data.tar.gz: d28541a7b614bf9164449a7a46cdb4316a60e1bd
5
5
  SHA512:
6
- metadata.gz: 86a213bd21169f5d8592c64c4d8f39af801809e66397a3835dcf89fe0b953a2ff279b0978e728d0d6d26c3daa6f20f97fa677217f6f85b50c9cc27f1486fb24c
7
- data.tar.gz: 593bdc0f577ebb78815fe483d12331912dd7f3491c48ab3679942ce5469e55d4e87f55f4557155140cb284a07be5a33e2708d86c5b4337506c637dcfb69dbbdc
6
+ metadata.gz: 8c68ca744edde8743a5fe522d4e4d14a968392251b0ae01419195d158b5a723841049c5b09799510e3cb1351f818e6ebea150cce28c5c57634ffbb213aa76963
7
+ data.tar.gz: 76bad960dbc4d9451ae822c0c3610a2e771af626d7bb2ce7065b2ad19bb33ac9fb71cf74080ee968910e528a1a027c65193b91de42dc4084a0465700113cd070
data/Gemfile CHANGED
@@ -3,5 +3,4 @@ gem 'awesome_print'
3
3
  gem 'activerecord'
4
4
  gem 'sqlite3'
5
5
  gem 'thread_safe'
6
- gem 'pry', "~> 0.10.0"
7
- gem 'pry-byebug'
6
+
data/Gemfile.lock CHANGED
@@ -22,7 +22,7 @@ GEM
22
22
  coderay (1.1.0)
23
23
  columnize (0.9.0)
24
24
  i18n (0.7.0)
25
- json (1.8.1)
25
+ json (1.8.2)
26
26
  method_source (0.8.2)
27
27
  minitest (5.5.1)
28
28
  pry (0.10.1)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Ruby Storm](https://img.shields.io/badge/Ruby Storm-Ruby%20Stand%20alone%20object%20relational%20mapper-blue.svg)](Ruby Storm)
1
+ [![Ruby Storm](https://img.shields.io/badge/Ruby Storm-Ruby%20Stand%20alone%20object%20relational%20mapper-blue.svg)](Ruby Storm)
2
2
  [![Gem Version](https://badge.fury.io/rb/ruby_storm.svg)](http://badge.fury.io/rb/ruby_storm)
3
3
  [![Downloads](https://img.shields.io/gem/dt/ruby_storm/stable.svg)](https://img.shields.io/gem/dt/ruby_storm)
4
4
  [![Inline docs](http://inch-ci.org/github/wouterken/ruby_storm.svg?branch=master)](http://inch-ci.org/github/wouterken/ruby_storm)
@@ -23,6 +23,17 @@ gem install ruby_storm
23
23
  storm init my_new_project
24
24
  cd my_new_project
25
25
  ````
26
+
27
+ * You can edit the ./db/database.yml file to use alternate DB configurations. Read the [ActiveRecord](https://github.com/rails/rails/tree/master/activerecord) documentation for more details.
28
+
29
+ * DB create/drop commands
30
+
31
+
32
+ ````
33
+ storm db:create
34
+ storm db:drop
35
+ ````
36
+
26
37
  * Generating a new model (and migration in a project)
27
38
 
28
39
  ````
data/bin/storm CHANGED
@@ -12,11 +12,8 @@ module Storm
12
12
  generator(names)
13
13
 
14
14
  if klass = generator(names)
15
- Dir["./*/*.rb"].each{|file| require file } unless [
15
+ Storm.load_environment unless [
16
16
  "Storm::Init",
17
- "Storm::Console",
18
- "Storm::Start",
19
- "Storm::App",
20
17
  "Storm::Version"
21
18
  ].include? klass.name
22
19
  klass.start(args[1..-1])
@@ -37,7 +34,7 @@ module Storm
37
34
  require "awesome_print"
38
35
  require 'bundler'
39
36
  ::Bundler.require(:default, :development)
40
- Dir["./**/*.rb"].each{|file| next if /db\/migrate/ =~ file; require file }
37
+ Dir["./**/*.rb"].each{|file| next if /db\// =~ file; require file }
41
38
  end
42
39
 
43
40
  def self.generator(names)
data/generators/app.rb CHANGED
@@ -3,12 +3,6 @@ require 'fileutils'
3
3
  module Storm
4
4
  class App
5
5
  def self.start(args)
6
- require 'thread_safe'
7
- require 'active_record'
8
- require "awesome_print"
9
- require 'bundler'
10
- ::Bundler.require(:default, :development)
11
- Dir["./**/*.rb"].each{|file| next if /db\/migrate/ =~ file; require file }
12
6
  project_name = File.basename(Dir.pwd)
13
7
  class_name = Inflector::classify(project_name)
14
8
  Inflector::constantize(class_name).send(ARGV[1], ARGV[2..-1])
@@ -7,7 +7,6 @@ module Storm
7
7
  end
8
8
 
9
9
  def self.start(*args)
10
- Storm.load_environment
11
10
  ActiveRecord::Base.establish_connection YAML.load_file('./db/database.yml')[Storm::STORM_ENV]
12
11
  ARGV.clear
13
12
  begin
@@ -0,0 +1,14 @@
1
+ require_relative "db_command"
2
+ require_relative "create"
3
+ require_relative "migrate"
4
+ require_relative "seed"
5
+
6
+ module Storm::Db
7
+ class Reset < Storm::DBCommand
8
+ def self.start (*args)
9
+ Storm::Db::Create.start(*args)
10
+ Storm::Db::Migrate.start(*args)
11
+ Storm::Db::Seed.start(*args)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ require_relative "db_command"
2
+
3
+ module Storm::Db
4
+ class Seed < Storm::DBCommand
5
+ def self.start (*args)
6
+ Dir["./db/seed*.rb"].each do |file| require file end
7
+ end
8
+ end
9
+ end
data/generators/start.rb CHANGED
@@ -4,8 +4,6 @@ module Storm
4
4
  class Start
5
5
  def self.start(args)
6
6
 
7
- Storm.load_environment
8
-
9
7
  project_name = File.basename(Dir.pwd)
10
8
  puts "Loading project [#{project_name}]"
11
9
 
@@ -1,7 +1,7 @@
1
1
  module Storm
2
2
  class Version
3
3
  def self.to_s(*args)
4
- "0.0.11"
4
+ "0.0.12"
5
5
  end
6
6
 
7
7
  def self.start(*args)
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.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters
@@ -116,7 +116,9 @@ files:
116
116
  - generators/db/migrate.rb
117
117
  - generators/db/migration_generator.rb
118
118
  - generators/db/modify.rb
119
+ - generators/db/reset.rb
119
120
  - generators/db/rollback.rb
121
+ - generators/db/seed.rb
120
122
  - generators/db/version.rb
121
123
  - generators/init.rb
122
124
  - generators/start.rb