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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9555fdf23c2f4d1d774a4bc22e7866f2b6efe600
4
- data.tar.gz: 471420c83b9f83fde725cc8138beec71ceb87b71
3
+ metadata.gz: cffb55010af4d810d5bf4b861058c5902e8db7cf
4
+ data.tar.gz: 1cc318230f4921965f8be64515a2b4f0927ecd06
5
5
  SHA512:
6
- metadata.gz: 49540776349b20a7d22dac1a4576ea240677e0d54cf47bfe6495f0cb52161fee5bd418c9c91633b93237b33b13e0847e80acaea5f22652c2646f5309e6af8f14
7
- data.tar.gz: 8c6c14e2b48e21b81709ecd8f4ce55b3fd788ec489ce0b4ec41e18d4c7b34dd92dd0380e1bb510fb225dbfcc61eda6eb72befdf3a9e961ea47a83f58efbe6816
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
- rake migration_reporter:report_migrations[http://my-build-server.com]
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
 
@@ -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).each do |migration|
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,3 +1,3 @@
1
1
  module MigrationReporter
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene Kenny