activerecord-db-tools 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+ Gemfile.lock
21
+
22
+ ## PROJECT::SPECIFIC
23
+
24
+ ## RVM
25
+ .rvmrc
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+
5
+ branches:
6
+ only:
7
+ - master
File without changes
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ # specify gem dependencies in activerecord-postgres-hstore.gemspec
4
+ # except the platform-specific dependencies below
5
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Craig Kerstiens
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+
2
+
3
+ ##Install
4
+
5
+ Then, just add this to your Gemfile:
6
+
7
+ `gem 'activerecord-db-tools'`
8
+
9
+ And run your bundler:
10
+
11
+ `bundle install`
12
+
13
+ ##Usage
14
+
15
+ If you want to use it just put in your Gemfile:
16
+
17
+ gem 'activerecord-db-tools'
18
+
19
+ Then to turn on set the environment variable:
20
+
21
+ DB_READ_ONLY=true
22
+
23
+
24
+ ##Help
25
+
26
+ You can use issues in github for that.
27
+
28
+
29
+ ##Copyright
30
+
31
+ Copyright © 2013 Craig Kerstiens. See LICENSE for details.
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.unshift File.expand_path("../lib", __FILE__)
3
+ require 'bundler/gem_tasks'
4
+ require 'rubygems'
5
+ require 'rspec/core/rake_task'
6
+ require 'rdoc/task'
7
+
8
+ task :default => :spec
9
+
10
+ begin
11
+ Bundler.setup(:default, :development)
12
+ rescue Bundler::BundlerError => e
13
+ $stderr.puts e.message
14
+ $stderr.puts "Run `bundle install` to install missing gems"
15
+ exit e.status_code
16
+ end
17
+
18
+ RSpec::Core::RakeTask.new(:spec)
19
+
20
+ RSpec::Core::RakeTask.new(:coverage) do |t|
21
+ t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
22
+ t.rcov = true
23
+ t.rcov_opts = ['--exclude', 'spec']
24
+ end
25
+
26
+ RDoc::Task.new do |rdoc|
27
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
28
+ rdoc.rdoc_dir = 'rdoc'
29
+ rdoc.title = "activerecord-postgres-hstore #{version}"
30
+ rdoc.rdoc_files.include('README*')
31
+ rdoc.rdoc_files.include('lib/**/*.rb')
32
+ end
33
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib/', __FILE__)
3
+ $:.unshift lib unless $:.include?(lib)
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "activerecord-db-tools"
7
+ s.version = "0.0.1"
8
+
9
+ s.platform = Gem::Platform::RUBY
10
+ s.license = "MIT"
11
+ s.authors = ["Craig Kerstiens"]
12
+ s.email = "craig.kerstiens@gmail.com"
13
+ s.homepage = "http://github.com/craigkerstiens/activerecord-db-tools"
14
+ s.summary = "Read-only tool for databases"
15
+ s.description = "A tool for setting your database to read-only mode allowing you to conduct migrations, move database, or condut other actions that may typically involve taking a database fully offline"
16
+ s.required_ruby_version = ">= 1.8.7"
17
+ s.required_rubygems_version = ">= 1.3.6"
18
+
19
+ s.add_dependency "rails", ">= 3.1"
20
+ s.add_dependency "rake"
21
+ s.add_development_dependency "bundler"
22
+ s.add_development_dependency "rdoc"
23
+ s.add_development_dependency "rspec", "~> 2.11"
24
+
25
+ git_files = `git ls-files`.split("\n") rescue ''
26
+ s.files = git_files
27
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
28
+ s.executables = []
29
+ s.require_paths = %w(lib)
30
+ end
@@ -0,0 +1,3 @@
1
+ require 'active_support'
2
+
3
+ require "activerecord-db-tools/activerecord"
@@ -0,0 +1,8 @@
1
+ # Extends AR to add a configurable read-only mode.
2
+ module ActiveRecord
3
+ class Base
4
+ def readonly?
5
+ (ENV['DB_READ_ONLY'] == "true") || false
6
+ end
7
+ end
8
+ end
File without changes
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-db-tools
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Craig Kerstiens
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: bundler
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rdoc
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '2.11'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '2.11'
94
+ description: A tool for setting your database to read-only mode allowing you to conduct
95
+ migrations, move database, or condut other actions that may typically involve taking
96
+ a database fully offline
97
+ email: craig.kerstiens@gmail.com
98
+ executables: []
99
+ extensions: []
100
+ extra_rdoc_files: []
101
+ files:
102
+ - .gitignore
103
+ - .travis.yml
104
+ - CHANGELOG
105
+ - Gemfile
106
+ - LICENSE
107
+ - README.md
108
+ - Rakefile
109
+ - VERSION
110
+ - activerecord-db-tools.gemspec
111
+ - lib/activerecord-db-tools.rb
112
+ - lib/activerecord-db-tools/activerecord.rb
113
+ - spec/activerecord-coders-hstore_spec.rb
114
+ - spec/spec_helper.rb
115
+ homepage: http://github.com/craigkerstiens/activerecord-db-tools
116
+ licenses:
117
+ - MIT
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: 1.8.7
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: 1.3.6
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 1.8.24
137
+ signing_key:
138
+ specification_version: 3
139
+ summary: Read-only tool for databases
140
+ test_files:
141
+ - spec/activerecord-coders-hstore_spec.rb
142
+ - spec/spec_helper.rb