dbhijacker 0.10.2 → 0.10.3

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: 18973a9ed00b466a40b0e395681ec42969ef9eb8
4
- data.tar.gz: 4fb1e3627227267b236e3ec240f1ef580b8375e9
3
+ metadata.gz: b61c5d24b9229df100c3d14ad23097384b30723f
4
+ data.tar.gz: 2734c133056b45ca581fa4af0103894789bd3c51
5
5
  SHA512:
6
- metadata.gz: 6869a27406d577b763c99f7e927ec56f2cdfdedcbd0348be729e90d46fb7545cb5077fffddf6beec15eae9e346bd0ec7dc4ce01c237ad5703e07ffe44df88514
7
- data.tar.gz: 7819f37c2a3d7b0132827fb88c915ba338bb3fa3c16a12638b9b108cd02a74de2c8744ef96d04c14996926ca8663ec20fb0eaeca6d2d61967c90a37dfbeacd74
6
+ metadata.gz: 29602211b164b17dd2b715287763f3c5d9b3e412baac6813d7b1c7d39fcc5107caebfe8f7b5502df0c13bbca01e0b779b2fe72ec9b3b1a488321b8052023fc91
7
+ data.tar.gz: 5afbcc9eee78995a502ebe41235a7a3db9c266f29d6144c5021037cc6179cf5ac5ebbd61f3a2de4fc3a4487050e409c0100b045c8cb48edc4a72d35e7908464a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dbhijacker (0.10.0)
4
+ dbhijacker (0.10.3)
5
5
  rails (>= 2.3.14, < 4.0)
6
6
 
7
7
  GEM
@@ -34,29 +34,15 @@ GEM
34
34
  activesupport (3.2.18)
35
35
  i18n (~> 0.6, >= 0.6.4)
36
36
  multi_json (~> 1.0)
37
- addressable (2.3.6)
38
37
  arel (3.0.3)
39
38
  builder (3.0.4)
40
39
  celluloid (0.15.2)
41
40
  timers (~> 1.1.0)
42
41
  coderay (1.1.0)
43
- descendants_tracker (0.0.4)
44
- thread_safe (~> 0.3, >= 0.3.1)
45
42
  diff-lcs (1.2.5)
46
43
  erubis (2.7.0)
47
- faraday (0.9.0)
48
- multipart-post (>= 1.2, < 3)
49
44
  ffi (1.9.3)
50
45
  formatador (0.2.5)
51
- git (1.2.7)
52
- github_api (0.11.3)
53
- addressable (~> 2.3)
54
- descendants_tracker (~> 0.0.1)
55
- faraday (~> 0.8, < 0.10)
56
- hashie (>= 1.2)
57
- multi_json (>= 1.7.5, < 2.0)
58
- nokogiri (~> 1.6.0)
59
- oauth2
60
46
  guard (2.6.1)
61
47
  formatador (>= 0.2.4)
62
48
  listen (~> 2.7)
@@ -69,22 +55,10 @@ GEM
69
55
  guard-rspec (4.2.10)
70
56
  guard (~> 2.1)
71
57
  rspec (>= 2.14, < 4.0)
72
- hashie (3.0.0)
73
- highline (1.6.21)
74
58
  hike (1.2.3)
75
59
  i18n (0.6.9)
76
- jeweler (2.0.1)
77
- builder
78
- bundler (>= 1.0)
79
- git (>= 1.2.5)
80
- github_api
81
- highline (>= 1.6.15)
82
- nokogiri (>= 1.5.10)
83
- rake
84
- rdoc
85
60
  journey (1.0.4)
86
61
  json (1.8.1)
87
- jwt (1.0.0)
88
62
  listen (2.7.8)
89
63
  celluloid (>= 0.15.2)
90
64
  rb-fsevent (>= 0.9.3)
@@ -95,18 +69,7 @@ GEM
95
69
  treetop (~> 1.4.8)
96
70
  method_source (0.8.2)
97
71
  mime-types (1.25.1)
98
- mini_portile (0.6.0)
99
72
  multi_json (1.10.1)
100
- multi_xml (0.5.5)
101
- multipart-post (2.0.0)
102
- nokogiri (1.6.2.1)
103
- mini_portile (= 0.6.0)
104
- oauth2 (0.9.4)
105
- faraday (>= 0.8, < 0.10)
106
- jwt (~> 1.0)
107
- multi_json (~> 1.3)
108
- multi_xml (~> 0.5)
109
- rack (~> 1.2)
110
73
  polyglot (0.3.5)
111
74
  pry (0.10.0)
112
75
  coderay (~> 1.1.0)
@@ -156,7 +119,6 @@ GEM
156
119
  tilt (~> 1.1, != 1.3.0)
157
120
  sqlite3 (1.3.9)
158
121
  thor (0.19.1)
159
- thread_safe (0.3.4)
160
122
  tilt (1.4.1)
161
123
  timers (1.1.0)
162
124
  treetop (1.4.15)
@@ -173,7 +135,6 @@ DEPENDENCIES
173
135
  guard
174
136
  guard-bundler
175
137
  guard-rspec
176
- jeweler
177
138
  rack (>= 1.1.0)
178
139
  rack-test (>= 0.6.1)
179
140
  rake (>= 0.9.2)
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rdoc/task'
3
-
3
+ require 'rubygems/package_task'
4
4
 
5
5
  desc 'Generate documentation for the hijacker plugin.'
6
6
  Rake::RDocTask.new(:rdoc) do |rdoc|
@@ -11,15 +11,10 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
11
11
  rdoc.rdoc_files.include('lib/**/*.rb')
12
12
  end
13
13
 
14
- begin
15
- require 'jeweler'
16
- Jeweler::Tasks.new do |gemspec|
17
- gemspec.name = "hijacker"
18
- gemspec.summary = "One application, multiple client databases"
19
- gemspec.description = "Allows a single Rails appliation to access many different databases"
20
- gemspec.email = "woody@crystalcommerce.com"
21
- gemspec.authors = ["Woody Peterson"]
22
- end
23
- rescue LoadError
24
- puts "Jeweler not available. Install it with: sudo gem install jeweler"
14
+ spec = Gem::Specification.load("dbhijacker.gemspec")
15
+ Gem::PackageTask.new(spec) {}
16
+
17
+ desc "Push latest gem version"
18
+ task :release => :gem do
19
+ sh "gem push pkg/#{spec.name}-#{spec.version}.gem"
25
20
  end
data/dbhijacker.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{dbhijacker}
5
5
  s.homepage = "https://github.com/crystalcommerce/hijacker"
6
- s.version = "0.10.2"
6
+ s.version = "0.10.3"
7
7
 
8
8
  s.license = "MIT"
9
9
 
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.add_dependency("rails", ">= 2.3.14", "< 4.0")
16
16
 
17
- s.add_development_dependency "jeweler"
18
17
  s.add_development_dependency "bundler"
19
18
  s.add_development_dependency "guard"
20
19
  s.add_development_dependency "guard-rspec"
@@ -41,6 +40,7 @@ Gem::Specification.new do |s|
41
40
  lib/hijacker.rb
42
41
  lib/hijacker/active_record_ext.rb
43
42
  lib/hijacker/alias.rb
43
+ lib/hijacker/base_model.rb
44
44
  lib/hijacker/controller_methods.rb
45
45
  lib/hijacker/database.rb
46
46
  lib/hijacker/host.rb
data/lib/hijacker.rb CHANGED
@@ -252,6 +252,7 @@ private
252
252
  end
253
253
  end
254
254
 
255
+ require_relative './hijacker/base_model'
255
256
  require_relative './hijacker/database'
256
257
  require_relative './hijacker/alias'
257
258
  require_relative './hijacker/host'
@@ -1,7 +1,5 @@
1
1
  module Hijacker
2
- class Alias < ActiveRecord::Base
3
- establish_connection(Hijacker.root_config)
4
-
2
+ class Alias < BaseModel
5
3
  belongs_to :database, :class_name => "Hijacker::Database"
6
4
  end
7
5
  end
@@ -0,0 +1,7 @@
1
+ module Hijacker
2
+ class BaseModel < ActiveRecord::Base
3
+ establish_connection('root')
4
+
5
+ self.abstract_class = true
6
+ end
7
+ end
@@ -15,7 +15,7 @@ if !defined?(Mysql)
15
15
  end
16
16
  end
17
17
 
18
- class Hijacker::Database < ActiveRecord::Base
18
+ class Hijacker::Database < Hijacker::BaseModel
19
19
  module MissingDatabaseError
20
20
  MYSQL_UNKNOWN_DB_ERRNO = 1049
21
21
 
@@ -26,8 +26,6 @@ class Hijacker::Database < ActiveRecord::Base
26
26
  end
27
27
  end
28
28
 
29
- establish_connection(Hijacker.root_config)
30
-
31
29
  has_many :aliases, :class_name => "Hijacker::Alias"
32
30
  belongs_to :master, :foreign_key => 'master_id', :class_name => 'Hijacker::Database'
33
31
  has_many :sisters, :foreign_key => 'master_id', :class_name => 'Hijacker::Database'
data/lib/hijacker/host.rb CHANGED
@@ -1,5 +1,3 @@
1
- class Hijacker::Host < ActiveRecord::Base
2
- establish_connection(Hijacker.root_config)
3
-
1
+ class Hijacker::Host < Hijacker::BaseModel
4
2
  validates_format_of :hostname, :with => /^(#{URI::REGEXP::PATTERN::HOST}|#{URI::REGEXP::PATTERN::IPV6ADDR})$/
5
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbhijacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Xavier
@@ -32,20 +32,6 @@ dependencies:
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '4.0'
35
- - !ruby/object:Gem::Dependency
36
- name: jeweler
37
- requirement: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
- type: :development
43
- prerelease: false
44
- version_requirements: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
35
  - !ruby/object:Gem::Dependency
50
36
  name: bundler
51
37
  requirement: !ruby/object:Gem::Requirement
@@ -190,6 +176,7 @@ files:
190
176
  - lib/hijacker.rb
191
177
  - lib/hijacker/active_record_ext.rb
192
178
  - lib/hijacker/alias.rb
179
+ - lib/hijacker/base_model.rb
193
180
  - lib/hijacker/controller_methods.rb
194
181
  - lib/hijacker/database.rb
195
182
  - lib/hijacker/host.rb
@@ -234,4 +221,3 @@ test_files:
234
221
  - spec/hijacker/middleware_spec.rb
235
222
  - spec/hijacker_spec.rb
236
223
  - spec/spec_helper.rb
237
- has_rdoc: