panacea-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ web: bin/rails s -p $PORT
2
+ <% if @panacea.dig("background_job") == "sidekiq" -%>
3
+ redis: redis-server
4
+ sidekiq: bundle exec sidekiq -q default -q mailers
5
+ <% elsif @panacea.dig("background_job") == "resque" -%>
6
+ redis: redis-server
7
+ resque: bundle exec rake resque:work QUEUE='*'
8
+ <% end -%>
9
+ <% if @panacea.dig("webpack") -%>
10
+ webpack: bin/webpack-dev-server
11
+ <% end -%>
@@ -0,0 +1,68 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Edit/Remove the following sections as you wish.
7
+
8
+ ## System Requirements
9
+
10
+ - Ruby 2.5.1
11
+ - Rails 5.2.1
12
+ - Yarn
13
+
14
+ ## Dependencies
15
+
16
+ ### Ruby
17
+
18
+ bundle install
19
+
20
+ ### Javascript
21
+
22
+ yarn install
23
+
24
+ ### System
25
+
26
+ ## Database Management
27
+
28
+ To setup database you either run:
29
+
30
+ bundle exec rails db:setup
31
+
32
+ or:
33
+
34
+ bundle exec rails db:create
35
+ bundle exec rails db:migrate
36
+ bundle exec rails db:seed
37
+
38
+ ### Running migrations
39
+
40
+ To run migrations use the following command:
41
+
42
+ bundle exec rails db:migrate
43
+
44
+ ## Services (job queues, cache servers, search engines, etc.)
45
+
46
+ ## Tests
47
+
48
+ You should run the tests with the following command:
49
+
50
+ bundle exec rake
51
+
52
+ ## Linting
53
+
54
+ You can lint the code running Rubocop:
55
+
56
+ bundle exec rubocop
57
+
58
+ ## Security
59
+
60
+ Run:
61
+
62
+ bundle exec brakeman
63
+
64
+ ## Deployment Instructions
65
+
66
+ ## How to Contribute
67
+
68
+ ## License
@@ -0,0 +1,10 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative "config/application"
5
+ <% if @panacea.dig("background_job") == "resque" -%>
6
+ require "resque/tasks"
7
+ task "resque:setup" => :environment
8
+ <% end -%>
9
+
10
+ Rails.application.load_tasks
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "test_helper"
4
+ require "selenium/webdriver"
5
+
6
+ Capybara.register_driver :chrome do |app|
7
+ Capybara::Selenium::Driver.new(app, browser: :chrome)
8
+ end
9
+
10
+ Capybara.register_driver :headless_chrome do |app|
11
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
12
+ chromeOptions: { args: %w(headless disable-gpu no-sandbox) }
13
+ )
14
+
15
+ Capybara::Selenium::Driver.new app,
16
+ browser: :chrome,
17
+ desired_capabilities: capabilities
18
+ end
19
+
20
+ Capybara.javascript_driver = :headless_chrome
21
+
22
+ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
23
+ <% if @panacea.dig("devise") -%>
24
+ include Warden::Test::Helpers
25
+
26
+ <% end -%>
27
+ driven_by :headless_chrome
28
+ end
@@ -0,0 +1,4 @@
1
+ # Add here your translations
2
+
3
+ <%= @panacea.dig("locale").split("- ").last -%>:
4
+ hello: "Hello world"
@@ -0,0 +1,2 @@
1
+ # Add here your ENV variables, i.e.
2
+ # VAR_NAME=value
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ bundle exec rubocop && bundle exec rake
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ ENV["RAILS_ENV"] = "test"
4
+
5
+ require_relative "support/simplecov"
6
+ require_relative "../config/environment"
7
+ require "rails/test_help"
8
+ require "minitest/rails"
9
+ <% if @panacea.dig("faker") -%>
10
+ require "faker"
11
+ <% end -%>
12
+ <% if @panacea.dig("http_stubs") == "vcr" -%>
13
+ require "vcr"
14
+ <% end -%>
15
+ <% if @panacea.dig("http_stubs") == "webmock" -%>
16
+ require "webmock/minitest"
17
+ <% end -%>
18
+
19
+ # To add Capybara feature tests add `gem "minitest-rails-capybara"`
20
+ # to the test group in the Gemfile and uncomment the following:
21
+ # require "minitest/rails/capybara"
22
+
23
+ # Uncomment for awesome colorful output
24
+ # require "minitest/pride"
25
+
26
+ <% if @panacea.dig("http_stubs") == "vcr" -%>
27
+ VCR.configure do |config|
28
+ config.cassette_library_dir = "test/vcr_cassettes"
29
+ config.hook_into :webmock
30
+ end
31
+ <% end -%>
32
+
33
+ class ActiveSupport::TestCase
34
+ <% if @panacea.dig("factory_bot") -%>
35
+ include FactoryBot::Syntax::Methods
36
+ <% end -%>
37
+
38
+ fixtures :all
39
+ end
40
+
41
+ <% if @panacea.dig("devise") -%>
42
+ class ActionDispatch::IntegrationTest
43
+ include Devise::Test::IntegrationHelpers
44
+ end
45
+ <% end -%>
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ Oj.optimize_rails
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "support/simplecov"
4
+ require "spec_helper"
5
+ ENV["RAILS_ENV"] ||= "test"
6
+ require_relative "../config/environment"
7
+
8
+ # Prevent database truncation if the environment is production
9
+ abort("The Rails environment is running in production mode!") if Rails.env.production?
10
+
11
+ require "rspec/rails"
12
+ require "capybara/rspec"
13
+ <% if @panacea.dig("faker") -%>
14
+ require "faker"
15
+ <% end -%>
16
+ <% if @panacea.dig("http_stubs") == "vcr" -%>
17
+ require "vcr"
18
+ <% end -%>
19
+ <% if @panacea.dig("http_stubs") == "webmock" -%>
20
+ require "webmock/rspec"
21
+ <% end -%>
22
+
23
+ # Add additional requires below this line. Rails is not loaded until this point!
24
+
25
+ # Checks for pending migrations and applies them before tests are run.
26
+ # If you are not using ActiveRecord, you can remove these lines.
27
+ begin
28
+ ActiveRecord::Migration.maintain_test_schema!
29
+ rescue ActiveRecord::PendingMigrationError => e
30
+ puts e.to_s.strip
31
+ exit 1
32
+ end
33
+
34
+ <% if @panacea.dig("http_stubs") == "vcr" -%>
35
+ VCR.configure do |config|
36
+ config.cassette_library_dir = "spec/vcr_cassettes"
37
+ config.hook_into :webmock
38
+ end
39
+ <% end -%>
40
+
41
+ RSpec.configure do |config|
42
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
43
+ config.use_transactional_fixtures = true
44
+ config.infer_spec_type_from_file_location!
45
+ config.filter_rails_from_backtrace!
46
+ <% if @panacea.dig("devise") -%>
47
+ config.include Devise::Test::IntegrationHelpers, type: :request
48
+ <% end -%>
49
+ <% if @panacea.dig("factory_bot") -%>
50
+ config.include FactoryBot::Syntax::Methods
51
+ <% end -%>
52
+
53
+ <% if @panacea.dig("headless_chrome") -%>
54
+ Capybara.register_driver :chrome do |app|
55
+ Capybara::Selenium::Driver.new(app, browser: :chrome)
56
+ end
57
+
58
+ Capybara.register_driver :headless_chrome do |app|
59
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
60
+ chromeOptions: { args: %w(headless disable-gpu no-sandbox) }
61
+ )
62
+
63
+ Capybara::Selenium::Driver.new app, browser: :chrome, desired_capabilities: capabilities
64
+ end
65
+
66
+ Capybara.javascript_driver = :headless_chrome
67
+ <% end %>
68
+ end
@@ -0,0 +1,6 @@
1
+ inherit_gem:
2
+ rubocop-rails_config:
3
+ - config/rails.yml
4
+
5
+ AllCops:
6
+ TargetRubyVersion: <%= @panacea.dig("ruby_version")[0..2] %>
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "simplecov"
4
+
5
+ SimpleCov.start "rails"
6
+
7
+ SimpleCov.minimum_coverage <%= @panacea.dig("expected_coverage") %>
metadata ADDED
@@ -0,0 +1,183 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: panacea-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Guillermo Moreno
8
+ - Rafael Ramos
9
+ - Eduardo Figarola
10
+ autorequire:
11
+ bindir: exe
12
+ cert_chain: []
13
+ date: 2018-09-03 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: bundler
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '1'
29
+ - !ruby/object:Gem::Dependency
30
+ name: slop
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '4.6'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '4.6'
43
+ - !ruby/object:Gem::Dependency
44
+ name: tty-prompt
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.17'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '0.17'
57
+ - !ruby/object:Gem::Dependency
58
+ name: minitest
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '5.0'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '5.0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: rake
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '10.0'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '10.0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: rubocop
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '0.58'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "~>"
97
+ - !ruby/object:Gem::Version
98
+ version: '0.58'
99
+ - !ruby/object:Gem::Dependency
100
+ name: sdoc
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '1.0'
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: '1.0'
113
+ description:
114
+ email:
115
+ - guillermo@michelada.io
116
+ - rafael@michelada.io
117
+ - eduardo@michelada.io
118
+ executables:
119
+ - panacea
120
+ extensions: []
121
+ extra_rdoc_files: []
122
+ files:
123
+ - ".gitignore"
124
+ - ".rubocop.yml"
125
+ - ".travis.yml"
126
+ - CODE_OF_CONDUCT.md
127
+ - Gemfile
128
+ - Gemfile.lock
129
+ - LICENSE.txt
130
+ - README.md
131
+ - Rakefile
132
+ - bin/console
133
+ - bin/setup
134
+ - config/questions.yml
135
+ - exe/panacea
136
+ - lib/panacea/rails.rb
137
+ - lib/panacea/rails/arguments_parser.rb
138
+ - lib/panacea/rails/customizer.rb
139
+ - lib/panacea/rails/generator.rb
140
+ - lib/panacea/rails/runner.rb
141
+ - lib/panacea/rails/stats.rb
142
+ - lib/panacea/rails/template.rb
143
+ - lib/panacea/rails/version.rb
144
+ - panacea-rails.gemspec
145
+ - templates/Gemfile.tt
146
+ - templates/PANACEA.tt
147
+ - templates/Procfile.tt
148
+ - templates/README.tt
149
+ - templates/Rakefile.tt
150
+ - templates/application_system_test.tt
151
+ - templates/default_locale.tt
152
+ - templates/dotenv.tt
153
+ - templates/githook.tt
154
+ - templates/minitest_test_helper.tt
155
+ - templates/oj_initializer.tt
156
+ - templates/rspec_test_helper.tt
157
+ - templates/rubocop.tt
158
+ - templates/simplecov.tt
159
+ homepage: https://www.panacea.website
160
+ licenses:
161
+ - MIT
162
+ metadata: {}
163
+ post_install_message:
164
+ rdoc_options: []
165
+ require_paths:
166
+ - lib
167
+ required_ruby_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ requirements: []
178
+ rubyforge_project:
179
+ rubygems_version: 2.7.6
180
+ signing_key:
181
+ specification_version: 4
182
+ summary: Rails Apps Generator
183
+ test_files: []