model_probe 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +4 -10
- data/lib/model_probe.rb +1 -1
- data/lib/model_probe/version.rb +1 -1
- metadata +8 -10
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a018480b4783c49c364d4cc3b4780fef4042a146
|
4
|
+
data.tar.gz: 78816322d1c24af65c46596094afa9f14175b885
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5793273d3efde3e7a3d6fcb17072096cdde1722debc9d6fc6ae0899267b05dcd4c6662e1b46065327d08e4d65ff4fea86a2f19af0b5fdc05d4c654e91cb732b0
|
7
|
+
data.tar.gz: 702e289f5de4b39203f262242d5518f64363b3ffc0add945e7bf6232472fea80f8ebdeff73a11394061935ca66b5a0abbf8fca4821e03d5ba95541a55fd3babb
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# ModelProbe
|
2
2
|
|
3
|
-
## Schema introspection for
|
3
|
+
## Schema introspection for ActiveRecord
|
4
4
|
|
5
|
-
Provides a detailed view of the underlying schema that backs an
|
5
|
+
Provides a detailed view of the underlying schema that backs an ActiveRecord model.
|
6
|
+
|
7
|
+
*This functionality can be added to any object that implements [ActiveRecord's columns interface](http://rubydoc.info/docs/rails/ActiveRecord/ModelSchema/ClassMethods#columns-instance_method).*
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -25,11 +27,3 @@ MyModel.extend ModelProbe
|
|
25
27
|
MyModel.probe
|
26
28
|
MyModel.fixture
|
27
29
|
```
|
28
|
-
|
29
|
-
## Contributing
|
30
|
-
|
31
|
-
1. Fork it
|
32
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
-
5. Create new Pull Request
|
data/lib/model_probe.rb
CHANGED
@@ -12,7 +12,7 @@ module ModelProbe
|
|
12
12
|
|
13
13
|
columns.sort{ |a, b| a.name <=> b.name }.map do |column|
|
14
14
|
name = column.name
|
15
|
-
name = "* #{name}" if column.
|
15
|
+
name = "* #{name}" if column.name == primary_key
|
16
16
|
print yellow(name.to_s.rjust(name_pad))
|
17
17
|
print " "
|
18
18
|
print blue(column.type.to_s.ljust(type_pad, "."))
|
data/lib/model_probe/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_probe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nathan Hopkins
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Provides a detailed view of the underlying schema that backs an ActiveModel.
|
15
14
|
email:
|
@@ -18,7 +17,7 @@ executables: []
|
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files: []
|
20
19
|
files:
|
21
|
-
- .gitignore
|
20
|
+
- ".gitignore"
|
22
21
|
- Gemfile
|
23
22
|
- LICENSE.txt
|
24
23
|
- README.md
|
@@ -29,26 +28,25 @@ files:
|
|
29
28
|
- model_probe.gemspec
|
30
29
|
homepage: http://hopsoft.github.com/model_probe/
|
31
30
|
licenses: []
|
31
|
+
metadata: {}
|
32
32
|
post_install_message:
|
33
33
|
rdoc_options: []
|
34
34
|
require_paths:
|
35
35
|
- lib
|
36
36
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
37
|
requirements:
|
39
|
-
- -
|
38
|
+
- - ">="
|
40
39
|
- !ruby/object:Gem::Version
|
41
40
|
version: '0'
|
42
41
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
42
|
requirements:
|
45
|
-
- -
|
43
|
+
- - ">="
|
46
44
|
- !ruby/object:Gem::Version
|
47
45
|
version: '0'
|
48
46
|
requirements: []
|
49
47
|
rubyforge_project:
|
50
|
-
rubygems_version:
|
48
|
+
rubygems_version: 2.4.5
|
51
49
|
signing_key:
|
52
|
-
specification_version:
|
50
|
+
specification_version: 4
|
53
51
|
summary: Schema introspection for ActiveModel.
|
54
52
|
test_files: []
|