migration_reporter 0.0.1 → 0.0.2
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 +7 -1
- data/lib/migration_reporter.rb +5 -2
- data/lib/migration_reporter/version.rb +1 -1
- data/lib/tasks/migration_reporter.rake +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cffb55010af4d810d5bf4b861058c5902e8db7cf
|
4
|
+
data.tar.gz: 1cc318230f4921965f8be64515a2b4f0927ecd06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 212b4eec7224b2668bb74a84ae7eeb5e2c31704bc164542cba643abb0903cbd782efb53b014a07531c652f15a428f95dd8125fd5dc429506f4eacba5efda3f0a
|
7
|
+
data.tar.gz: 7ea967967e8d42fffe396d530f58ee2f77fd09d2e57279ee4fb29be586e3364ff911f5d2904be819b74799aec68aaf77e3f9d5a832f311697a1692bac25ec65a
|
data/README.md
CHANGED
@@ -18,7 +18,13 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
Pass the URL to which the migration details should be reported:
|
22
|
+
|
23
|
+
rake migration_reporter:report_migrations[http://my-build-server.com/migrations]
|
24
|
+
|
25
|
+
You can also provide an optional limit parameter, to only report the latest few migrations:
|
26
|
+
|
27
|
+
rake migration_reporter:report_migrations[http://my-build-server.com/migrations,5]
|
22
28
|
|
23
29
|
## Payload format
|
24
30
|
|
data/lib/migration_reporter.rb
CHANGED
@@ -3,9 +3,12 @@ require "migration_reporter/version"
|
|
3
3
|
|
4
4
|
module MigrationReporter
|
5
5
|
class << self
|
6
|
-
def report_migrations(url)
|
6
|
+
def report_migrations(url, limit=nil)
|
7
7
|
paths = ActiveRecord::Migrator.migrations_paths
|
8
|
-
ActiveRecord::Migrator.migrations(paths)
|
8
|
+
migrations = ActiveRecord::Migrator.migrations(paths)
|
9
|
+
migrations = migrations.last(limit.to_i) if limit
|
10
|
+
|
11
|
+
migrations.each do |migration|
|
9
12
|
contents = File.read(migration.filename)
|
10
13
|
report_migration(url, migration, contents)
|
11
14
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
namespace :migration_reporter do
|
2
2
|
desc "Report migration details to the given URL"
|
3
|
-
task :report_migrations, [:url] => :environment do |t, args|
|
4
|
-
MigrationReporter.report_migrations(args[:url])
|
3
|
+
task :report_migrations, [:url, :limit] => :environment do |t, args|
|
4
|
+
MigrationReporter.report_migrations(args[:url], args[:limit])
|
5
5
|
end
|
6
6
|
end
|