eac_rails_gem_support 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
2
  SHA256:
3
- metadata.gz: 55d3693bb6833b88d52d73720341788e32bf2b706749f25f2d40ac45e03f16a2
4
- data.tar.gz: 178f20bc771e1be0656247018697760c630feb80eda8d87247da6cfdbafa8184
3
+ metadata.gz: ad7afae011833365ad62252191c0f379680b430bf458378f10942b48ebbe8be6
4
+ data.tar.gz: 726dc87b8394ad8fb4e60e52f23b6398d11e8a057161edb43065221dfcf623d4
5
5
  SHA512:
6
- metadata.gz: d60e41b95e70795601c1da806af14e29eeb81242448365a5bdca7041d343dc3b726d922c6543abbcc49b0d546057bae00cb6d8494ff6b375be6f44708af4f043
7
- data.tar.gz: 8799c5121fb460c72c2ea1427aa768a1693ff2ac8e194df0231120a16a5bb2d78df72c7b3f4359ab7cbd91fb23cd0215a05c4cd48c7c10ef114eb8f7b82b7beb
6
+ metadata.gz: 3d517422a4f06698781643e5e14e05ace1f5ffe361d8c0c8bb7494b04a3487aa7506f48e67ba77e28cb683d23096def68bfcd72201ff64cd66f09cb916701f13
7
+ data.tar.gz: 2ecd801b8c81a9adf773f8d55401b21ca396894d39641918406cfe35d76895b09647ae0e10c5d76c7b97c335c58f75ae8fbf1433f56f80fd1dec0f0e67364d28
@@ -10,20 +10,27 @@ module EacRailsGemSupport
10
10
  class AppendableRailsApp
11
11
  enable_simple_cache
12
12
  common_constructor :gem_dir, :append_dir, :target_dir, default: [nil] do
13
- self.target_dir = (target_dir || ::Dir.mktmpdir).to_pathname
13
+ self.target_dir = ::EacRubyUtils::Fs::ClearableDirectory.new(
14
+ (target_dir || ::Dir.mktmpdir).to_pathname
15
+ )
14
16
  build
15
17
  end
16
18
 
17
19
  protected
18
20
 
19
21
  def build
22
+ clear_target
20
23
  copy_app_base
21
24
  copy_append_directory
22
25
  database_migrate
23
26
  end
24
27
 
25
28
  def database_migrate
26
- the_gem.bundle('exec', 'rake', 'db:migrate').chdir(target_dir).execute!
29
+ the_gem.bundle('exec', 'rake', 'db:migrate').chdir_root.execute!
30
+ end
31
+
32
+ def clear_target
33
+ target_dir.clear
27
34
  end
28
35
 
29
36
  def copy_app_base
@@ -35,7 +42,7 @@ module EacRailsGemSupport
35
42
  end
36
43
 
37
44
  def the_gem_uncached
38
- ::EacRubyGemsUtils::Gem.new(gem_dir)
45
+ ::EacRubyGemsUtils::Gem.new(target_dir)
39
46
  end
40
47
  end
41
48
  end
@@ -11,7 +11,13 @@ module EacRailsGemSupport
11
11
  dir = app_root_path.join('spec', 'support', 'rails_app_append')
12
12
  return nil unless dir.directory?
13
13
 
14
- ::EacRailsGemSupport::Rspec::AppendableRailsApp.new(app_root_path, dir).target_dir
14
+ ::EacRailsGemSupport::Rspec::AppendableRailsApp.new(
15
+ app_root_path, dir, builded_rails_app_path_target_dir
16
+ ).target_dir
17
+ end
18
+
19
+ def builded_rails_app_path_target_dir
20
+ root_tmp.join('rails_app')
15
21
  end
16
22
 
17
23
  def existing_rails_app_path
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsGemSupport
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ eval_gemfile ::File.join('%%gem_dir%%', 'Gemfile')
@@ -6,6 +6,9 @@ require 'rails/all'
6
6
 
7
7
  Bundler.require(*Rails.groups)
8
8
 
9
+ file = ::File.join(__dir__, 'application_before.rb')
10
+ require file if ::File.exist?(file)
11
+
9
12
  module Dummy
10
13
  class Application < Rails::Application
11
14
  config.active_record.raise_in_transactional_callbacks = true if ::Rails.version < '5'
@@ -13,3 +16,6 @@ module Dummy
13
16
  config.action_mailer.default_url_options = { host: 'dummyhost' }
14
17
  end
15
18
  end
19
+
20
+ file = ::File.join(__dir__, 'application_after.rb')
21
+ require file if ::File.exist?(file)
@@ -1,3 +1,15 @@
1
+ development:
2
+ adapter: sqlite3
3
+ pool: 5
4
+ timeout: 5000
5
+ database: db/development.sqlite3
6
+
7
+ production:
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+ database: db/production.sqlite3
12
+
1
13
  test:
2
14
  adapter: sqlite3
3
15
  pool: 5
@@ -1,10 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Rails.application.routes.draw do
4
- resources :jobs do
5
- collection do
6
- get 'search'
7
- end
8
- end
9
- resources :users
3
+ ::Rails.application.routes.draw do
10
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_gem_support
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
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-15 00:00:00.000000000 Z
11
+ date: 2021-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -30,20 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.3'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 0.3.3
33
+ version: '0.4'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '0.3'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 0.3.3
40
+ version: '0.4'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: eac_ruby_gems_utils
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -171,8 +165,10 @@ files:
171
165
  - lib/eac_rails_gem_support/rspec/setup/fixtures.rb
172
166
  - lib/eac_rails_gem_support/rspec/setup/rails_app.rb
173
167
  - lib/eac_rails_gem_support/version.rb
168
+ - template/eac_rails_gem_support/rspec/appendable_rails_app/Gemfile.template
174
169
  - template/eac_rails_gem_support/rspec/appendable_rails_app/Rakefile
175
170
  - template/eac_rails_gem_support/rspec/appendable_rails_app/app/assets/config/manifest.js
171
+ - template/eac_rails_gem_support/rspec/appendable_rails_app/app/views/home/index.html.erb
176
172
  - template/eac_rails_gem_support/rspec/appendable_rails_app/bin/rails
177
173
  - template/eac_rails_gem_support/rspec/appendable_rails_app/config.ru
178
174
  - template/eac_rails_gem_support/rspec/appendable_rails_app/config/application.rb