safer_rails_console 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fdba797ed52f07225b6f16b76e99a9dac4731b4b
4
- data.tar.gz: 7ecdb4551bb8c70d3d01d7aa964198cb667ed852
2
+ SHA256:
3
+ metadata.gz: e9f52ef5501b4906fd7f43c3a5dc3a8157dacba7da2d5cd996d1028f8d97f5fe
4
+ data.tar.gz: 5d0e92eef385a29a45fb2f24eeb994bc9b5539d7ba2c01ab067bc2a35777f08f
5
5
  SHA512:
6
- metadata.gz: c792c0b4684d712180eb6a963144faf05a68a28bc9565725b71987f17c8bff788362f839219faf2945952fcb025ac4ee9d76287cd0eff660882617b8c798020d
7
- data.tar.gz: 5cda5a4537478ab21d1cbce6629e081e33864d650a9eb56c932c50c7e673efce188c114f6447c71c67041901d14159f4534f46005938f3b483b8551cbecb7787
6
+ metadata.gz: d7ce0f981844828f22da23738147ca9bd35355feb5ab20971381ae0407bde0b7da3c57c2630f88aa8a382afc6a70f90fcfb818e604671a124255e921c45478ec
7
+ data.tar.gz: 6ad946fb0b38d899890ef70aa5d83f15078f07782eeb56221549d5f40962f88b4db8f5e2e0dee2782c40a29922a1d273de8c722a8f75ba81282608ad275a02d9
@@ -9,29 +9,26 @@ before_install:
9
9
  - gem install bundler
10
10
 
11
11
  before_script:
12
- - cp spec/internal/database.yml.travis spec/internal/rails_4_1/config/database.yml
13
12
  - cp spec/internal/database.yml.travis spec/internal/rails_4_2/config/database.yml
14
13
  - cp spec/internal/database.yml.travis spec/internal/rails_5_0/config/database.yml
15
14
  - cp spec/internal/database.yml.travis spec/internal/rails_5_1/config/database.yml
15
+ - cp spec/internal/database.yml.travis spec/internal/rails_5_2/config/database.yml
16
16
 
17
17
  script:
18
18
  - bundle exec rubocop
19
19
  - bundle exec rspec
20
20
 
21
21
  rvm:
22
- - 2.2.7
23
- - 2.3.4
24
- - 2.4.1
22
+ - 2.2.10
23
+ - 2.3.7
24
+ - 2.4.4
25
+ - 2.5.1
25
26
 
26
27
  gemfile:
27
- - gemfiles/4.1.gemfile
28
28
  - gemfiles/4.2.gemfile
29
29
  - gemfiles/5.0.gemfile
30
30
  - gemfiles/5.1.gemfile
31
+ - gemfiles/5.2.gemfile
31
32
 
32
33
  matrix:
33
- allow_failures:
34
- - gemfile: gemfiles/4.1.gemfile
35
- rvm: 2.4.1
36
-
37
34
  fast_finish: true
data/Appraisals CHANGED
@@ -1,7 +1,3 @@
1
- appraise '4.1' do
2
- gem 'rails', '~> 4.1.0'
3
- end
4
-
5
1
  appraise '4.2' do
6
2
  gem 'rails', '~> 4.2.0'
7
3
  end
@@ -13,3 +9,7 @@ end
13
9
  appraise '5.1' do
14
10
  gem 'rails', '~> 5.1.0'
15
11
  end
12
+
13
+ appraise '5.2' do
14
+ gem 'rails', '~>5.2.0'
15
+ end
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.3.0](https://github.com/salsify/safer_rails_console/tree/v0.3.0) (2018-04-16)
4
+ [Full Changelog](https://github.com/salsify/safer_rails_console/compare/v0.2.0...v0.3.0)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Add support for Rails 5.2; remove support for Rails 4.1 [\#24](https://github.com/salsify/safer_rails_console/pull/24) ([timothysu](https://github.com/timothysu))
9
+
3
10
  ## [v0.2.0](https://github.com/salsify/safer_rails_console/tree/v0.2.0) (2017-09-07)
4
11
  [Full Changelog](https://github.com/salsify/safer_rails_console/compare/v0.1.4...v0.2.0)
5
12
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 4.1.0"
5
+ gem "rails", "~>5.2.0"
6
6
 
7
7
  gemspec path: "../"
@@ -72,16 +72,16 @@ module SaferRailsConsole
72
72
  end
73
73
  end
74
74
 
75
- if SaferRailsConsole::RailsVersion.four_one? || SaferRailsConsole::RailsVersion.four_two?
75
+ if SaferRailsConsole::RailsVersion.four_two?
76
76
  require 'rails/commands/commands_tasks'
77
77
  ::Rails::CommandsTasks.prepend(SaferRailsConsole::Patches::Boot::SandboxFlag::Rails::CommandsTasks4)
78
78
  elsif SaferRailsConsole::RailsVersion.five_zero?
79
79
  require 'rails/commands/commands_tasks'
80
80
  ::Rails::CommandsTasks.prepend(SaferRailsConsole::Patches::Boot::SandboxFlag::Rails::CommandsTasks50)
81
- elsif SaferRailsConsole::RailsVersion.five_one?
81
+ elsif SaferRailsConsole::RailsVersion.five_one? || SaferRailsConsole::RailsVersion.five_two?
82
82
  require 'rails/command'
83
83
  require 'rails/commands/console/console_command'
84
- # Rails 5.1 defaults `sandbox` to `false`, but we need it to NOT have a default value and be `nil` when it is not user-specified
84
+ # Rails 5.1 and 5.2 defaults `sandbox` to `false`, but we need it to NOT have a default value and be `nil` when it is not user-specified
85
85
  ::Rails::Command::ConsoleCommand.class_eval do
86
86
  remove_class_option :sandbox
87
87
  class_option :sandbox, aliases: '-s', type: :boolean, desc: 'Explicitly enable/disable sandbox mode.'
@@ -25,7 +25,7 @@ module SaferRailsConsole
25
25
  end
26
26
 
27
27
  if SaferRailsConsole::RailsVersion.supported?
28
- if SaferRailsConsole::RailsVersion.five_one?
28
+ if SaferRailsConsole::RailsVersion.five_one? || SaferRailsConsole::RailsVersion.five_two?
29
29
  require 'rails/commands/console/console_command'
30
30
  else
31
31
  require 'rails/commands/console'
@@ -22,20 +22,6 @@ module SaferRailsConsole
22
22
 
23
23
  module ActiveRecord
24
24
  module ConnectionAdapters
25
- module PostgreSQLAdapter41
26
- def exec_no_cache(sql, name, binds)
27
- super
28
- rescue => e
29
- SaferRailsConsole::Patches::Sandbox::AutoRollback.handle_and_reraise_exception(e)
30
- end
31
-
32
- def exec_cache(sql, name, binds)
33
- super
34
- rescue => e
35
- SaferRailsConsole::Patches::Sandbox::AutoRollback.handle_and_reraise_exception(e)
36
- end
37
- end
38
-
39
25
  module PostgreSQLAdapter42
40
26
  def execute_and_clear(sql, name, binds)
41
27
  super
@@ -59,9 +45,7 @@ module SaferRailsConsole
59
45
  end
60
46
 
61
47
  if defined?(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
62
- if SaferRailsConsole::RailsVersion.four_one?
63
- ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(SaferRailsConsole::Patches::Sandbox::AutoRollback::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter41)
64
- elsif SaferRailsConsole::RailsVersion.four_two?
48
+ if SaferRailsConsole::RailsVersion.four_two?
65
49
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(SaferRailsConsole::Patches::Sandbox::AutoRollback::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter42)
66
50
  else
67
51
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(SaferRailsConsole::Patches::Sandbox::AutoRollback::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter5)
@@ -6,12 +6,7 @@ module SaferRailsConsole
6
6
 
7
7
  class << self
8
8
  def supported?
9
- four_one? || four_two? || five_zero? || five_one?
10
- end
11
-
12
- def four_one?
13
- @is_four_one = Gem::Requirement.new('~> 4.1.0').satisfied_by?(SaferRailsConsole::RailsVersion::RAILS_VERSION) if @is_four_one.nil?
14
- @is_four_one
9
+ four_two? || five_zero? || five_one? || five_two?
15
10
  end
16
11
 
17
12
  def four_two?
@@ -28,6 +23,11 @@ module SaferRailsConsole
28
23
  @is_five_one = Gem::Requirement.new('~> 5.1.0').satisfied_by?(SaferRailsConsole::RailsVersion::RAILS_VERSION) if @is_five_one.nil?
29
24
  @is_five_one
30
25
  end
26
+
27
+ def five_two?
28
+ @is_five_two = Gem::Requirement.new('~> 5.2.0').satisfied_by?(SaferRailsConsole::RailsVersion::RAILS_VERSION) if @is_five_two.nil?
29
+ @is_five_two
30
+ end
31
31
  end
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module SaferRailsConsole
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
@@ -40,5 +40,5 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'salsify_rubocop', '~> 0.48.0'
41
41
  spec.add_development_dependency 'sqlite3', '~> 1.3'
42
42
  spec.add_development_dependency 'wwtd', '~> 1.3'
43
- spec.add_runtime_dependency 'rails', '>= 4.1', '< 5.2'
43
+ spec.add_runtime_dependency 'rails', '>= 4.2', '< 5.3'
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safer_rails_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salsify, Inc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-07 00:00:00.000000000 Z
11
+ date: 2018-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -156,20 +156,20 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: '4.1'
159
+ version: '4.2'
160
160
  - - "<"
161
161
  - !ruby/object:Gem::Version
162
- version: '5.2'
162
+ version: '5.3'
163
163
  type: :runtime
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: '4.1'
169
+ version: '4.2'
170
170
  - - "<"
171
171
  - !ruby/object:Gem::Version
172
- version: '5.2'
172
+ version: '5.3'
173
173
  description: This gem makes Rails console sessions less dangerous in specified environments
174
174
  by warning, color-coding, auto-sandboxing, and allowing read-only external connections
175
175
  (disables job queueing, non-GET requests, etc.)
@@ -192,10 +192,10 @@ files:
192
192
  - Rakefile
193
193
  - bin/console
194
194
  - bin/setup
195
- - gemfiles/4.1.gemfile
196
195
  - gemfiles/4.2.gemfile
197
196
  - gemfiles/5.0.gemfile
198
197
  - gemfiles/5.1.gemfile
198
+ - gemfiles/5.2.gemfile
199
199
  - lib/safer_rails_console.rb
200
200
  - lib/safer_rails_console/colors.rb
201
201
  - lib/safer_rails_console/console.rb
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
232
  version: '0'
233
233
  requirements: []
234
234
  rubyforge_project:
235
- rubygems_version: 2.6.12
235
+ rubygems_version: 2.7.6
236
236
  signing_key:
237
237
  specification_version: 4
238
238
  summary: Make rails console less dangerous!