ridgepole 0.8.6 → 0.8.7

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
2
  SHA256:
3
- metadata.gz: e81708c1fcd99a721354e49bdd8281e42657271da21acd80ecbf87e5a6b51890
4
- data.tar.gz: d4d2321cfc763a9f23bd9e3d57e16ef5e07c852653e198286ef9d39ef16275b4
3
+ metadata.gz: 1663947686d2cff34fc79b5f06e6b9df2568b6c52f4e37be19a55dd3881f02f6
4
+ data.tar.gz: '0656469c72c0085c89fbdf29e180da8dca898e3a1d80d415cb0e3b2f03fb808f'
5
5
  SHA512:
6
- metadata.gz: 55bf02b0f28ea259810c140697def6312f937e14cfc023be4aa6da75699844fd654b6d519896691ee1ddf7d1e2c60a12630d3820ce7e5e3505f210f400b02726
7
- data.tar.gz: cd121f6363ffb2136a124990c9f373f984a634302d0e8633cfe2f9fc164e0e244eaf0997d52bdd4c3aa618e28b02593f755b8e6485a87dc0b6aba023a3237d45
6
+ metadata.gz: da61fdbb7da55e9dd9d8fb7333f267292183397dc6454b246c3b6e5ba20b452213db281ad82a23547b814ede7b3f22aa5c9b1c3800b6357dd44ef4c038bf99a0
7
+ data.tar.gz: 28c19d1c188746f28be8ea271193946eb9f19107adb81a92cf461af416b661df5babe75ed06a74234368fdd24b18f914ec0bdf3ff8b0e4b5b145fbd186f572bb
@@ -18,7 +18,7 @@ Metrics/ClassLength:
18
18
  Enabled: false
19
19
  Metrics/CyclomaticComplexity:
20
20
  Enabled: false
21
- Style/LineLength:
21
+ Layout/LineLength:
22
22
  Enabled: false
23
23
  Metrics/MethodLength:
24
24
  Enabled: false
data/README.md CHANGED
@@ -113,6 +113,8 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
113
113
  * Improve warning message on table options ([pull#291](https://github.com/winebarrel/ridgepole/pull/291))
114
114
  * `>= 0.8.6`
115
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))
116
118
  </details>
117
119
 
118
120
  ## Installation
@@ -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?
@@ -104,6 +104,10 @@ module Ridgepole
104
104
  end
105
105
  end
106
106
 
107
+ def require_relative(relative_path)
108
+ require(File.expand_path(relative_path, File.dirname(caller[0])))
109
+ end
110
+
107
111
  def execute(sql, _name = nil, &cond)
108
112
  @__execute << {
109
113
  sql: sql,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ridgepole
4
- VERSION = '0.8.6'
4
+ VERSION = '0.8.7'
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
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ 'This file is used by dsl_parser/context_spec.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-23 00:00:00.000000000 Z
11
+ date: 2020-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -286,7 +286,9 @@ files:
286
286
  - omnibus-ridgepole/package-scripts/ridgepole/postrm
287
287
  - ridgepole.gemspec
288
288
  - spec/cli_helper.rb
289
+ - spec/dsl_parser/context_spec.rb
289
290
  - spec/erb_helper.rb
291
+ - spec/fixtures/for_require_relative_spec.rb
290
292
  - spec/hide_pending_formatter.rb
291
293
  - spec/mysql/_migrate/migrate_change_table_option_spec.rb
292
294
  - spec/mysql/bigint_pk/bigint_pk_spec.rb
@@ -448,7 +450,9 @@ specification_version: 4
448
450
  summary: Ridgepole is a tool to manage DB schema.
449
451
  test_files:
450
452
  - spec/cli_helper.rb
453
+ - spec/dsl_parser/context_spec.rb
451
454
  - spec/erb_helper.rb
455
+ - spec/fixtures/for_require_relative_spec.rb
452
456
  - spec/hide_pending_formatter.rb
453
457
  - spec/mysql/_migrate/migrate_change_table_option_spec.rb
454
458
  - spec/mysql/bigint_pk/bigint_pk_spec.rb