cert_file_maker 0.0.5 → 0.0.6
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/.gitignore +4 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +138 -0
- data/LICENSE +21 -0
- data/README.md +44 -0
- data/cert_file_maker.gemspec +18 -0
- data/lib/cert_file_maker/railtie.rb +11 -0
- data/lib/generator.rb +11 -0
- data/lib/version.rb +3 -0
- data/test/cert_file_maker_test.rb +54 -0
- data/test/rails_app/Rakefile +6 -0
- data/test/rails_app/app/assets/config/manifest.js +3 -0
- data/test/rails_app/app/assets/images/.keep +0 -0
- data/test/rails_app/app/assets/javascripts/application.js +16 -0
- data/test/rails_app/app/assets/javascripts/cable.js +13 -0
- data/test/rails_app/app/assets/javascripts/channels/.keep +0 -0
- data/test/rails_app/app/assets/stylesheets/application.css +15 -0
- data/test/rails_app/app/channels/application_cable/channel.rb +4 -0
- data/test/rails_app/app/channels/application_cable/connection.rb +4 -0
- data/test/rails_app/app/controllers/application_controller.rb +2 -0
- data/test/rails_app/app/controllers/concerns/.keep +0 -0
- data/test/rails_app/app/helpers/application_helper.rb +2 -0
- data/test/rails_app/app/jobs/application_job.rb +2 -0
- data/test/rails_app/app/mailers/application_mailer.rb +4 -0
- data/test/rails_app/app/models/application_record.rb +3 -0
- data/test/rails_app/app/models/concerns/.keep +0 -0
- data/test/rails_app/app/views/layouts/application.html.erb +15 -0
- data/test/rails_app/app/views/layouts/mailer.html.erb +13 -0
- data/test/rails_app/app/views/layouts/mailer.text.erb +1 -0
- data/test/rails_app/bin/bundle +3 -0
- data/test/rails_app/bin/rails +9 -0
- data/test/rails_app/bin/rake +9 -0
- data/test/rails_app/bin/setup +36 -0
- data/test/rails_app/bin/spring +17 -0
- data/test/rails_app/bin/update +31 -0
- data/test/rails_app/bin/yarn +11 -0
- data/test/rails_app/config.ru +5 -0
- data/test/rails_app/config/application.rb +19 -0
- data/test/rails_app/config/boot.rb +3 -0
- data/test/rails_app/config/cable.yml +10 -0
- data/test/rails_app/config/cert_file_maker.yml +1 -0
- data/test/rails_app/config/credentials.yml.enc +1 -0
- data/test/rails_app/config/database.yml +25 -0
- data/test/rails_app/config/environment.rb +6 -0
- data/test/rails_app/config/environments/development.rb +61 -0
- data/test/rails_app/config/environments/production.rb +94 -0
- data/test/rails_app/config/environments/test.rb +46 -0
- data/test/rails_app/config/initializers/application_controller_renderer.rb +8 -0
- data/test/rails_app/config/initializers/assets.rb +14 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/content_security_policy.rb +25 -0
- data/test/rails_app/config/initializers/cookies_serializer.rb +5 -0
- data/test/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/rails_app/config/initializers/inflections.rb +16 -0
- data/test/rails_app/config/initializers/mime_types.rb +4 -0
- data/test/rails_app/config/initializers/wrap_parameters.rb +14 -0
- data/test/rails_app/config/locales/en.yml +33 -0
- data/test/rails_app/config/puma.rb +34 -0
- data/test/rails_app/config/routes.rb +3 -0
- data/test/rails_app/config/spring.rb +6 -0
- data/test/rails_app/config/storage.yml +34 -0
- data/test/rails_app/db/seeds.rb +7 -0
- data/test/rails_app/lib/assets/.keep +0 -0
- data/test/rails_app/lib/tasks/.keep +0 -0
- data/test/rails_app/log/development.log +0 -0
- data/test/rails_app/log/test.log +0 -0
- data/test/rails_app/package.json +5 -0
- data/test/rails_app/public/404.html +67 -0
- data/test/rails_app/public/422.html +67 -0
- data/test/rails_app/public/500.html +66 -0
- data/test/rails_app/public/apple-touch-icon-precomposed.png +0 -0
- data/test/rails_app/public/apple-touch-icon.png +0 -0
- data/test/rails_app/public/favicon.ico +0 -0
- data/test/rails_app/public/robots.txt +1 -0
- data/test/rails_app/tmp/development_secret.txt +1 -0
- data/test/rails_cert_file_maker_test.rb +82 -0
- data/test/test_helper.rb +6 -0
- metadata +78 -1
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
@@ -0,0 +1 @@
|
|
1
|
+
b19d10678a0505dc6d4f3f640e0da4f4ca70409a206b98b0ca71e1fa8a8302c30d30bbe728034c7e984b2204df7edcbc1d84077369b9aa24ec926d8bd86c70f3
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'test_helper'
|
3
|
+
|
4
|
+
class TestRailsCertFileMaker < Minitest::Test
|
5
|
+
def assert_output(expected, io, timeout = 10)
|
6
|
+
timeout = Time.now + timeout
|
7
|
+
|
8
|
+
output = +""
|
9
|
+
until output.include?(expected) || Time.now > timeout
|
10
|
+
if IO.select([io], [], [], 0.1)
|
11
|
+
output << io.read(1).force_encoding('utf-8')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
assert_includes output, expected, "#{expected.inspect} expected, but got:\n\n#{output}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def setup
|
19
|
+
@init_dir = Dir.pwd
|
20
|
+
@rails_app_dir = 'test/rails_app/'
|
21
|
+
end
|
22
|
+
|
23
|
+
def teardown
|
24
|
+
Dir.chdir(@init_dir)
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_cert_file_maker_output_when_rails_server
|
28
|
+
ENV['CERT_TEST'] = 'Test cert'
|
29
|
+
ENV['PRIVATE_KEY'] = 'Private key'
|
30
|
+
@pid = nil
|
31
|
+
Dir.chdir(@rails_app_dir) do
|
32
|
+
begin
|
33
|
+
primary, replica = PTY.open
|
34
|
+
@pid = Process.spawn("bin/rails server", chdir: Dir.pwd, in: replica, out: replica, err: replica)
|
35
|
+
#puts "Rails booting on pid => #{@pid}"
|
36
|
+
output = <<-OUTPUT
|
37
|
+
=> CertFileMaker loading\r
|
38
|
+
=> CertFileMaker => Created: cert_test.pem\r
|
39
|
+
=> CertFileMaker => Created: private_key.pem\r
|
40
|
+
=== CertFileMaker loaded ===\r
|
41
|
+
OUTPUT
|
42
|
+
assert_output(output.force_encoding('utf-8'), primary)
|
43
|
+
assert File.exists?('cert_test.pem')
|
44
|
+
assert File.exists?('private_key.pem')
|
45
|
+
ensure
|
46
|
+
puts 'ensuring'
|
47
|
+
File.delete('cert_test.pem')
|
48
|
+
File.delete('private_key.pem')
|
49
|
+
Process.kill("TERM", @pid)
|
50
|
+
Process.kill("TERM", @pid)
|
51
|
+
#Process.wait(@pid)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_cert_file_maker_output_when_rails_server_using_encrypted_cred
|
57
|
+
@pid = nil
|
58
|
+
Dir.chdir(@rails_app_dir) do
|
59
|
+
begin
|
60
|
+
primary, replica = PTY.open
|
61
|
+
@pid = Process.spawn("RAILS_ENV='development' bin/rails server", chdir: Dir.pwd, in: replica, out: replica, err: replica)
|
62
|
+
#puts "Rails booting on pid => #{@pid}"
|
63
|
+
output = <<-OUTPUT
|
64
|
+
=> CertFileMaker loading\r
|
65
|
+
=> CertFileMaker => Created: cert_test.pem\r
|
66
|
+
=> CertFileMaker => Created: private_key.pem\r
|
67
|
+
=== CertFileMaker loaded ===\r
|
68
|
+
OUTPUT
|
69
|
+
assert_output(output.force_encoding('utf-8'), primary)
|
70
|
+
assert File.exists?('cert_test.pem')
|
71
|
+
assert File.exists?('private_key.pem')
|
72
|
+
ensure
|
73
|
+
puts 'ensuring'
|
74
|
+
File.delete('cert_test.pem')
|
75
|
+
File.delete('private_key.pem')
|
76
|
+
Process.kill("TERM", @pid)
|
77
|
+
Process.kill("TERM", @pid)
|
78
|
+
#Process.wait(@pid)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cert_file_maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernardo Galindo
|
@@ -16,7 +16,84 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".gitignore"
|
20
|
+
- Gemfile
|
21
|
+
- Gemfile.lock
|
22
|
+
- LICENSE
|
23
|
+
- README.md
|
24
|
+
- cert_file_maker.gemspec
|
19
25
|
- lib/cert_file_maker.rb
|
26
|
+
- lib/cert_file_maker/railtie.rb
|
27
|
+
- lib/generator.rb
|
28
|
+
- lib/version.rb
|
29
|
+
- test/cert_file_maker_test.rb
|
30
|
+
- test/rails_app/Rakefile
|
31
|
+
- test/rails_app/app/assets/config/manifest.js
|
32
|
+
- test/rails_app/app/assets/images/.keep
|
33
|
+
- test/rails_app/app/assets/javascripts/application.js
|
34
|
+
- test/rails_app/app/assets/javascripts/cable.js
|
35
|
+
- test/rails_app/app/assets/javascripts/channels/.keep
|
36
|
+
- test/rails_app/app/assets/stylesheets/application.css
|
37
|
+
- test/rails_app/app/channels/application_cable/channel.rb
|
38
|
+
- test/rails_app/app/channels/application_cable/connection.rb
|
39
|
+
- test/rails_app/app/controllers/application_controller.rb
|
40
|
+
- test/rails_app/app/controllers/concerns/.keep
|
41
|
+
- test/rails_app/app/helpers/application_helper.rb
|
42
|
+
- test/rails_app/app/jobs/application_job.rb
|
43
|
+
- test/rails_app/app/mailers/application_mailer.rb
|
44
|
+
- test/rails_app/app/models/application_record.rb
|
45
|
+
- test/rails_app/app/models/concerns/.keep
|
46
|
+
- test/rails_app/app/views/layouts/application.html.erb
|
47
|
+
- test/rails_app/app/views/layouts/mailer.html.erb
|
48
|
+
- test/rails_app/app/views/layouts/mailer.text.erb
|
49
|
+
- test/rails_app/bin/bundle
|
50
|
+
- test/rails_app/bin/rails
|
51
|
+
- test/rails_app/bin/rake
|
52
|
+
- test/rails_app/bin/setup
|
53
|
+
- test/rails_app/bin/spring
|
54
|
+
- test/rails_app/bin/update
|
55
|
+
- test/rails_app/bin/yarn
|
56
|
+
- test/rails_app/config.ru
|
57
|
+
- test/rails_app/config/application.rb
|
58
|
+
- test/rails_app/config/boot.rb
|
59
|
+
- test/rails_app/config/cable.yml
|
60
|
+
- test/rails_app/config/cert_file_maker.yml
|
61
|
+
- test/rails_app/config/credentials.yml.enc
|
62
|
+
- test/rails_app/config/database.yml
|
63
|
+
- test/rails_app/config/environment.rb
|
64
|
+
- test/rails_app/config/environments/development.rb
|
65
|
+
- test/rails_app/config/environments/production.rb
|
66
|
+
- test/rails_app/config/environments/test.rb
|
67
|
+
- test/rails_app/config/initializers/application_controller_renderer.rb
|
68
|
+
- test/rails_app/config/initializers/assets.rb
|
69
|
+
- test/rails_app/config/initializers/backtrace_silencers.rb
|
70
|
+
- test/rails_app/config/initializers/content_security_policy.rb
|
71
|
+
- test/rails_app/config/initializers/cookies_serializer.rb
|
72
|
+
- test/rails_app/config/initializers/filter_parameter_logging.rb
|
73
|
+
- test/rails_app/config/initializers/inflections.rb
|
74
|
+
- test/rails_app/config/initializers/mime_types.rb
|
75
|
+
- test/rails_app/config/initializers/wrap_parameters.rb
|
76
|
+
- test/rails_app/config/locales/en.yml
|
77
|
+
- test/rails_app/config/puma.rb
|
78
|
+
- test/rails_app/config/routes.rb
|
79
|
+
- test/rails_app/config/spring.rb
|
80
|
+
- test/rails_app/config/storage.yml
|
81
|
+
- test/rails_app/db/seeds.rb
|
82
|
+
- test/rails_app/lib/assets/.keep
|
83
|
+
- test/rails_app/lib/tasks/.keep
|
84
|
+
- test/rails_app/log/development.log
|
85
|
+
- test/rails_app/log/test.log
|
86
|
+
- test/rails_app/package.json
|
87
|
+
- test/rails_app/public/404.html
|
88
|
+
- test/rails_app/public/422.html
|
89
|
+
- test/rails_app/public/500.html
|
90
|
+
- test/rails_app/public/apple-touch-icon-precomposed.png
|
91
|
+
- test/rails_app/public/apple-touch-icon.png
|
92
|
+
- test/rails_app/public/favicon.ico
|
93
|
+
- test/rails_app/public/robots.txt
|
94
|
+
- test/rails_app/tmp/development_secret.txt
|
95
|
+
- test/rails_cert_file_maker_test.rb
|
96
|
+
- test/test_helper.rb
|
20
97
|
homepage:
|
21
98
|
licenses:
|
22
99
|
- MIT
|