schema_reader 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2138524a728c81f8778e9afa8d0758f558bd77da
4
- data.tar.gz: d3fee34b1fe3a7f0bb2896cc58b19b9092358d8f
3
+ metadata.gz: dfa28583350f38f71cb357ef0eec362e82bc8041
4
+ data.tar.gz: 08e08c0ecca1d043490d8e6c0041ae6fd80b4d9a
5
5
  SHA512:
6
- metadata.gz: a441d6a528fd148912bb10a186d39526eab221eda00d34d8f2f9dd56d48708f5a04a989c542ae5a27d02d174492afdab6a4a81874d35a46c19ca19bbc55c5078
7
- data.tar.gz: 5cf253b6f588644d3fcf4982627a11561a7e16dc1d7fc1129245d9af0c4556bfb0cb043afa85a46e8c276f359857a744768298ee5944d18d0154af3a7a4cddb3
6
+ metadata.gz: 61f14334fc266159320d5d0c54bcc5616c1ac03c73ee6c879e305d9e1fe52e4c07ebca6e18590b51fa73fc6861f10e36c086faa71d2514d1f8ca2f93d217eea1
7
+ data.tar.gz: d192de6013b9ad4d3faa08984946fbe445de1266650e9619496810876de15d985eeabb9b80584019e2205728a69347730f6817b367d650152222930743c8e0ec
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - "2.0.0"
7
+ - "2.1.0"
8
+ - jruby-18mode # JRuby in 1.8 mode
9
+ - jruby-19mode # JRuby in 1.9 mode
10
+ - rbx
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Schema Reader
2
+ [![Build Status](https://travis-ci.org/zeisler/schema_reader.png?branch=master)](https://travis-ci.org/zeisler/schema_reader)
2
3
 
3
4
  Reads Rails Database schema.rb and creates a class from selected table with getters and setters.
4
5
 
data/Rakefile CHANGED
@@ -1 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ task :default => 'specs'
4
+
5
+ task :specs do
6
+ system 'rspec'
7
+ end
@@ -1,3 +1,3 @@
1
1
  module SchemaReader
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/schema_reader.rb CHANGED
@@ -35,7 +35,7 @@ module SchemaReader
35
35
 
36
36
  def add_associations(field_names)
37
37
  association_fields = field_names.select {|field| field =~ /_id/}
38
- field_names += association_fields.map {|field| field.to_s.delete('_id').to_sym}
38
+ field_names += association_fields.map {|field| field.to_s.sub('_id', '').to_sym}
39
39
  field_names
40
40
  end
41
41
 
data/schema.rb CHANGED
@@ -11,6 +11,7 @@ ActiveRecord::Schema.define(version: 20131226214224) do
11
11
  create_table "comments", force: true do |t|
12
12
  t.text "comment"
13
13
  t.integer "user_id"
14
+ t.integer "option_id"
14
15
  t.datetime "created_at"
15
16
  t.datetime "updated_at"
16
17
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "bundler", "~> 1.3"
23
23
  spec.add_development_dependency "rake", "~>10.1"
24
24
  spec.add_development_dependency "rspec", "~>2.14"
25
- spec.add_development_dependency "debase", "~>0.0"
26
- spec.add_development_dependency "ruby-debug-ide", "~>0.4"
25
+ #spec.add_development_dependency "debase", "~>0.0"
26
+ #spec.add_development_dependency "ruby-debug-ide", "~>0.4"
27
27
 
28
28
  end
@@ -74,6 +74,10 @@ describe SchemaReader do
74
74
  expect(comment.user.class).to eq User
75
75
  end
76
76
 
77
+ it 'will not remove underscores or the letters i and d' do
78
+ expect(Comment.new(option: double()).respond_to?(:option)).to eq(true)
79
+ end
80
+
77
81
  end
78
82
 
79
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Zeisler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2014-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,34 +52,6 @@ dependencies:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.14'
55
- - !ruby/object:Gem::Dependency
56
- name: debase
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '0.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- version: '0.0'
69
- - !ruby/object:Gem::Dependency
70
- name: ruby-debug-ide
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- version: '0.4'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ~>
81
- - !ruby/object:Gem::Version
82
- version: '0.4'
83
55
  description: Reads Rails Database schema and creates a class from selected table with
84
56
  getters and setters.
85
57
  email:
@@ -89,6 +61,7 @@ extensions: []
89
61
  extra_rdoc_files: []
90
62
  files:
91
63
  - .gitignore
64
+ - .travis.yml
92
65
  - Gemfile
93
66
  - LICENSE.txt
94
67
  - README.md
@@ -126,3 +99,4 @@ summary: This was created for unit testing Rails ActiveRecord. Instead of creati
126
99
  form the true definition.
127
100
  test_files:
128
101
  - spec/lib/schema_reader_spec.rb
102
+ has_rdoc: