tgauge 0.2.0 → 0.2.1

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: 07619a69df37ace4f1529a5b897ca6353382cce2
4
- data.tar.gz: 26768915f63cc53cd2ea4dc2f50c0eebf4ff568d
3
+ metadata.gz: 73b2b3db2f85b943689e0723a12bf9b435ea2848
4
+ data.tar.gz: 8eef2939792e26d21bb50e51dab5e7f76488f1db
5
5
  SHA512:
6
- metadata.gz: fe5386f187073c27138a395b63dca860726ec1ad987ffa3679563eb8d25402be0ae0db573bb17904ff1134df880f5e61d52e0522b6b65a01bf3586cd9774c47b
7
- data.tar.gz: de1aa7a3a56fdb41a4c8901236944aecfd2db72354eaf476071fce7940bd63dac70ebd1c4dff3c4de264f926da1714885a1bdf9a8562f92e1bcfe058a969a738
6
+ metadata.gz: d4d6076e55107411894019362b0a40e928a34a6869cd9df867be8523b8c20297e8887a234f12ef91684236358be5170f4894d186199e6afd733f9635ab49696e
7
+ data.tar.gz: fd3fcf8fbd05bff41e049f660ff3bf591dcfcf927758c47259ee2ddbc17456611df801aa01fa9de780b367d34705486eb634fede4a3afec01a611625016c5e5a
data/README.md CHANGED
@@ -1,36 +1,38 @@
1
1
  # TGauge
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/TGauge`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ TGauge is a lightweight Ruby MVC / ORM gem.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'TGauge'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install TGauge
7
+ 1. `install gem tgauge`
22
8
 
23
9
  ## Usage
24
10
 
25
- TODO: Write usage instructions here
26
-
27
- ## Development
11
+ ### New Project
12
+ - `tgauge new [PROJ NAME]`
13
+ - Creates a new project directory with [PROJ NAME] as the name
14
+ - `tgauge server`
15
+ - Runs the server
16
+
17
+ ### Generate (g)
18
+ - `tgauge g migration [name]`
19
+ - Creates an empty SQL file in `db/migrations/` with a timestamp.
20
+ - `tgauge g controller [name]`
21
+ - Creates a controller file with a directory in views.
22
+ - `tgauge g model [name]`
23
+ - Creates a model file and a migration file.
24
+
25
+ ### Database (db)
26
+ - `tgauge db create`
27
+ - Sets up the database
28
+ - `tgauge db seed`
29
+ - Seeds the database from `db/seeds`
30
+ - `tgauge db migrate`
31
+ - Runs any migrations in `db/migrations/`
32
+ - `tgauge db reset`
33
+ - Creates / migrates / seeds the database
28
34
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
35
 
33
36
  ## Contributing
34
37
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/TGauge.
36
-
38
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nryulkim/TGauge.
data/bin/cli.rb CHANGED
@@ -23,7 +23,7 @@ module TGauge
23
23
  f.write("end")
24
24
  end
25
25
 
26
- Dir.mkdir "./app/views/#{name.downcase}_controller"
26
+ Dir.mkdir "./app/views/#{name.downcase}"
27
27
  puts "#{name} controller created"
28
28
  end
29
29
 
@@ -51,8 +51,7 @@ module TGauge
51
51
 
52
52
  desc 'migrate', 'runs pending migrations'
53
53
  def migrate
54
- # Creates Version table if necessary,
55
- # then runs needed migrations in order.
54
+ # runs needed migrations in order.
56
55
  require_relative '../lib/db/db_connection'
57
56
  TGauge::DBConnection.migrate
58
57
  puts 'migrated!'
@@ -60,6 +59,7 @@ module TGauge
60
59
 
61
60
  desc 'seed', 'seeds the DB'
62
61
  def seed
62
+ # runs the seeds file in db/seeds that has been created by the new command
63
63
  require_relative '../lib/tgauge'
64
64
  TGauge::Seed.populate
65
65
  puts 'db seeded!'
@@ -67,6 +67,7 @@ module TGauge
67
67
 
68
68
  desc 'reset', 'resets the DB and seeds it'
69
69
  def reset
70
+ # the PostgreSQL database
70
71
  create
71
72
  migrate
72
73
  seed
@@ -5,7 +5,7 @@ require 'yaml'
5
5
  PRINT_QUERIES = ENV['PRINT_QUERIES'] == 'true'
6
6
  MIGRATION_FILES = Dir.glob("./db/migrations/*.sql").to_a
7
7
 
8
- module TGauge
8
+ module TGaugex
9
9
  class DBConnection
10
10
  def self.app_name
11
11
  YAML.load_file(Dir.pwd + '/config/database.yml')['database']
@@ -18,6 +18,10 @@ module TGauge
18
18
  )
19
19
  end
20
20
 
21
+ def self.reset
22
+ self.instance
23
+ end
24
+
21
25
  def self.migrate
22
26
  ensure_migrations_table
23
27
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TGauge
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tgauge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nam Kim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-18 00:00:00.000000000 Z
11
+ date: 2016-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler