megegen 0.1.9 → 0.2.1
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 +4 -4
- data/README.md +27 -14
- data/bin/megegen +0 -0
- data/lib/megegen/cli.rb +3 -3
- data/lib/megegen/version.rb +1 -1
- data/megegen.gemspec +3 -3
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58504edc55f71b469c7ba3f03d7f1c9d33c09b08
|
4
|
+
data.tar.gz: c7afd8b8569da78d6f7c1a0ca0b7d355df7c70d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dedebc24f112399aea50c021b7d23e4a4996474a6d46df3a9816cab6dc731d25d4a542c0b5cdfd10465f2083faebdc94bb78050fa3d059d14cad49bb8bcac98
|
7
|
+
data.tar.gz: cd785d8a36ce448405fb8eb7297fa4d8948b5e3cfcb9cf62caf2992ba07d05c42f43167693a386c339fae227b35e75161e4f0274fd9ecdfa8e553e5c85d0574a
|
data/README.md
CHANGED
@@ -1,29 +1,42 @@
|
|
1
1
|
# Mege.Gen
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
ActiveRecord timestamped migrations generator - It knows how to invoke Rails's ActiveRecord generator
|
4
|
+
So you can use Rails Migration Generator without include Rails in your project.
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
---
|
7
|
+
NOTE: *Mege.Gen* can only generates ActiveRecord timestamped migrations
|
8
|
+
NOTE: Please use 0.2.1 and above
|
9
|
+
---
|
10
|
+
|
11
|
+
MegeGen provides two interfaces to Rails's Migration Generator
|
12
|
+
- CLI
|
13
|
+
- db Rake Task
|
8
14
|
|
15
|
+
## Via CLI Interface
|
16
|
+
Install megegen as gem locally
|
17
|
+
Then you will have megegen as command
|
9
18
|
```
|
10
|
-
gem
|
19
|
+
gem install megegen
|
20
|
+
cd <project>
|
21
|
+
megegen generate <NameOfMigration>
|
22
|
+
|
11
23
|
```
|
12
24
|
|
13
|
-
|
25
|
+
## Via Rake Task
|
26
|
+
Include this gem in your Gemfile
|
14
27
|
|
15
28
|
```
|
16
|
-
|
17
|
-
bundle exec rake db:new_migration name=CreateLedgerEntires --trace
|
18
|
-
# May be you do sometimes
|
19
|
-
bundle exec rake db:new_migration name=CreateLedgerEntires migrations_path=./db/cool_migrates --trace
|
29
|
+
gem 'megegen', '0.2.0'
|
20
30
|
```
|
21
31
|
|
22
|
-
|
32
|
+
Then in your Rakefile
|
23
33
|
```
|
24
|
-
|
25
|
-
|
26
|
-
|
34
|
+
require 'megegen'
|
35
|
+
```
|
36
|
+
|
37
|
+
Type the following command in your console
|
27
38
|
|
28
39
|
```
|
40
|
+
bundle exec rake -T db
|
41
|
+
```
|
29
42
|
|
data/bin/megegen
CHANGED
File without changes
|
data/lib/megegen/cli.rb
CHANGED
@@ -16,10 +16,10 @@ end
|
|
16
16
|
|
17
17
|
module Megegen
|
18
18
|
class CLI < Thor
|
19
|
-
desc "generate <NameOfMigration>", "generate ActiveRecord
|
19
|
+
desc "generate <NameOfMigration> <MigrationsPath>", "generate ActiveRecord timestamped migrations"
|
20
20
|
def generate(migration_name, migrations_path = nil)
|
21
|
-
|
22
|
-
|
21
|
+
migrations_name = migration_name || ENV['migrations_name']
|
22
|
+
migrations_path = migrations_path || ENV['migrations_path']
|
23
23
|
|
24
24
|
# Primitive approach take no options
|
25
25
|
params = [migration_name]
|
data/lib/megegen/version.rb
CHANGED
data/megegen.gemspec
CHANGED
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Jack Wu"]
|
10
10
|
spec.email = ["xuwupeng2000@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
14
|
-
spec.homepage = "https://github.com/xuwupeng2000/
|
12
|
+
spec.summary = %q{ActiveRecord timestamped migrations generator - It knows how to invoke Rails's ActiveRecord generator So you can use Rails Migration Generator without include Rails in your project.}
|
13
|
+
spec.description = %q{ActiveRecord timestamped migrations generator - It knows how to invoke Rails's ActiveRecord generator So you can use Rails Migration Generator without include Rails in your project.}
|
14
|
+
spec.homepage = "https://github.com/xuwupeng2000/megegen"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: megegen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Wu
|
@@ -66,7 +66,9 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description: ActiveRecord timestamped migrations generator - It knows how to invoke
|
70
|
+
Rails's ActiveRecord generator So you can use Rails Migration Generator without
|
71
|
+
include Rails in your project.
|
70
72
|
email:
|
71
73
|
- xuwupeng2000@gmail.com
|
72
74
|
executables:
|
@@ -90,7 +92,7 @@ files:
|
|
90
92
|
- lib/megegen/tasks/new_migration.rake
|
91
93
|
- lib/megegen/version.rb
|
92
94
|
- megegen.gemspec
|
93
|
-
homepage: https://github.com/xuwupeng2000/
|
95
|
+
homepage: https://github.com/xuwupeng2000/megegen
|
94
96
|
licenses:
|
95
97
|
- MIT
|
96
98
|
metadata:
|
@@ -114,5 +116,7 @@ rubyforge_project:
|
|
114
116
|
rubygems_version: 2.2.2
|
115
117
|
signing_key:
|
116
118
|
specification_version: 4
|
117
|
-
summary:
|
119
|
+
summary: ActiveRecord timestamped migrations generator - It knows how to invoke Rails's
|
120
|
+
ActiveRecord generator So you can use Rails Migration Generator without include
|
121
|
+
Rails in your project.
|
118
122
|
test_files: []
|