schema_monkey_rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +19 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +58 -0
- data/Rakefile +9 -0
- data/gemfiles/Gemfile.base +8 -0
- data/gemfiles/activerecord-4.2/Gemfile.base +3 -0
- data/gemfiles/activerecord-4.2/Gemfile.mysql2 +10 -0
- data/gemfiles/activerecord-4.2/Gemfile.postgresql +10 -0
- data/gemfiles/activerecord-4.2/Gemfile.sqlite3 +10 -0
- data/lib/schema_monkey_rails/railtie.rb +15 -0
- data/lib/schema_monkey_rails/version.rb +5 -0
- data/lib/schema_monkey_rails.rb +9 -0
- data/schema_dev.yml +9 -0
- data/schema_monkey_rails.gemspec +30 -0
- data/spec/rails_spec.rb +39 -0
- data/spec/spec_helper.rb +23 -0
- metadata +196 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 21e05d2e19f03e10f11b23d5e54ff2fac2f19374
|
4
|
+
data.tar.gz: 3fabd221df462635db1e256d25111acef10cc53f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f448ccf800557dc644fb017ed7842c89a630cc6362050292340ab143dce8226a8633f64c2f3f100b13d9687154a1e04c6b6cdc6249f7b908c99aa2642541ac7c
|
7
|
+
data.tar.gz: 942fbd00880201499e7c2da2229ec82e59692d659da96af611d8cbe4f55c9c4e5296f391ffadfc7558953a7bf7ca2859837ead40e1aa57637a9c052c5e992a5e
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# This file was auto-generated by the schema_dev tool, based on the data in
|
2
|
+
# ./schema_dev.yml
|
3
|
+
# Please do not edit this file; any changes will be overwritten next time
|
4
|
+
# schema_dev gets run.
|
5
|
+
---
|
6
|
+
sudo: false
|
7
|
+
rvm:
|
8
|
+
- 1.9.3
|
9
|
+
- 2.1.5
|
10
|
+
gemfile:
|
11
|
+
- gemfiles/activerecord-4.2/Gemfile.mysql2
|
12
|
+
- gemfiles/activerecord-4.2/Gemfile.postgresql
|
13
|
+
- gemfiles/activerecord-4.2/Gemfile.sqlite3
|
14
|
+
env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
|
15
|
+
addons:
|
16
|
+
postgresql: '9.3'
|
17
|
+
before_script: bundle exec rake create_databases
|
18
|
+
after_script: bundle exec rake drop_databases
|
19
|
+
script: bundle exec rake travis
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 ronen barzel
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/schema_monkey_rails.svg)](http://badge.fury.io/rb/schema_monkey_rails)
|
2
|
+
[![Build Status](https://secure.travis-ci.org/SchemaPlus/schema_monkey_rails.svg)](http://travis-ci.org/SchemaPlus/schema_monkey_rails)
|
3
|
+
[![Coverage Status](https://img.shields.io/coveralls/SchemaPlus/schema_monkey_rails.svg)](https://coveralls.io/r/SchemaPlus/schema_monkey_rails)
|
4
|
+
[![Dependency Status](https://gemnasium.com/lomba/schema_monkey_rails.svg)](https://gemnasium.com/SchemaPlus/schema_monkey_rails)
|
5
|
+
|
6
|
+
# SchemaMonkey::Rails
|
7
|
+
|
8
|
+
Arranges to insert [SchemaMonkey](https://github.com/SchemaPlus/schema_monkey) into a rails app--and with it will come all the ActiveRecord extensions based on it that you have included in your app.
|
9
|
+
|
10
|
+
## Installation & Usage
|
11
|
+
|
12
|
+
In your application's Gemfile
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem "schema_monkey_rails"
|
16
|
+
```
|
17
|
+
|
18
|
+
That's all you need to do. When the gem is loaded, it will define a Railtie that will insert SchemaMonkey appropriately.
|
19
|
+
|
20
|
+
If `Rails::Railtie` isn't defined, this gem does nothing.
|
21
|
+
|
22
|
+
## Compatibility
|
23
|
+
|
24
|
+
SchemaMonkey::Rails is tested on:
|
25
|
+
|
26
|
+
<!-- SCHEMA_DEV: MATRIX - begin -->
|
27
|
+
<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
|
28
|
+
* ruby **1.9.3** with activerecord **4.2**, using **mysql2**, **sqlite3** or **postgresql**
|
29
|
+
* ruby **2.1.5** with activerecord **4.2**, using **mysql2**, **sqlite3** or **postgresql**
|
30
|
+
|
31
|
+
<!-- SCHEMA_DEV: MATRIX - end -->
|
32
|
+
|
33
|
+
|
34
|
+
## History
|
35
|
+
|
36
|
+
* 0.1.0 - Initial release
|
37
|
+
|
38
|
+
## Development & Testing
|
39
|
+
|
40
|
+
Are you interested in contributing to SchemaMonkey::Rails? Thanks! Please follow the standard protocol: fork, feature branch, develop, push, and issue pull request.
|
41
|
+
|
42
|
+
Some things to know about to help you develop and test:
|
43
|
+
|
44
|
+
* **schema_dev**: SchemaMonkey::Rails uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
|
45
|
+
facilitate running rspec tests on the matrix of ruby, activerecord, and database
|
46
|
+
versions that the gem supports, both locally and on
|
47
|
+
[travis-ci](http://travis-ci.org/SchemaPlus/schema_monkey_rails)
|
48
|
+
|
49
|
+
To to run rspec locally on the full matrix, do:
|
50
|
+
|
51
|
+
$ schema_dev bundle install
|
52
|
+
$ schema_dev rspec
|
53
|
+
|
54
|
+
You can also run on just one configuration at a time; For info, see `schema_dev --help` or the [schema_dev](https://github.com/SchemaPlus/schema_dev) README.
|
55
|
+
|
56
|
+
The matrix of configurations is specified in `schema_dev.yml` in
|
57
|
+
the project root.
|
58
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
gemspec :path => File.expand_path('..', __FILE__)
|
3
|
+
|
4
|
+
platform :ruby do
|
5
|
+
gem "byebug" if RUBY_VERSION > "2"
|
6
|
+
end
|
7
|
+
|
8
|
+
File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module SchemaMonkey::Rails
|
2
|
+
class Railtie < ::Rails::Railtie
|
3
|
+
|
4
|
+
initializer 'schema_monkey.insert', :before => "active_record.initialize_database" do
|
5
|
+
ActiveSupport.on_load(:active_record) do
|
6
|
+
SchemaMonkey.insert
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
rake_tasks do
|
11
|
+
SchemaMonkey::Rake.insert('db:schema:dump', 'db:schema:load')
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
data/schema_dev.yml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'schema_monkey_rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "schema_monkey_rails"
|
8
|
+
spec.version = SchemaMonkey::Rails::VERSION
|
9
|
+
spec.authors = ["ronen barzel"]
|
10
|
+
spec.email = ["ronen@barzel.org"]
|
11
|
+
spec.summary = %q{Inserts SchemaMonkey into a rails app.}
|
12
|
+
spec.homepage = "https://github.com/SchemaPlus/schema_monkey_rails"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency "activerecord", "~> 4.2"
|
21
|
+
spec.add_dependency "rails"
|
22
|
+
spec.add_dependency "schema_monkey", "~> 0.4", ">= 0.4.1"
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0.0"
|
27
|
+
spec.add_development_dependency "schema_dev", "~> 3.0"
|
28
|
+
spec.add_development_dependency "simplecov"
|
29
|
+
spec.add_development_dependency "simplecov-gem-profile"
|
30
|
+
end
|
data/spec/rails_spec.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SchemaMonkey::Rails do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
# minimial setup for a rails app
|
7
|
+
Kernel.const_set "Dummy", Class.new(Rails::Application) { config.eager_load = true }
|
8
|
+
ENV['DATABASE_URL'] = "#{SchemaDev::Rspec.db_configuration[:adapter]}://localhost/dummy"
|
9
|
+
|
10
|
+
@client = Module.new do
|
11
|
+
def self.insert
|
12
|
+
@inserted = true
|
13
|
+
end
|
14
|
+
def self.inserted?
|
15
|
+
@inserted
|
16
|
+
end
|
17
|
+
def self.reset
|
18
|
+
@inserted = false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
SchemaMonkey.register(@client)
|
23
|
+
|
24
|
+
Rake.application = Rake::Application.new
|
25
|
+
Rails.application.load_tasks
|
26
|
+
Rails.application.initialize!
|
27
|
+
end
|
28
|
+
|
29
|
+
it "inserts client into app" do
|
30
|
+
expect(@client).to be_inserted
|
31
|
+
end
|
32
|
+
|
33
|
+
it "inserts client into rake" do
|
34
|
+
@client.reset
|
35
|
+
expect { Rake::Task["db:schema:dump"].invoke }.to raise_error(Errno::ENOENT)
|
36
|
+
expect(@client).to be_inserted
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'simplecov-gem-profile'
|
3
|
+
SimpleCov.start "gem"
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
6
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
7
|
+
|
8
|
+
require 'rake'
|
9
|
+
require 'rspec'
|
10
|
+
require 'rails/all'
|
11
|
+
require 'schema_monkey_rails'
|
12
|
+
require 'schema_dev/rspec'
|
13
|
+
|
14
|
+
SchemaDev::Rspec.setup
|
15
|
+
|
16
|
+
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
|
17
|
+
|
18
|
+
RSpec.configure do |config|
|
19
|
+
config.warnings = true
|
20
|
+
end
|
21
|
+
|
22
|
+
SimpleCov.command_name "[ruby #{RUBY_VERSION} - ActiveRecord #{::ActiveRecord::VERSION::STRING} - #{ActiveRecord::Base.connection.adapter_name}]"
|
23
|
+
|
metadata
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: schema_monkey_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ronen barzel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: schema_monkey
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.4'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.4.1
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0.4'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.4.1
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: bundler
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.7'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.7'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rake
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '10.0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '10.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 3.0.0
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 3.0.0
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: schema_dev
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '3.0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: simplecov
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: simplecov-gem-profile
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
description:
|
146
|
+
email:
|
147
|
+
- ronen@barzel.org
|
148
|
+
executables: []
|
149
|
+
extensions: []
|
150
|
+
extra_rdoc_files: []
|
151
|
+
files:
|
152
|
+
- ".gitignore"
|
153
|
+
- ".travis.yml"
|
154
|
+
- Gemfile
|
155
|
+
- LICENSE.txt
|
156
|
+
- README.md
|
157
|
+
- Rakefile
|
158
|
+
- gemfiles/Gemfile.base
|
159
|
+
- gemfiles/activerecord-4.2/Gemfile.base
|
160
|
+
- gemfiles/activerecord-4.2/Gemfile.mysql2
|
161
|
+
- gemfiles/activerecord-4.2/Gemfile.postgresql
|
162
|
+
- gemfiles/activerecord-4.2/Gemfile.sqlite3
|
163
|
+
- lib/schema_monkey_rails.rb
|
164
|
+
- lib/schema_monkey_rails/railtie.rb
|
165
|
+
- lib/schema_monkey_rails/version.rb
|
166
|
+
- schema_dev.yml
|
167
|
+
- schema_monkey_rails.gemspec
|
168
|
+
- spec/rails_spec.rb
|
169
|
+
- spec/spec_helper.rb
|
170
|
+
homepage: https://github.com/SchemaPlus/schema_monkey_rails
|
171
|
+
licenses:
|
172
|
+
- MIT
|
173
|
+
metadata: {}
|
174
|
+
post_install_message:
|
175
|
+
rdoc_options: []
|
176
|
+
require_paths:
|
177
|
+
- lib
|
178
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
requirements: []
|
189
|
+
rubyforge_project:
|
190
|
+
rubygems_version: 2.2.2
|
191
|
+
signing_key:
|
192
|
+
specification_version: 4
|
193
|
+
summary: Inserts SchemaMonkey into a rails app.
|
194
|
+
test_files:
|
195
|
+
- spec/rails_spec.rb
|
196
|
+
- spec/spec_helper.rb
|