eac_rails_gem_support 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eac_rails_gem_support/rspec/appendable_rails_app.rb +10 -3
- data/lib/eac_rails_gem_support/rspec/setup/rails_app.rb +7 -1
- data/lib/eac_rails_gem_support/version.rb +1 -1
- data/template/eac_rails_gem_support/rspec/appendable_rails_app/Gemfile.template +3 -0
- data/template/eac_rails_gem_support/rspec/appendable_rails_app/app/views/home/index.html.erb +1 -0
- data/template/eac_rails_gem_support/rspec/appendable_rails_app/config/application.rb +6 -0
- data/template/eac_rails_gem_support/rspec/appendable_rails_app/config/database.yml +12 -0
- data/template/eac_rails_gem_support/rspec/appendable_rails_app/config/routes.rb +1 -7
- metadata +6 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad7afae011833365ad62252191c0f379680b430bf458378f10942b48ebbe8be6
|
4
|
+
data.tar.gz: 726dc87b8394ad8fb4e60e52f23b6398d11e8a057161edb43065221dfcf623d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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').
|
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(
|
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(
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Home</h1>
|
@@ -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)
|
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.
|
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-
|
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.
|
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.
|
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
|