File tree 16 files changed +58
-10
lines changed
16 files changed +58
-10
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ inherit_from: .rubocop_todo.yml
3
3
AllCops :
4
4
TargetRubyVersion : 2.2
5
5
Exclude :
6
+ - ' gemfiles/bin/*'
6
7
- ' test/dummy/**/*'
7
8
8
9
Metrics/BlockLength :
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ Bundler/OrderedGems:
18
18
- ' gemfiles/5.0.gemfile'
19
19
- ' gemfiles/5.1.gemfile'
20
20
- ' gemfiles/5.2.gemfile'
21
+ - ' gemfiles/6.0.gemfile'
21
22
- ' gemfiles/rails_edge.gemfile'
22
23
23
24
# Offense count: 2
@@ -140,6 +141,7 @@ Style/HashSyntax:
140
141
- ' gemfiles/5.0.gemfile'
141
142
- ' gemfiles/5.1.gemfile'
142
143
- ' gemfiles/5.2.gemfile'
144
+ - ' gemfiles/6.0.gemfile'
143
145
- ' gemfiles/rails_edge.gemfile'
144
146
145
147
# Offense count: 3
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ matrix:
51
51
before_install :
52
52
- gem update --system
53
53
- gem install bundler
54
+ - rvm : 2.6
55
+ gemfile : gemfiles/6.0.gemfile
56
+ before_install :
57
+ - gem update --system
58
+ - gem install bundler
54
59
- rvm : 2.6
55
60
gemfile : gemfiles/rails_edge.gemfile
56
61
before_install :
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ task :dummy_generate do
42
42
system ( 'touch test/dummy/db/schema.rb' )
43
43
FileUtils . cp 'test/fixtures/database.yml' , 'test/dummy/config/'
44
44
FileUtils . rm_r Dir . glob ( 'test/dummy/test/*' )
45
+
46
+ # rails 6 needs this to be present before start:
47
+ FileUtils . mkdir_p ( 'test/dummy/app/assets/config' )
48
+ FileUtils . mkdir_p ( 'test/dummy/app/assets/javascripts' )
49
+ FileUtils . cp 'test/fixtures/manifest.js' , 'test/dummy/app/assets/config/'
50
+ FileUtils . cp 'test/fixtures/wicked.js' , 'test/dummy/app/assets/javascripts/'
45
51
end
46
52
47
53
desc 'Remove dummy application'
Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ source "https://rubygems.org"
2
2
3
3
gem 'rdoc'
4
4
gem 'rails', '~> 4.0.0'
5
+ gem 'sqlite3', '~> 1.3.6'
5
6
6
7
gemspec path: '../'
Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
3
3
gem 'rdoc'
4
4
gem 'rails', '~> 4.1.0'
5
+ gem 'sqlite3', '~> 1.3.6'
5
6
6
7
gemspec path: '../'
Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
3
3
gem 'rdoc'
4
+ gem 'bundler', '~>1.3'
5
+ gem 'sqlite3', '~> 1.3.6'
6
+ gem 'sprockets', '~>3.0'
4
7
gem 'rails', '~> 4.2.0'
5
8
6
9
gemspec path: '../'
Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
3
3
gem 'rdoc'
4
+ gem 'sqlite3', '~> 1.3.6'
5
+ gem 'sprockets', '~>3.0' # v4 strips newlines from assets causing tests to fail
4
6
gem 'rails', '~> 5.0.0'
5
7
6
8
gemspec path: '../'
Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
3
3
gem 'rdoc'
4
+ gem 'sqlite3', '~> 1.3.6'
5
+ gem 'sprockets', '~>3.0' # v4 strips newlines from assets causing tests to fail
4
6
gem 'rails', '~> 5.1.0'
5
7
6
8
gemspec path: '../'
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
gem 'rdoc'
4
4
gem 'rails', '~> 5.2'
5
5
gem 'sqlite3', '~> 1.3.6'
6
+ gem 'sprockets', '~>3.0' # v4 strips newlines from assets causing tests to fail
6
7
gem 'bootsnap' # required to run `rake test` in Rails 5.2
7
8
gem 'mocha', '= 1.3' # newer versions blow up
8
9
Original file line number Diff line number Diff line change
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'bundler', '~>2'
4
+ gem 'rdoc'
5
+ gem 'rails', '~>6.0.1'
6
+ gem 'sqlite3', '~> 1.4'
7
+ gem 'sprockets', '~>3.0'
8
+ gem 'bootsnap' # required to run `rake test` in Rails 6.0
9
+ gem 'mocha', '= 1.3' # newer versions blow up
10
+
11
+ gemspec path: '../'
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
3
3
gem 'rdoc'
4
4
gem 'rails', git: 'https://github.com/rails/rails.git'
5
- gem 'sqlite3', '~> 1.3.6 '
5
+ gem 'sqlite3', '~> 1.4 '
6
6
gem 'bootsnap' # required to run `rake test` in Rails 6.0
7
7
gem 'mocha', '= 1.3' # newer versions blow up
8
8
Original file line number Diff line number Diff line change @@ -6,13 +6,15 @@ class WickedPdf
6
6
if defined? ( Rails . env )
7
7
class WickedRailtie < Rails ::Railtie
8
8
initializer 'wicked_pdf.register' , :after => 'remotipart.controller_helper' do |_app |
9
- if ActionController ::Base . respond_to? ( :prepend ) &&
10
- Object . method ( :new ) . respond_to? ( :super_method )
11
- ActionController ::Base . send :prepend , PdfHelper
12
- else
13
- ActionController ::Base . send :include , PdfHelper
9
+ ActiveSupport . on_load ( :action_controller ) do
10
+ if ActionController ::Base . respond_to? ( :prepend ) &&
11
+ Object . method ( :new ) . respond_to? ( :super_method )
12
+ ActionController ::Base . send :prepend , PdfHelper
13
+ else
14
+ ActionController ::Base . send :include , PdfHelper
15
+ end
16
+ ActionView ::Base . send :include , WickedPdfHelper ::Assets
14
17
end
15
- ActionView ::Base . send :include , WickedPdfHelper ::Assets
16
18
end
17
19
end
18
20
Original file line number Diff line number Diff line change
1
+ //= link_tree ../images
2
+ //= link wicked.js
3
+ //= link wicked.css
Original file line number Diff line number Diff line change 19
19
File . open ( destination , 'w' ) { |f | f . write ( source ) }
20
20
21
21
# Copy JS file
22
- destination = assets_dir . join ( 'javascripts/wicked.js' )
22
+ js_dir = assets_dir . join ( 'javascripts' )
23
+ Dir . mkdir ( js_dir ) unless File . directory? ( js_dir )
24
+ destination = js_dir . join ( 'wicked.js' )
23
25
source = File . read ( 'test/fixtures/wicked.js' )
24
26
File . open ( destination , 'w' ) { |f | f . write ( source ) }
27
+
28
+ config_dir = assets_dir . join ( 'config' )
29
+ Dir . mkdir ( config_dir ) unless File . directory? ( config_dir )
30
+ source = File . read ( 'test/fixtures/manifest.js' )
31
+ destination = config_dir . join ( 'manifest.js' )
32
+ File . open ( destination , 'w' ) { |f | f . write ( source ) }
25
33
end
Original file line number Diff line number Diff line change 33
33
spec . add_dependency 'activesupport'
34
34
35
35
spec . add_development_dependency 'rails'
36
- spec . add_development_dependency 'bundler' , RUBY_VERSION >= '2.5' ? '~> 2' : '~> 1.3'
36
+ spec . add_development_dependency 'bundler'
37
37
spec . add_development_dependency 'rake'
38
38
spec . add_development_dependency 'rubocop' , '~> 0.68.0'
39
- spec . add_development_dependency 'sqlite3' , '~> 1.3.6 '
39
+ spec . add_development_dependency 'sqlite3' , '~> 1.3'
40
40
spec . add_development_dependency 'mocha' , '= 1.3'
41
41
spec . add_development_dependency 'test-unit'
42
42
end
You can’t perform that action at this time.
0 commit comments