rails_refactor 1.3 → 1.4

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.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +1 -0
  3. data/Gemfile +3 -3
  4. data/Gemfile.lock +105 -69
  5. data/Manifest +61 -20
  6. data/bin/rails_refactor.rb +7 -7
  7. data/dummy/Gemfile +42 -25
  8. data/dummy/Gemfile.lock +173 -77
  9. data/dummy/README.rdoc +28 -0
  10. data/dummy/Rakefile +1 -2
  11. data/dummy/app/assets/javascripts/application.js +16 -0
  12. data/dummy/app/assets/stylesheets/application.css +15 -0
  13. data/dummy/app/controllers/application_controller.rb +3 -1
  14. data/dummy/app/controllers/dummies_controller.rb +0 -1
  15. data/dummy/app/views/dummies/index.html.erb +1 -2
  16. data/dummy/app/views/layouts/application.html.erb +3 -3
  17. data/dummy/bin/bundle +3 -0
  18. data/dummy/bin/rails +9 -0
  19. data/dummy/bin/rake +9 -0
  20. data/dummy/bin/setup +29 -0
  21. data/dummy/bin/spring +17 -0
  22. data/dummy/config.ru +2 -2
  23. data/dummy/config/application.rb +4 -20
  24. data/dummy/config/boot.rb +2 -12
  25. data/dummy/config/database.yml +12 -9
  26. data/dummy/config/environment.rb +3 -3
  27. data/dummy/config/environments/development.rb +28 -13
  28. data/dummy/config/environments/production.rb +58 -28
  29. data/dummy/config/environments/test.rb +22 -15
  30. data/dummy/config/initializers/assets.rb +11 -0
  31. data/dummy/config/initializers/cookies_serializer.rb +3 -0
  32. data/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  33. data/dummy/config/initializers/inflections.rb +9 -3
  34. data/dummy/config/initializers/mime_types.rb +0 -1
  35. data/dummy/config/initializers/session_store.rb +1 -6
  36. data/dummy/config/initializers/wrap_parameters.rb +14 -0
  37. data/dummy/config/locales/en.yml +20 -2
  38. data/dummy/config/routes.rb +24 -26
  39. data/dummy/config/secrets.yml +22 -0
  40. data/dummy/db/development.sqlite3 +0 -0
  41. data/dummy/db/migrate/{20101230081247_create_dummy_models.rb → 20170214234158_create_dummy_models.rb} +2 -6
  42. data/dummy/db/schema.rb +21 -0
  43. data/dummy/db/seeds.rb +2 -2
  44. data/dummy/db/test.sqlite3 +0 -0
  45. data/dummy/public/404.html +54 -13
  46. data/dummy/public/422.html +54 -13
  47. data/dummy/public/500.html +53 -13
  48. data/dummy/public/robots.txt +2 -2
  49. data/dummy/spec/controllers/dummies_controller_spec.rb +2 -2
  50. data/dummy/spec/helpers/dummies_helper_spec.rb +3 -3
  51. data/dummy/spec/models/dummy_model_spec.rb +2 -2
  52. data/dummy/test/{functional → controllers}/dummies_controller_test.rb +3 -5
  53. data/dummy/test/test_helper.rb +2 -5
  54. data/dummy/tmp/cache/assets/sprockets/v3.0/0J/0J8Y06zzUR0l-98gVnUiZSMLWIcgvag6JZrSQ-GmMkE.cache +1 -0
  55. data/dummy/tmp/cache/assets/sprockets/v3.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
  56. data/dummy/tmp/cache/assets/sprockets/v3.0/5_/5_pSHecLeN6enAq048bTQIyPEeerwPmymDDBzkkUPh8.cache +3 -0
  57. data/dummy/tmp/cache/assets/sprockets/v3.0/6g/6gIGeJ7YOb0mGXuJl0wUP4DKR_t_JayqkocSgkH1juA.cache +3 -0
  58. data/dummy/tmp/cache/assets/sprockets/v3.0/7R/7Ro3YPQDojP1-t-d3Z7XH5fud5RudfD-VykLAH2ryrI.cache +1 -0
  59. data/dummy/tmp/cache/assets/sprockets/v3.0/AP/APY89OAPJx9A3D3xcCoktvEvQUs7NcWChYXnjjjPzz0.cache +2 -0
  60. data/dummy/tmp/cache/assets/sprockets/v3.0/B1/B1GAmsRS-7nrUGTtmGdBxR-f9gl5kBZFy8p3kxTwSTs.cache +0 -0
  61. data/dummy/tmp/cache/assets/sprockets/v3.0/DS/DSOLSc6A5RVSmvM415eEWAWG_AgOvZcLZOXQjsXyWQA.cache +2 -0
  62. data/dummy/tmp/cache/assets/sprockets/v3.0/EB/EBtbhweQl74JQNkwFL3ahZH_9x44ceqa9hOT8lQ_SfM.cache +2 -0
  63. data/dummy/tmp/cache/assets/sprockets/v3.0/EQ/EQMU7OcCaRj7JaYia8OeWraimRFV08I3NajpxItPr_w.cache +0 -0
  64. data/dummy/tmp/cache/assets/sprockets/v3.0/Ei/Eiaf8C3zv64tXNf5ivlq4Xt_e2Y7Qogp6h6u_m4wrf4.cache +3 -0
  65. data/dummy/tmp/cache/assets/sprockets/v3.0/F0/F0RI4bpYPGBeSWP4Z-xOqkBXUDDtYfPU5kjPmlh_vTA.cache +1 -0
  66. data/dummy/tmp/cache/assets/sprockets/v3.0/Fn/FnLIvSU0P0Rr-3KeF2pL7CxFqJ4KOhpvlvlng0Q7scA.cache +1 -0
  67. data/dummy/tmp/cache/assets/sprockets/v3.0/If/If2pWtLkR3jpGhpRfDHDv6Ualti_bgfhSuuBXfpEETU.cache +1 -0
  68. data/dummy/tmp/cache/assets/sprockets/v3.0/J3/J3DjyBJAVYBXic6ylywPlr9zf2GJoNPO4vlBarB0tYE.cache +1 -0
  69. data/dummy/tmp/cache/assets/sprockets/v3.0/JV/JVm8t7ehDHucqDbG2dnfRUSvxgaWqFAtRuaH5MRIFfQ.cache +1 -0
  70. data/dummy/tmp/cache/assets/sprockets/v3.0/NO/NO-TZrEcLyQuB-5piSqbSbplmk8woO8-MItXY1xhQ1o.cache +1 -0
  71. data/dummy/tmp/cache/assets/sprockets/v3.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +2 -0
  72. data/dummy/tmp/cache/assets/sprockets/v3.0/Ob/ObPHFplxs2zahTFNBoOE3MyzhbEa02fTq6kHwrF_99k.cache +0 -0
  73. data/dummy/tmp/cache/assets/sprockets/v3.0/P-/P-XWFt9GTflkbs5BRhEjQR24IST4x2rHkKKFWEpkzlQ.cache +0 -0
  74. data/dummy/tmp/cache/assets/sprockets/v3.0/P-/P-oAGmeqPPkPtepd3yRW1xcBAyZ9PQCknUSTP_1fTrQ.cache +1 -0
  75. data/dummy/tmp/cache/assets/sprockets/v3.0/UM/UM_H6cyEQXE2u2lO-7guFFdIyuBjYw5RW21t4QuycQA.cache +1 -0
  76. data/dummy/tmp/cache/assets/sprockets/v3.0/Uw/UwU65qhibWAQvgqfEfTBcPEM0bLevORl9_crJGs9V8Q.cache +2 -0
  77. data/dummy/tmp/cache/assets/sprockets/v3.0/Wc/Wcbt_SUiw7SB3-AFGrGfobJl1pJ2v7hh6d-EHtIDyjw.cache +1 -0
  78. data/dummy/tmp/cache/assets/sprockets/v3.0/YI/YI7HlLnxIPnVWHFYzsD15uJqjPns27jfpxmBzrGXxgg.cache +1 -0
  79. data/dummy/tmp/cache/assets/sprockets/v3.0/dc/dck2gjYqgYSFSeqIOUXeSgSL3egPgMN2G3DLwJasyB8.cache +1 -0
  80. data/dummy/tmp/cache/assets/sprockets/v3.0/ee/ee1zuHshHLX_IASgBziKkg4IG8hJbCkDVmtfRAHAsNU.cache +1 -0
  81. data/dummy/tmp/cache/assets/sprockets/v3.0/f3/f3o9-VEcurfcZdAMlf8m6cdb1opLEn0eccuxSGKbKiE.cache +1 -0
  82. data/dummy/tmp/cache/assets/sprockets/v3.0/fA/fAE09zGXw4wj48ZxewRL1pMf7NkgZC7cKMZuVWl5sMI.cache +0 -0
  83. data/dummy/tmp/cache/assets/sprockets/v3.0/fF/fF_7i0aX5AmlsztdZHN_NUINWYFOJy1w-ZP8LtWLpTU.cache +1 -0
  84. data/dummy/tmp/cache/assets/sprockets/v3.0/fi/fiz6eKj5NRr_-GdbbbAjV6KkXc_Z1IRsnmf5Mh1qXSs.cache +0 -0
  85. data/dummy/tmp/cache/assets/sprockets/v3.0/hW/hWIGlqeCSpLpGwWWM2JfMoV_54nmyCWCrsmaoy69rK8.cache +0 -0
  86. data/dummy/tmp/cache/assets/sprockets/v3.0/jf/jfwq8sz6kKFZaz8rPixf5j_e1hZo7_q2QVsfLDzDLNc.cache +0 -0
  87. data/dummy/tmp/cache/assets/sprockets/v3.0/jj/jjUB1ir1Vdt5WLpR9DWUSfHdRTL_Fsfq3nTAf7fJkYg.cache +0 -0
  88. data/dummy/tmp/cache/assets/sprockets/v3.0/kS/kSkCWaAJCcTgZ_AhrRCjZhNtkE12cubiq70uNtditqk.cache +2 -0
  89. data/dummy/tmp/cache/assets/sprockets/v3.0/lp/lp9jvq-ApxVb7qJI6YEaanVXs5zA1rivibtabrOo-D4.cache +0 -0
  90. data/dummy/tmp/cache/assets/sprockets/v3.0/me/meI7L0bxT8qSUwyhKKtPL2OQLGljXQzVkmOSsHwujxI.cache +1 -0
  91. data/dummy/tmp/cache/assets/sprockets/v3.0/wJ/wJC8Mf7f7BE92W-e0i-JuoqCScHOc4XstbsSr49xX5I.cache +1 -0
  92. data/dummy/tmp/cache/assets/sprockets/v3.0/xE/xEWmch8fg9JmWdSpRS-FmtBQvGStIC5iK-luzXf_yiw.cache +1 -0
  93. data/dummy/tmp/cache/assets/sprockets/v3.0/xS/xSlHR2-kW_8ofNDd-wHO3YbK8NBn-Rq--Wkk6SwFQcc.cache +1 -0
  94. data/rails_refactor.gemspec +7 -15
  95. metadata +69 -32
  96. data/dummy/README +0 -256
  97. data/dummy/autotest/discover.rb +0 -2
  98. data/dummy/config/initializers/secret_token.rb +0 -7
  99. data/dummy/doc/README_FOR_APP +0 -2
  100. data/dummy/public/images/rails.png +0 -0
  101. data/dummy/public/index.html +0 -239
  102. data/dummy/public/javascripts/application.js +0 -2
  103. data/dummy/public/javascripts/controls.js +0 -965
  104. data/dummy/public/javascripts/dragdrop.js +0 -974
  105. data/dummy/public/javascripts/effects.js +0 -1123
  106. data/dummy/public/javascripts/prototype.js +0 -6001
  107. data/dummy/public/javascripts/rails.js +0 -175
  108. data/dummy/script/rails +0 -6
  109. data/dummy/spec/spec_helper.rb +0 -27
  110. data/dummy/test/performance/browsing_test.rb +0 -9
  111. data/dummy/test/unit/helpers/dummies_helper_test.rb +0 -4
@@ -1,175 +0,0 @@
1
- (function() {
2
- // Technique from Juriy Zaytsev
3
- // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
4
- function isEventSupported(eventName) {
5
- var el = document.createElement('div');
6
- eventName = 'on' + eventName;
7
- var isSupported = (eventName in el);
8
- if (!isSupported) {
9
- el.setAttribute(eventName, 'return;');
10
- isSupported = typeof el[eventName] == 'function';
11
- }
12
- el = null;
13
- return isSupported;
14
- }
15
-
16
- function isForm(element) {
17
- return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
18
- }
19
-
20
- function isInput(element) {
21
- if (Object.isElement(element)) {
22
- var name = element.nodeName.toUpperCase()
23
- return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
24
- }
25
- else return false
26
- }
27
-
28
- var submitBubbles = isEventSupported('submit'),
29
- changeBubbles = isEventSupported('change')
30
-
31
- if (!submitBubbles || !changeBubbles) {
32
- // augment the Event.Handler class to observe custom events when needed
33
- Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
34
- function(init, element, eventName, selector, callback) {
35
- init(element, eventName, selector, callback)
36
- // is the handler being attached to an element that doesn't support this event?
37
- if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
38
- (!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
39
- // "submit" => "emulated:submit"
40
- this.eventName = 'emulated:' + this.eventName
41
- }
42
- }
43
- )
44
- }
45
-
46
- if (!submitBubbles) {
47
- // discover forms on the page by observing focus events which always bubble
48
- document.on('focusin', 'form', function(focusEvent, form) {
49
- // special handler for the real "submit" event (one-time operation)
50
- if (!form.retrieve('emulated:submit')) {
51
- form.on('submit', function(submitEvent) {
52
- var emulated = form.fire('emulated:submit', submitEvent, true)
53
- // if custom event received preventDefault, cancel the real one too
54
- if (emulated.returnValue === false) submitEvent.preventDefault()
55
- })
56
- form.store('emulated:submit', true)
57
- }
58
- })
59
- }
60
-
61
- if (!changeBubbles) {
62
- // discover form inputs on the page
63
- document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
64
- // special handler for real "change" events
65
- if (!input.retrieve('emulated:change')) {
66
- input.on('change', function(changeEvent) {
67
- input.fire('emulated:change', changeEvent, true)
68
- })
69
- input.store('emulated:change', true)
70
- }
71
- })
72
- }
73
-
74
- function handleRemote(element) {
75
- var method, url, params;
76
-
77
- var event = element.fire("ajax:before");
78
- if (event.stopped) return false;
79
-
80
- if (element.tagName.toLowerCase() === 'form') {
81
- method = element.readAttribute('method') || 'post';
82
- url = element.readAttribute('action');
83
- params = element.serialize();
84
- } else {
85
- method = element.readAttribute('data-method') || 'get';
86
- url = element.readAttribute('href');
87
- params = {};
88
- }
89
-
90
- new Ajax.Request(url, {
91
- method: method,
92
- parameters: params,
93
- evalScripts: true,
94
-
95
- onComplete: function(request) { element.fire("ajax:complete", request); },
96
- onSuccess: function(request) { element.fire("ajax:success", request); },
97
- onFailure: function(request) { element.fire("ajax:failure", request); }
98
- });
99
-
100
- element.fire("ajax:after");
101
- }
102
-
103
- function handleMethod(element) {
104
- var method = element.readAttribute('data-method'),
105
- url = element.readAttribute('href'),
106
- csrf_param = $$('meta[name=csrf-param]')[0],
107
- csrf_token = $$('meta[name=csrf-token]')[0];
108
-
109
- var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
110
- element.parentNode.insert(form);
111
-
112
- if (method !== 'post') {
113
- var field = new Element('input', { type: 'hidden', name: '_method', value: method });
114
- form.insert(field);
115
- }
116
-
117
- if (csrf_param) {
118
- var param = csrf_param.readAttribute('content'),
119
- token = csrf_token.readAttribute('content'),
120
- field = new Element('input', { type: 'hidden', name: param, value: token });
121
- form.insert(field);
122
- }
123
-
124
- form.submit();
125
- }
126
-
127
-
128
- document.on("click", "*[data-confirm]", function(event, element) {
129
- var message = element.readAttribute('data-confirm');
130
- if (!confirm(message)) event.stop();
131
- });
132
-
133
- document.on("click", "a[data-remote]", function(event, element) {
134
- if (event.stopped) return;
135
- handleRemote(element);
136
- event.stop();
137
- });
138
-
139
- document.on("click", "a[data-method]", function(event, element) {
140
- if (event.stopped) return;
141
- handleMethod(element);
142
- event.stop();
143
- });
144
-
145
- document.on("submit", function(event) {
146
- var element = event.findElement(),
147
- message = element.readAttribute('data-confirm');
148
- if (message && !confirm(message)) {
149
- event.stop();
150
- return false;
151
- }
152
-
153
- var inputs = element.select("input[type=submit][data-disable-with]");
154
- inputs.each(function(input) {
155
- input.disabled = true;
156
- input.writeAttribute('data-original-value', input.value);
157
- input.value = input.readAttribute('data-disable-with');
158
- });
159
-
160
- var element = event.findElement("form[data-remote]");
161
- if (element) {
162
- handleRemote(element);
163
- event.stop();
164
- }
165
- });
166
-
167
- document.on("ajax:after", "form", function(event, element) {
168
- var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
169
- inputs.each(function(input) {
170
- input.value = input.readAttribute('data-original-value');
171
- input.removeAttribute('data-original-value');
172
- input.disabled = false;
173
- });
174
- });
175
- })();
data/dummy/script/rails DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,27 +0,0 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV["RAILS_ENV"] ||= 'test'
3
- require File.expand_path("../../config/environment", __FILE__)
4
- require 'rspec/rails'
5
-
6
- # Requires supporting ruby files with custom matchers and macros, etc,
7
- # in spec/support/ and its subdirectories.
8
- Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
9
-
10
- RSpec.configure do |config|
11
- # == Mock Framework
12
- #
13
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
14
- #
15
- # config.mock_with :mocha
16
- # config.mock_with :flexmock
17
- # config.mock_with :rr
18
- config.mock_with :rspec
19
-
20
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
21
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
22
-
23
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
24
- # examples within a transaction, remove the following line or assign false
25
- # instead of true.
26
- config.use_transactional_fixtures = true
27
- end
@@ -1,9 +0,0 @@
1
- require 'test_helper'
2
- require 'rails/performance_test_help'
3
-
4
- # Profiling results for each test method are written to tmp/performance.
5
- class BrowsingTest < ActionDispatch::PerformanceTest
6
- def test_homepage
7
- get '/'
8
- end
9
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class DummiesHelperTest < ActionView::TestCase
4
- end