apartment-settler 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 93dffb28c356821ed8dc9af4bcfea74098c5e212
4
+ data.tar.gz: 565d2fe676a8df757c1cf99bf095042eeea9527e
5
+ SHA512:
6
+ metadata.gz: 62807405bd8c28cdd74aca298fcc86e4ea649be13ec0c1682ddb11001a1dfe103b6ae6f76b59fe8b0c389f3595a7116532b25cb1c3bd40024d5cffef3cf9418e
7
+ data.tar.gz: c191dd465a98eac227ef4421de40ad427e2e590fcbf970087bb3acadeccadd38460bc4bb4424eb52394c51c0fa41a8fb34781fcf41eca1d3d74cf6a51b346b45
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in apartment-settler.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 David Saitta
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.
@@ -0,0 +1,40 @@
1
+ # Apartment::Settler
2
+
3
+ Apartment support for Settler (https://github.com/moiristo/settler).
4
+
5
+ After each ```rake db:migrate``` it calls ```Settler.load!``` on all tenants.
6
+
7
+ ## Requirements
8
+ * Ruby >= 1.9
9
+ * Apartment >= 0.24
10
+ * Settler >= 2.0.0
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ gem 'apartment-settler'
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install apartment-settler
25
+
26
+ ## Usage
27
+
28
+ Just call ```rake db:migrate```
29
+
30
+ ## Note
31
+
32
+ Tested only on PostgreSQL with schemas.
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork it ( https://github.com/d4v1d82/apartment-settler/fork )
37
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 4. Push to the branch (`git push origin my-new-feature`)
40
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'apartment/settler/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "apartment-settler"
8
+ spec.version = Apartment::Settler::VERSION
9
+ spec.authors = ["David Saitta"]
10
+ spec.email = ["david.saitta@gmail.com"]
11
+ spec.summary = %q{Load the settler configuration on all tenants.}
12
+ spec.description = %q{Settler support for Apartment.}
13
+ spec.homepage = "https://github.com/d4v1d82/apartment-settler"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_runtime_dependency 'apartment', '~> 0.24'
25
+ spec.add_runtime_dependency 'settler', '~> 2.0', '>= 2.0.0'
26
+
27
+ end
@@ -0,0 +1 @@
1
+ require 'apartment/settler'
@@ -0,0 +1,10 @@
1
+ require "apartment/settler/version"
2
+ require 'settler'
3
+
4
+ module Apartment
5
+ module Settler
6
+ end
7
+ end
8
+
9
+
10
+ require 'apartment/settler/railtie' if defined?(Rails)
@@ -0,0 +1,14 @@
1
+ module Apartment
2
+ module Settler
3
+ class Railtie < Rails::Railtie
4
+ initializer 'apartment.settler' do
5
+ end
6
+
7
+ rake_tasks do
8
+ load 'tasks/apartment_settler.rake'
9
+ require 'apartment/settler/tasks/enhancements'
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+
2
+ Rake::Task['db:migrate'].enhance do
3
+ Rake::Task['apartment:settler:load'].invoke
4
+ end
5
+
6
+
7
+
@@ -0,0 +1,5 @@
1
+ module Apartment
2
+ module Settler
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+
2
+ namespace :apartment do
3
+ namespace :settler do
4
+ desc 'Load settler across all tenants.'
5
+ task load: :environment do
6
+ tenants.each do |tenant|
7
+ begin
8
+ puts("Loading settler on #{tenant}")
9
+ Apartment::Database.process(tenant) do
10
+ Settler.load!
11
+ end
12
+ rescue Apartment::TenantNotFound => e
13
+ puts e.message
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: apartment-settler
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - David Saitta
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
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: apartment
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.24'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.24'
55
+ - !ruby/object:Gem::Dependency
56
+ name: settler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.0.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '2.0'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.0.0
75
+ description: Settler support for Apartment.
76
+ email:
77
+ - david.saitta@gmail.com
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - ".gitignore"
83
+ - Gemfile
84
+ - LICENSE.txt
85
+ - README.md
86
+ - Rakefile
87
+ - apartment-settler.gemspec
88
+ - lib/apartment-settler.rb
89
+ - lib/apartment/settler.rb
90
+ - lib/apartment/settler/railtie.rb
91
+ - lib/apartment/settler/tasks/enhancements.rb
92
+ - lib/apartment/settler/version.rb
93
+ - lib/tasks/apartment_settler.rake
94
+ homepage: https://github.com/d4v1d82/apartment-settler
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.2.2
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Load the settler configuration on all tenants.
118
+ test_files: []