ridgepole 0.8.5 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +62 -0
  3. data/.rubocop.yml +38 -4
  4. data/README.md +14 -2
  5. data/bin/ridgepole +4 -2
  6. data/lib/ridgepole/cli/config.rb +5 -3
  7. data/lib/ridgepole/delta.rb +29 -22
  8. data/lib/ridgepole/diff.rb +12 -0
  9. data/lib/ridgepole/dsl_parser.rb +2 -4
  10. data/lib/ridgepole/dsl_parser/context.rb +5 -2
  11. data/lib/ridgepole/external_sql_executer.rb +1 -1
  12. data/lib/ridgepole/version.rb +1 -1
  13. data/spec/dsl_parser/context_spec.rb +16 -0
  14. data/spec/fixtures/for_require_relative_spec.rb +3 -0
  15. data/spec/mysql/cli/config_spec.rb +54 -1
  16. data/spec/mysql/cli/ridgepole_spec.rb +1 -0
  17. data/spec/mysql/collation/collation_spec.rb +6 -0
  18. data/spec/mysql/diff/diff2_spec.rb +3 -3
  19. data/spec/mysql/diff/diff_spec.rb +3 -3
  20. data/spec/mysql/fk/migrate_create_fk_spec.rb +26 -10
  21. data/spec/mysql/fk/migrate_drop_fk_spec.rb +1 -1
  22. data/spec/mysql/fk/migrate_fk_with_column_spec.rb +2 -2
  23. data/spec/mysql/migrate/migrate_add_column_spec.rb +5 -5
  24. data/spec/mysql/migrate/migrate_change_column_spec.rb +5 -5
  25. data/spec/mysql/migrate/migrate_change_index_spec.rb +9 -9
  26. data/spec/mysql/migrate/migrate_create_index_spec.rb +6 -6
  27. data/spec/mysql/migrate/migrate_create_table_with_index_spec.rb +7 -7
  28. data/spec/mysql/migrate/migrate_create_table_with_options_spec.rb +8 -8
  29. data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +4 -4
  30. data/spec/mysql/migrate/migrate_drop_column_spec.rb +3 -3
  31. data/spec/mysql/migrate/migrate_drop_index_spec.rb +6 -6
  32. data/spec/mysql/migrate/migrate_rename_column_spec.rb +3 -3
  33. data/spec/mysql/migrate/migrate_script_error_spec.rb +1 -1
  34. data/spec/mysql/text_blob_types/text_blob_types_spec.rb +4 -1
  35. data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +1 -1
  36. data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +1 -1
  37. data/spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb +7 -7
  38. data/spec/postgresql/diff/diff_spec.rb +2 -2
  39. data/spec/postgresql/fk/migrate_create_fk_spec.rb +2 -2
  40. data/spec/postgresql/fk/migrate_drop_fk_spec.rb +1 -1
  41. data/spec/postgresql/migrate/migrate_add_column_spec.rb +5 -5
  42. data/spec/postgresql/migrate/migrate_change_column_spec.rb +4 -4
  43. data/spec/postgresql/migrate/migrate_change_index_spec.rb +9 -9
  44. data/spec/postgresql/migrate/migrate_drop_column_spec.rb +3 -3
  45. data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +5 -5
  46. data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +1 -1
  47. data/spec/postgresql/migrate/migrate_drop_index_spec.rb +6 -6
  48. data/spec/postgresql/migrate/migrate_rename_column_spec.rb +2 -2
  49. data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +1 -1
  50. data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +1 -1
  51. data/spec/spec_condition.rb +0 -4
  52. metadata +7 -3
  53. data/.travis.yml +0 -47
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b49db08934182bd164f7910335dd04f3843e2e88c8593ab1d89f9bb4d0005d8
4
- data.tar.gz: ff49a0ada6cac848407838596d23d93d75714079c0e95528015c4fcb9b2e4f56
3
+ metadata.gz: 6f850327d50c5d732987209c8c8eb5c9db3090e1b638f2ee9dbc8ced0959b128
4
+ data.tar.gz: 242e925ebc5c1a94d0c68e605e894a55efab238f1184b67d1a6a56f4aee51078
5
5
  SHA512:
6
- metadata.gz: dc24b664af9f8dad9f6c6d21b6eeaa083ad915c42b63b58ce0b7b50386e11c3462b2f30f9819c80f03e5c2a682dadd5a980a355993e8c4e2c8f4a0dc06703242
7
- data.tar.gz: c40af5068b9ccbc226d9375b8b7501584a161bdc81554d6612e2c1135346f9dcdbe4a1371657e23bc6d9f70df795e67c8addc6a8b5db538ce658e3588ad3867c
6
+ metadata.gz: 0451a8c71155ff9fd991045e04973cdf063c405dc1013c63883db20ce11bad93ce4f7cdd0533d5ae12f4a9c35bbf03e18e04a6487ad217baf614a090837095d4
7
+ data.tar.gz: f4bb253e35a0f7904a0b17effd29a5e388449d4a295282f9f1652f1dd11f6d8a9c1df8dbd176efcf884cda5e15e15bf80db61b69bfd7f702ee43de2e0b70a186
@@ -0,0 +1,62 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby:
14
+ - 2.4
15
+ - 2.5
16
+ - 2.6
17
+ - 2.7
18
+ env:
19
+ - MYSQL56=1
20
+ - MYSQL57=1
21
+ - POSTGRESQL=1
22
+ gemfile:
23
+ - gemfiles/activerecord_5.0.gemfile
24
+ - gemfiles/activerecord_5.1.gemfile
25
+ - gemfiles/activerecord_5.2.gemfile
26
+ - gemfiles/activerecord_6.0.gemfile
27
+ exclude:
28
+ - ruby: 2.4
29
+ gemfile: gemfiles/activerecord_6.0.gemfile
30
+
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ - uses: actions/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby }}
36
+ - uses: actions/cache@v2
37
+ with:
38
+ path: gemfiles/vendor/bundle
39
+ key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles('ridgepole.gemspec', '**/Gemfile', '${{ matrix.gemfile }}') }}
40
+ restore-keys: |
41
+ ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-
42
+
43
+ - name: Setup dependencies
44
+ run: |
45
+ for i in {1..60}; do docker-compose up -d && break; sleep 1; done
46
+
47
+ bundle config path vendor/bundle
48
+ bundle install --jobs 4 --retry 3
49
+
50
+ # Wait until database servers start
51
+ function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P 13316 -ppassword ping; }
52
+ function mysql57_ping { mysqladmin -u root -h 127.0.0.1 -P 13317 -ppassword ping; }
53
+ function pg_ping { PGPASSWORD=password pg_isready -U postgres -h 127.0.0.1 -p 15442; }
54
+ for i in {1..60}; do mysql_ping && break; sleep 1; done
55
+ for i in {1..60}; do mysql57_ping && break; sleep 1; done
56
+ for i in {1..60}; do pg_ping && break; sleep 1; done
57
+ env:
58
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
59
+
60
+ - run: ${{ matrix.env }} bundle exec rake
61
+ env:
62
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
@@ -6,7 +6,7 @@ AllCops:
6
6
  Bundler/OrderedGems:
7
7
  Include:
8
8
  - 'Appraisals'
9
- Layout/IndentHeredoc:
9
+ Layout/HeredocIndentation:
10
10
  Enabled: false
11
11
  Metrics/AbcSize:
12
12
  Enabled: false
@@ -18,7 +18,7 @@ Metrics/ClassLength:
18
18
  Enabled: false
19
19
  Metrics/CyclomaticComplexity:
20
20
  Enabled: false
21
- Metrics/LineLength:
21
+ Layout/LineLength:
22
22
  Enabled: false
23
23
  Metrics/MethodLength:
24
24
  Enabled: false
@@ -30,8 +30,6 @@ Style/Documentation:
30
30
  Enabled: false
31
31
  Style/GuardClause:
32
32
  Enabled: false
33
- Style/MethodMissingSuper:
34
- Enabled: false
35
33
  Style/MixinUsage:
36
34
  Exclude:
37
35
  - 'spec/**/*'
@@ -41,3 +39,39 @@ Layout/ClosingHeredocIndentation:
41
39
  Enabled: false
42
40
  Style/NumericPredicate:
43
41
  Enabled: false
42
+ Layout/EmptyLinesAroundAttributeAccessor:
43
+ Enabled: true
44
+ Layout/SpaceAroundMethodCallOperator:
45
+ Enabled: true
46
+ Lint/DeprecatedOpenSSLConstant:
47
+ Enabled: true
48
+ Lint/MissingSuper:
49
+ Enabled: false
50
+ Lint/MixedRegexpCaptureTypes:
51
+ Enabled: true
52
+ Lint/RaiseException:
53
+ Enabled: true
54
+ Lint/StructNewOverride:
55
+ Enabled: true
56
+ Style/AccessorGrouping:
57
+ Enabled: true
58
+ Style/BisectedAttrAccessor:
59
+ Enabled: true
60
+ Style/ExponentialNotation:
61
+ Enabled: true
62
+ Style/HashEachMethods:
63
+ Enabled: true
64
+ Style/HashTransformKeys:
65
+ Enabled: true
66
+ Style/HashTransformValues:
67
+ Enabled: true
68
+ Style/RedundantAssignment:
69
+ Enabled: true
70
+ Style/RedundantFetchBlock:
71
+ Enabled: true
72
+ Style/RedundantRegexpCharacterClass:
73
+ Enabled: true
74
+ Style/RedundantRegexpEscape:
75
+ Enabled: true
76
+ Style/SlicingWithRange:
77
+ Enabled: true
data/README.md CHANGED
@@ -6,7 +6,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
6
6
  (like Chef/Puppet)
7
7
 
8
8
  [![Gem Version](https://badge.fury.io/rb/ridgepole.svg)](http://badge.fury.io/rb/ridgepole)
9
- [![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.8)](https://travis-ci.org/winebarrel/ridgepole)
9
+ [![Build Status](https://github.com/winebarrel/ridgepole/workflows/test/badge.svg?branch=0.8)](https://github.com/winebarrel/ridgepole/actions)
10
10
  [![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.8)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.8)
11
11
 
12
12
  <details><summary>ChangeLog</summary>
@@ -111,6 +111,17 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
111
111
  * Display a warning if an InnoDB table doesn't have any indexes on a column where it has a foreign key ([pull#290](https://github.com/winebarrel/ridgepole/pull/290))
112
112
  * `>= 0.8.5`
113
113
  * Improve warning message on table options ([pull#291](https://github.com/winebarrel/ridgepole/pull/291))
114
+ * `>= 0.8.6`
115
+ * Support multiple databases feature ([pull#297](https://github.com/winebarrel/ridgepole/pull/297))
116
+ * `>= 0.8.7`
117
+ * Support `require_relative` ([pull#298](https://github.com/winebarrel/ridgepole/pull/298))
118
+ * `>= 0.8.8`
119
+ * Fix keyword arguments warnings in Ruby 2.7 ([pull#303](https://github.com/winebarrel/ridgepole/pull/303))
120
+ * `>= 0.8.9`
121
+ * Fix unexpected differences on text types and blob types on Rails 6 ([pull#306](https://github.com/winebarrel/ridgepole/pull/306))
122
+ * Fix unexpected warning when a foreign key is added on the primary key ([pull#307](https://github.com/winebarrel/ridgepole/pull/307))
123
+ * `>= 0.8.10`
124
+ * Raise an error if an InnoDB column has a foreign key but no index ([pull#310](https://github.com/winebarrel/ridgepole/pull/310))
114
125
  </details>
115
126
 
116
127
  ## Installation
@@ -152,6 +163,7 @@ sudo /opt/ridgepole/embedded/bin/gem install mysql2
152
163
  Usage: ridgepole [options]
153
164
  -c, --config CONF_OR_FILE
154
165
  -E, --env ENVIRONMENT
166
+ -s, --spec-name SPEC_NAME
155
167
  -a, --apply
156
168
  -m, --merge
157
169
  -f, --file SCHEMAFILE
@@ -188,6 +200,7 @@ Usage: ridgepole [options]
188
200
  --ignore-table-comment
189
201
  --skip-column-comment-change
190
202
  --create-table-with-index
203
+ --allow-pk-change
191
204
  --mysql-dump-auto-increment
192
205
  -r, --require LIBS
193
206
  --log-file LOG_FILE
@@ -304,7 +317,6 @@ end
304
317
  ```
305
318
 
306
319
  ## Collation/Charset
307
- You can use the column collation by passing `--enable-mysql-awesome` ([activerecord-mysql-awesome](https://github.com/kamipo/activerecord-mysql-awesome) is required)
308
320
 
309
321
  ```ruby
310
322
  create_table "articles", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
@@ -38,6 +38,7 @@ split = false
38
38
  diff_files = nil
39
39
  diff_with_apply = false
40
40
  exit_code = 0
41
+ spec_name = ''
41
42
 
42
43
  options = {
43
44
  dry_run: false,
@@ -76,6 +77,7 @@ ARGV.options do |opt|
76
77
  begin
77
78
  opt.on('-c', '--config CONF_OR_FILE') { |v| config = v }
78
79
  opt.on('-E', '--env ENVIRONMENT') { |v| env = v }
80
+ opt.on('-s', '--spec-name SPEC_NAME') { |v| spec_name = v }
79
81
  opt.on('-a', '--apply') { set_mode[:apply] }
80
82
  opt.on('-m', '--merge') do
81
83
  set_mode[:apply]
@@ -168,7 +170,7 @@ begin
168
170
  logger = Ridgepole::Logger.instance
169
171
  logger.debug = options[:debug]
170
172
 
171
- client = Ridgepole::Client.new(Ridgepole::Config.load(config, env), options) if config
173
+ client = Ridgepole::Client.new(Ridgepole::Config.load(config, env, spec_name), options) if config
172
174
 
173
175
  ActiveRecord::Base.logger = logger
174
176
  ActiveSupport::LogSubscriber.colorize_logging = options[:color]
@@ -247,7 +249,7 @@ begin
247
249
  file_ext = File.extname(diff_file)
248
250
 
249
251
  if %w[.yml .yaml].include?(file_ext)
250
- Ridgepole::Config.load(diff_file, env)
252
+ Ridgepole::Config.load(diff_file, env, spec_name)
251
253
  else
252
254
  File.open(diff_file)
253
255
  end
@@ -6,7 +6,7 @@ require 'yaml'
6
6
  module Ridgepole
7
7
  class Config
8
8
  class << self
9
- def load(config, env = 'development')
9
+ def load(config, env = 'development', spec_name = '')
10
10
  config = ENV.fetch(Regexp.last_match(1)) if config =~ /\Aenv:(.+)\z/
11
11
 
12
12
  parsed_config = if File.exist?(config)
@@ -26,8 +26,10 @@ module Ridgepole
26
26
 
27
27
  parsed_config = parse_database_url(config) unless parsed_config.is_a?(Hash)
28
28
 
29
- if parsed_config.key?(env.to_s)
30
- parsed_config.fetch(env.to_s)
29
+ parsed_config = parsed_config.fetch(env.to_s) if parsed_config.key?(env.to_s)
30
+
31
+ if parsed_config.key?(spec_name.to_s)
32
+ parsed_config.fetch(spec_name.to_s)
31
33
  else
32
34
  parsed_config
33
35
  end
@@ -246,7 +246,7 @@ create_table(#{table_name.inspect}, #{inspect_options_include_default_proc(optio
246
246
  end
247
247
 
248
248
  buf.puts(<<-RUBY)
249
- end
249
+ end
250
250
  RUBY
251
251
 
252
252
  if !(@options[:create_table_with_index]) && !indices.empty?
@@ -326,7 +326,7 @@ execute "ALTER TABLE #{ActiveRecord::Base.connection.quote_table_name(table_name
326
326
  end
327
327
 
328
328
  def append_change_table(table_name, buf)
329
- buf.puts "change_table(#{table_name.inspect}, {:bulk => true}) do |t|" if @options[:bulk_change]
329
+ buf.puts "change_table(#{table_name.inspect}, bulk: true) do |t|" if @options[:bulk_change]
330
330
  yield
331
331
  buf.puts 'end' if @options[:bulk_change]
332
332
  end
@@ -429,11 +429,11 @@ remove_column(#{table_name.inspect}, #{column_name.inspect})
429
429
 
430
430
  if force_bulk_change || @options[:bulk_change]
431
431
  buf.puts(<<-RUBY)
432
- t.index(#{column_name.inspect}, #{options.inspect})
432
+ t.index(#{column_name.inspect}, **#{options.inspect})
433
433
  RUBY
434
434
  else
435
435
  buf.puts(<<-RUBY)
436
- add_index(#{table_name.inspect}, #{column_name.inspect}, #{options.inspect})
436
+ add_index(#{table_name.inspect}, #{column_name.inspect}, **#{options.inspect})
437
437
  RUBY
438
438
  end
439
439
  end
@@ -441,15 +441,20 @@ add_index(#{table_name.inspect}, #{column_name.inspect}, #{options.inspect})
441
441
  def append_remove_index(table_name, _index_name, attrs, buf)
442
442
  column_name = attrs.fetch(:column_name)
443
443
  options = attrs[:options] || {}
444
- target = options[:name] ? { name: options[:name] } : column_name
444
+ target =
445
+ if options[:name]
446
+ "name: #{options[:name].inspect}"
447
+ else
448
+ column_name.inspect
449
+ end
445
450
 
446
451
  if @options[:bulk_change]
447
452
  buf.puts(<<-RUBY)
448
- t.remove_index(#{target.inspect})
453
+ t.remove_index(#{target})
449
454
  RUBY
450
455
  else
451
456
  buf.puts(<<-RUBY)
452
- remove_index(#{table_name.inspect}, #{target.inspect})
457
+ remove_index(#{table_name.inspect}, #{target})
453
458
  RUBY
454
459
  end
455
460
  end
@@ -469,7 +474,7 @@ remove_index(#{table_name.inspect}, #{target.inspect})
469
474
  attrs_options = attrs[:options] || {}
470
475
 
471
476
  buf.puts(<<-RUBY)
472
- add_foreign_key(#{table_name.inspect}, #{to_table.inspect}, #{attrs_options.inspect})
477
+ add_foreign_key(#{table_name.inspect}, #{to_table.inspect}, **#{attrs_options.inspect})
473
478
  RUBY
474
479
  end
475
480
 
@@ -478,13 +483,13 @@ add_foreign_key(#{table_name.inspect}, #{to_table.inspect}, #{attrs_options.insp
478
483
  fk_name = attrs_options[:name]
479
484
 
480
485
  target = if fk_name
481
- { name: fk_name }
486
+ "name: #{fk_name.inspect}"
482
487
  else
483
- attrs.fetch(:to_table)
488
+ attrs.fetch(:to_table).inspect
484
489
  end
485
490
 
486
491
  buf.puts(<<-RUBY)
487
- remove_foreign_key(#{table_name.inspect}, #{target.inspect})
492
+ remove_foreign_key(#{table_name.inspect}, #{target})
488
493
  RUBY
489
494
  end
490
495
 
@@ -500,17 +505,19 @@ remove_foreign_key(#{table_name.inspect}, #{target.inspect})
500
505
  def inspect_options_include_default_proc(options)
501
506
  options = options.dup
502
507
 
503
- if options[:default].is_a?(Proc)
504
- proc_default = options.delete(:default)
505
- proc_default = ":default=>proc{#{proc_default.call.inspect}}"
506
- options_inspect = options.inspect
507
- options_inspect.sub!(/\}\z/, '')
508
- options_inspect << ', ' if options_inspect !~ /\{\z/
509
- options_inspect << proc_default << '}'
510
- options_inspect
511
- else
512
- options.inspect
513
- end
508
+ kwargs =
509
+ if options[:default].is_a?(Proc)
510
+ proc_default = options.delete(:default)
511
+ proc_default = ":default=>proc{#{proc_default.call.inspect}}"
512
+ options_inspect = options.inspect
513
+ options_inspect.sub!(/\}\z/, '')
514
+ options_inspect << ', ' if options_inspect !~ /\{\z/
515
+ options_inspect << proc_default << '}'
516
+ options_inspect
517
+ else
518
+ options.inspect
519
+ end
520
+ "**#{kwargs}"
514
521
  end
515
522
  end
516
523
  end
@@ -386,6 +386,18 @@ module Ridgepole
386
386
  attrs[:type] = :bigint
387
387
  opts.delete(:limit)
388
388
  end
389
+
390
+ if opts[:size] && (attrs[:type] == :text || attrs[:type] == :blob || attrs[:type] == :binary)
391
+ case opts.delete(:size)
392
+ when :tiny
393
+ attrs[:type] = :blob if attrs[:type] == :binary
394
+ opts[:limit] = 255
395
+ when :medium
396
+ opts[:limit] = 16_777_215
397
+ when :long
398
+ opts[:limit] = 4_294_967_295
399
+ end
400
+ end
389
401
  end
390
402
  end
391
403
 
@@ -37,11 +37,9 @@ module Ridgepole
37
37
  attrs[:foreign_keys].each do |_, foreign_key_attrs|
38
38
  fk_index = foreign_key_attrs[:options][:column] || "#{foreign_key_attrs[:to_table].singularize}_id"
39
39
  next if attrs[:indices]&.any? { |_k, v| v[:column_name].first == fk_index }
40
+ next if attrs[:options][:primary_key] == fk_index
40
41
 
41
- Ridgepole::Logger.instance.warn(<<-MSG)
42
- [WARNING] Table `#{table_name}` has a foreign key on `#{fk_index}` column, but doesn't have any indexes on the column.
43
- Although an index will be added automatically by InnoDB, please add an index explicitly for your future operations.
44
- MSG
42
+ raise "The column `#{fk_index}` of the table `#{table_name}` has a foreign key but no index. Although InnoDB creates an index automatically, please add one explicitly in order for ridgepole to manage it."
45
43
  end
46
44
  end
47
45
  end
@@ -3,8 +3,7 @@
3
3
  module Ridgepole
4
4
  class DSLParser
5
5
  class Context
6
- attr_reader :__definition
7
- attr_reader :__execute
6
+ attr_reader :__definition, :__execute
8
7
 
9
8
  def initialize(opts = {})
10
9
  @__working_dir = File.expand_path(opts[:path] ? File.dirname(opts[:path]) : Dir.pwd)
@@ -104,6 +103,10 @@ module Ridgepole
104
103
  end
105
104
  end
106
105
 
106
+ def require_relative(relative_path)
107
+ require(File.expand_path(relative_path, File.dirname(caller[0])))
108
+ end
109
+
107
110
  def execute(sql, _name = nil, &cond)
108
111
  @__execute << {
109
112
  sql: sql,
@@ -41,7 +41,7 @@ module Ridgepole
41
41
  end
42
42
  end
43
43
  end
44
- rescue EOFError # rubocop:disable Lint/HandleExceptions
44
+ rescue EOFError
45
45
  # nothing to do
46
46
  end
47
47
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ridgepole
4
- VERSION = '0.8.5'
4
+ VERSION = '0.8.10'
5
5
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe Ridgepole::DSLParser::Context do
4
+ describe '#require_relative' do
5
+ subject { context.require_relative(relative_path) }
6
+
7
+ let!(:context) do
8
+ Ridgepole::DSLParser::Context.new
9
+ end
10
+ let!(:relative_path) do
11
+ '../fixtures/for_require_relative_spec.rb'
12
+ end
13
+
14
+ it { is_expected.to be_truthy }
15
+ end
16
+ end