dbmapper 0.0.2 → 0.0.3

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: 214c0621b8b59c0096a08694dfe6b5388cd00b35
4
- data.tar.gz: 7dc2f7b08d0d906874eeb3be3e7fd20bc9912a18
3
+ metadata.gz: 28e9c48d3e2603c383086a6f09ff8118d4300813
4
+ data.tar.gz: 45714ec999bec23d6d2a86b3fbf6212afdffc508
5
5
  SHA512:
6
- metadata.gz: 33b125b076905b26f9a5b37f8f9933e37d0e9b31183b5bf051672838279870499e2e3e454d8e78d6d5db436d2e95da9aa43b07a6fe462c20029a5163f7ebe919
7
- data.tar.gz: 608a676e726718b93796abe820955fed48ead23d479b25873143f08c5d0594f33bb919b800fe07e54fa2621280085e052f4a718bbf0da5b6494e2a22dd0412e5
6
+ metadata.gz: eea244d505af57d18a13bc6223a58eea3af0ccd40cd428fff9e876676e0f0a322185e6d365cda29e57cb241ce134addaf14028eebac3d9eaaf74c29d5d25f81f
7
+ data.tar.gz: ca15f08bd143d9f6cc08247233b4a9620d2a591b62b93d4a3c314d302c37e3e11e9f204e11e7e2ac6f54238f3de42d38c97ddf90197244fb49f66d27e391933d
data/dbmapper.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["sh6khan"]
10
10
  spec.email = ["sadman.khan999@gmail.com"]
11
11
  spec.summary = %q{Maps out all the models in your database into a file}
12
- spec.description = %q{Same as summary}
12
+ spec.description = %q{Mapp out all the models in your database into a file}
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
@@ -1,3 +1,3 @@
1
1
  module Dbmapper
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/dbmapper.rb CHANGED
@@ -2,10 +2,7 @@ require "dbmapper/version"
2
2
 
3
3
  module Dbmapper
4
4
  class DatabaseMapper
5
-
6
- def self.hello_world
7
- puts "Hello World"
8
- end
5
+
9
6
  def initlialize
10
7
  Rails.application.eager_load!
11
8
  end
@@ -14,8 +11,9 @@ module Dbmapper
14
11
  #open file
15
12
  text_file = File.open("mapped_databse.txt", 'w')
16
13
  ActiveRecord::Base.descendants.each do |model|
17
- text_file.write(model)
14
+ text_file.write(model + '\n')
18
15
  end
16
+ puts "All your models have been written to mapped_databse.txt"
19
17
  text_file.close
20
18
  end
21
19
 
@@ -23,11 +21,13 @@ module Dbmapper
23
21
  #open file
24
22
  text_file = File.open("mapped_databse.txt", 'w')
25
23
  ActiveRecord::Base.descendants.each do |model|
26
- text_file.write(model);
24
+ text_file.write(model + '\n');
27
25
  model.column_names.each do |column|
28
26
  text_file.write(column)
29
27
  end
30
28
  end
29
+ puts "All your columns have been written to mapped_databse.txt"
30
+ text_file.close
31
31
  end
32
32
 
33
33
  def all_models_with_association
@@ -35,13 +35,14 @@ module Dbmapper
35
35
  text_file = File.open("mapped_databse.txt", 'w')
36
36
  association_string = "-->"
37
37
  ActiveRecord::Base.descendants.each do |model|
38
- text_file.write(model)
38
+ text_file.write(model + '\n')
39
39
  model.relfect_on_all_associations.map(&:name).each do |assocations|
40
40
  association_string = association_string + " #{assocations},"
41
41
  end
42
- text_file.write(association_string)
42
+ text_file.write(association_string + '\n')
43
43
  association_string = "-->"
44
44
  end
45
+ puts "all models with their assocations have been written to mapped_databse.txt"
45
46
  text_file.close
46
47
  end
47
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbmapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sh6khan
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
- description: Same as summary
41
+ description: Mapp out all the models in your database into a file
42
42
  email:
43
43
  - sadman.khan999@gmail.com
44
44
  executables: []