army-negative 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +15 -0
- data/README.rdoc +17 -21
- data/army-negative.gemspec +2 -2
- data/dummy/Gemfile +2 -2
- data/dummy/Rakefile +0 -1
- data/dummy/config/application.rb +3 -1
- data/dummy/config/database.yml +5 -2
- data/dummy/db/migrate/20110909225432_create_users.rb +1 -5
- data/dummy/db/schema.rb +7 -6
- data/dummy/{config/environments/test.rb → db/seeds.rb} +0 -0
- data/lib/army-negative.rb +12 -4
- data/lib/army-negative/version.rb +1 -1
- metadata +12 -12
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
= 3.1.0, release 2011-09-13
|
2
|
+
|
3
|
+
* Now version 3.1.0 (through 3.1.x) supports rails 3.1.y.
|
4
|
+
* Updated cucumber-based test suite's rails app to rails 3.1.0
|
5
|
+
|
6
|
+
= 3.0.0, release 2011-09-13
|
7
|
+
|
8
|
+
* Now version 3.0.0 (through 3.0.x) supports rails 3.0.y.
|
9
|
+
* Updated cucumber-based test suite's rails app to rails 3.0.10
|
10
|
+
|
11
|
+
From now on (version 3.0.0 and above) the major and minor versions of this gem
|
12
|
+
will match major and minor version numbers of the supported rails version. Rails
|
13
|
+
2.3.x support is still universally supported by any 2.y version of this gem (the
|
14
|
+
minor version number doesn't have to match).
|
15
|
+
|
1
16
|
= 2.0.0, release 2011-09-12
|
2
17
|
|
3
18
|
* Reverted code so that the <tt>2.x</tt> series supports rails <tt>2.3.x</tt> apps.
|
data/README.rdoc
CHANGED
@@ -4,36 +4,32 @@ This gem is a simple ActiveRecord MySQL (+ARMy+) connection adapter
|
|
4
4
|
monkey-patch. Put it in your +Gemfile+ and all your +true+ are belong to us! Or,
|
5
5
|
rather, they'll suddenly become very negative, negative one specifically.
|
6
6
|
|
7
|
-
See the *Usage* section below for information on how to use this gem with rails
|
8
|
-
<tt>2.3.x</tt>.
|
9
|
-
|
10
7
|
== Versioning
|
11
8
|
|
12
|
-
|
13
|
-
|
9
|
+
In general, <tt>army-negative</tt> versions are _pinned_ to the supported rails
|
10
|
+
version. Specifically, the major and minor version numbers will always match.
|
14
11
|
|
15
|
-
|
12
|
+
So, to use <tt>army-negative</tt> in a rails app, you'd use a version specifier
|
13
|
+
in its entry in your +Gemfile+.
|
16
14
|
|
17
|
-
|
15
|
+
Examples:
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
gem "army-negative", "~> 3.0.0" # for all rails 3.0.x apps
|
18
|
+
gem "army-negative", "~> 3.1.0" # for all rails 3.1.x apps
|
19
|
+
gem "army-negative", "~> 4.5.6" # would work in any rails 4.5.x app
|
20
|
+
# etc.
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
The exception to this rule is in rails <tt>2.3.x</tt> apps (the oldest supported
|
23
|
+
rails version). For these versions, you should use the latest <tt>2.x</tt>
|
24
|
+
version of <tt>army-negative</tt> (see the rails2 branch in the git repo).
|
25
|
+
|
26
|
+
== Usage
|
28
27
|
|
29
|
-
|
28
|
+
Simply put a line like the following in your +Gemfile+:
|
30
29
|
|
31
|
-
|
32
|
-
the following:
|
30
|
+
gem "army-negative", "~> 3.1.0"
|
33
31
|
|
34
|
-
|
35
|
-
require 'army-negative'
|
36
|
-
Army::Negative.activate!
|
32
|
+
Then do a <tt>bundle install</tt> on the command-line and you're set.
|
37
33
|
|
38
34
|
== What This Does
|
39
35
|
|
data/army-negative.gemspec
CHANGED
@@ -32,8 +32,8 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
33
33
|
s.require_paths = ["lib"]
|
34
34
|
|
35
|
-
s.add_dependency "rails", "~> 3.
|
36
|
-
s.add_dependency "mysql2", "~> 0.
|
35
|
+
s.add_dependency "rails", "~> 3.1.0"
|
36
|
+
s.add_dependency "mysql2", "~> 0.3.7"
|
37
37
|
|
38
38
|
if s.respond_to?(:add_development_dependency)
|
39
39
|
s.add_development_dependency "bundler", "~> 1.0.18"
|
data/dummy/Gemfile
CHANGED
data/dummy/Rakefile
CHANGED
data/dummy/config/application.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require File.expand_path('../boot', __FILE__)
|
3
3
|
require 'rails/all'
|
4
|
-
|
4
|
+
if defined?(Bundler)
|
5
|
+
Bundler.require *Rails.groups(:assets => %w(development test))
|
6
|
+
end
|
5
7
|
module Dummy
|
6
8
|
class Application < Rails::Application
|
7
9
|
config.encoding = "utf-8"
|
data/dummy/config/database.yml
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# MySQL. Versions 4.1 and 5.0 are recommended.
|
2
|
-
#
|
3
|
-
# Install the
|
2
|
+
#
|
3
|
+
# Install the MYSQL driver
|
4
4
|
# gem install mysql2
|
5
5
|
#
|
6
|
+
# Ensure the MySQL gem is defined in your Gemfile
|
7
|
+
# gem 'mysql2'
|
8
|
+
#
|
6
9
|
# And be sure to use new-style password hashing:
|
7
10
|
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
8
11
|
development:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
class CreateUsers < ActiveRecord::Migration
|
3
|
-
def
|
3
|
+
def change
|
4
4
|
create_table :users do |t|
|
5
5
|
t.string :username
|
6
6
|
t.boolean :enabled
|
@@ -8,8 +8,4 @@ class CreateUsers < ActiveRecord::Migration
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
drop_table :users
|
14
|
-
end
|
15
11
|
end
|
data/dummy/db/schema.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# please use the migrations feature of Active Record to
|
3
|
-
# then regenerate this schema definition.
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
4
|
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# to create the application database on another
|
7
|
-
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
9
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
10
|
#
|
10
11
|
# It's strongly recommended to check this file into your version control system.
|
File without changes
|
data/lib/army-negative.rb
CHANGED
@@ -14,10 +14,18 @@ module Army
|
|
14
14
|
# -1's are recognized as true.
|
15
15
|
#
|
16
16
|
def activate!
|
17
|
-
|
18
|
-
ActiveRecord::ConnectionAdapters::
|
19
|
-
|
20
|
-
|
17
|
+
ActiveRecord::ConnectionAdapters::Column.send :extend, Column
|
18
|
+
ActiveRecord::ConnectionAdapters::Quoting.send :include, Quoting
|
19
|
+
# There may be one of two mysql adapters...
|
20
|
+
adapter = 0
|
21
|
+
begin
|
22
|
+
adapter += 1
|
23
|
+
require "active_record/connection_adapters/mysql#{adapter == 1 ? "" : adapter}_adapter"
|
24
|
+
rescue LoadError => e
|
25
|
+
retry unless adapter >= 2
|
26
|
+
raise e
|
27
|
+
end
|
28
|
+
"ActiveRecord::ConnectionAdapters::Mysql#{adapter == 1 ? "" : adapter}Adapter".constantize.send :include, MysqlAdapter
|
21
29
|
end
|
22
30
|
module_function :activate!
|
23
31
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: army-negative
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 3.0.0
|
10
|
+
version: 3.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kendall Gifford
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-14 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
prerelease: false
|
@@ -25,12 +25,12 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 3
|
29
29
|
segments:
|
30
30
|
- 3
|
31
|
+
- 1
|
31
32
|
- 0
|
32
|
-
|
33
|
-
version: 3.0.0
|
33
|
+
version: 3.1.0
|
34
34
|
version_requirements: *id001
|
35
35
|
name: rails
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -41,12 +41,12 @@ dependencies:
|
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
44
|
+
hash: 29
|
45
45
|
segments:
|
46
46
|
- 0
|
47
|
-
-
|
48
|
-
-
|
49
|
-
version: 0.
|
47
|
+
- 3
|
48
|
+
- 7
|
49
|
+
version: 0.3.7
|
50
50
|
version_requirements: *id002
|
51
51
|
name: mysql2
|
52
52
|
- !ruby/object:Gem::Dependency
|
@@ -136,9 +136,9 @@ files:
|
|
136
136
|
- dummy/config/boot.rb
|
137
137
|
- dummy/config/database.yml
|
138
138
|
- dummy/config/environment.rb
|
139
|
-
- dummy/config/environments/test.rb
|
140
139
|
- dummy/db/migrate/20110909225432_create_users.rb
|
141
140
|
- dummy/db/schema.rb
|
141
|
+
- dummy/db/seeds.rb
|
142
142
|
- dummy/test/fixtures/users.yml
|
143
143
|
- features/support/env.rb
|
144
144
|
- features/support/step_definitions.rb
|