rails-futurizer 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +5 -0
- data/README.md +53 -14
- data/lib/futurizer/patches/activerecord/association_proxy.rb +18 -0
- data/lib/futurizer/system_info.rb +4 -0
- data/lib/futurizer/version.rb +1 -1
- data/lib/futurizer/version_detection.rb +7 -1
- data/lib/rails-futurizer.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d19e7d09ac51d53ff271394258aca3679e60087
|
4
|
+
data.tar.gz: 6f6e61beb959e6a70b3c6345cd5bc652a8c54557
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f7e51aff9bba2aac642a2655c8c5db2cda6e11e8f50552d8fc2e2f7df81c427518e6d10009fdc9747e48463f4b241818fe93c874fb6621cc3aada09c8f7bbdb
|
7
|
+
data.tar.gz: f29d8b75ba98e6385cea3c71e2d16aaca23eaad36bb48cb6b92da57ac7983a393a3bc33e7e38f9cef48124fae5f9c7f72e1d679131a2e7c4f73a560d256ba93b
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -3,32 +3,71 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/brianauton/rails-futurizer.png?branch=master)](https://travis-ci.org/brianauton/rails-futurizer)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/brianauton/rails-futurizer.png)](https://codeclimate.com/github/brianauton/rails-futurizer)
|
5
5
|
|
6
|
-
Drag your legacy Rails apps into the future a little
|
6
|
+
Drag your legacy Rails apps into the future a little more easily.
|
7
|
+
|
8
|
+
### Introduction
|
9
|
+
|
10
|
+
Upgrading a legacy Rails app can be a frustrating process. Ideally,
|
11
|
+
you'd like to break the upgrade up into as many discrete steps as
|
12
|
+
possible: upgrade the Ruby version here, a couple gems there, and
|
13
|
+
continually commit to master with all tests passing at each step.
|
14
|
+
|
15
|
+
But these intermediate steps often involve version combinations that
|
16
|
+
are not well supported or tested (e.g. Ruby 2 + Rails 2), and a lot of
|
17
|
+
time is typically spent tracking down unexpected test failures and
|
18
|
+
cryptic error messages that result from these dangerous version
|
19
|
+
combinations.
|
20
|
+
|
21
|
+
Rails-futurizer makes the upgrade process quicker and easier by
|
22
|
+
automatically patching some of these bugs and giving clear warnings
|
23
|
+
about the cause of others. See below for a list of all patches and
|
24
|
+
warnings available.
|
25
|
+
|
26
|
+
### What it doesn't do
|
27
|
+
|
28
|
+
It doesn't backport any features or syntax from newer Ruby/Rails
|
29
|
+
versions to older versions. Upgrade your apps; don't keep developing
|
30
|
+
them against old versions.
|
7
31
|
|
8
32
|
### Requirements
|
9
33
|
|
10
34
|
* Ruby 1.8.7 or greater
|
11
35
|
|
12
|
-
* RubyGems
|
36
|
+
* RubyGems 1.1.0 or greater
|
13
37
|
|
14
|
-
* Nothing else
|
38
|
+
* Nothing else. But rails-futurizer won't do anything unless
|
15
39
|
it's installed alongside a version of Rails for which some
|
16
40
|
applicable fixes are available.
|
17
41
|
|
18
|
-
###
|
42
|
+
### Installation
|
19
43
|
|
20
|
-
|
44
|
+
If your app is using Bundler, add the rails-futurizer gem to the
|
45
|
+
Gemfile.
|
21
46
|
|
22
47
|
gem "rails-futurizer"
|
23
48
|
|
24
|
-
|
25
|
-
|
26
|
-
|
49
|
+
Then update your bundle.
|
50
|
+
|
51
|
+
$ bundle
|
52
|
+
|
53
|
+
That's it! Rails-futurizer will automatically activate any fixes and
|
54
|
+
warnings that are applicable to the currently installed versions of
|
55
|
+
Ruby and Rails, and ignore those that are not applicable.
|
56
|
+
|
57
|
+
(If your app is too old to be using Bundler, consider adding Bundler
|
58
|
+
as the first step toward upgrading.)
|
59
|
+
|
60
|
+
### Bugs Patched
|
61
|
+
|
62
|
+
The following bugs will be automatically patched when
|
63
|
+
rails-futurizer is loaded.
|
27
64
|
|
28
|
-
|
65
|
+
* When Rails 2.3 or older is used with Ruby 2.0 or newer, parameter
|
66
|
+
log filtering in ActionController silently fails, causing all
|
67
|
+
parameters to be logged regardless of filter
|
68
|
+
settings. Patched for Rails 2.2.1 or newer.
|
29
69
|
|
30
|
-
* When
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
bug if you're using Rails 2.2.1 or newer.
|
70
|
+
* When Rails 2.2 - 3.0 is used with Ruby 2.0 or newer, saving an
|
71
|
+
ActiveRecord model that has an array assigned to one of its
|
72
|
+
has_many associations will raise the exception "undefined method
|
73
|
+
'insert_record' for Array". Patched for all affected versions.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
if Futurizer.detected? :activerecord => [">= 2.2.0", "< 3.1"], :ruby => ">= 2"
|
2
|
+
Futurizer.require_dependency "active_record"
|
3
|
+
|
4
|
+
module ActiveRecord
|
5
|
+
module Associations
|
6
|
+
class AssociationProxy
|
7
|
+
def send(method, *args)
|
8
|
+
if proxy_respond_to?(method, true)
|
9
|
+
super
|
10
|
+
else
|
11
|
+
load_target
|
12
|
+
@target.send(method, *args)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/futurizer/version.rb
CHANGED
@@ -12,7 +12,13 @@ module Futurizer
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.current_version(resource)
|
15
|
-
resource == :ruby
|
15
|
+
if resource == :ruby
|
16
|
+
SystemInfo.ruby_version
|
17
|
+
elsif resource == :rubygems
|
18
|
+
SystemInfo.rubygems_version
|
19
|
+
else
|
20
|
+
SystemInfo.gem_version resource
|
21
|
+
end
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
data/lib/rails-futurizer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-futurizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Auton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- License.txt
|
64
64
|
- README.md
|
65
65
|
- lib/futurizer/patches/actionpack/filter_parameters.rb
|
66
|
+
- lib/futurizer/patches/activerecord/association_proxy.rb
|
66
67
|
- lib/futurizer/system_info.rb
|
67
68
|
- lib/futurizer/version.rb
|
68
69
|
- lib/futurizer/version_detection.rb
|