orats 0.9.7 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/.rubocop.yml +24 -0
- data/.travis.yml +9 -0
- data/README.md +103 -194
- data/bin/orats +2 -5
- data/lib/orats/cli.rb +6 -67
- data/lib/orats/cli_help/destroy +11 -0
- data/lib/orats/cli_help/new +2 -26
- data/lib/orats/commands/new.rb +127 -0
- data/lib/orats/common.rb +0 -29
- data/lib/orats/templates/base/.dockerignore +5 -0
- data/lib/orats/templates/base/.gitignore +22 -0
- data/lib/orats/templates/base/.rubocop.yml +29 -0
- data/lib/orats/templates/base/Dockerfile +102 -0
- data/lib/orats/templates/base/Gemfile +69 -0
- data/lib/orats/templates/base/Gemfile.lock +205 -0
- data/lib/orats/templates/base/README.md +24 -0
- data/lib/orats/templates/base/Rakefile +7 -0
- data/lib/orats/templates/base/app/assets/config/manifest.js +3 -0
- data/lib/orats/templates/base/app/assets/images/.keep +0 -0
- data/lib/orats/templates/base/app/assets/javascripts/application.js +33 -0
- data/lib/orats/templates/base/app/assets/javascripts/cable.js +14 -0
- data/lib/orats/templates/base/app/assets/javascripts/channels/.keep +0 -0
- data/lib/orats/templates/base/app/assets/stylesheets/application.scss +89 -0
- data/lib/orats/templates/base/app/channels/application_cable/channel.rb +4 -0
- data/lib/orats/templates/base/app/channels/application_cable/connection.rb +4 -0
- data/lib/orats/templates/base/app/controllers/application_controller.rb +3 -0
- data/lib/orats/templates/base/app/controllers/concerns/.keep +0 -0
- data/lib/orats/templates/base/app/controllers/pages_controller.rb +4 -0
- data/lib/orats/templates/base/app/helpers/application_helper.rb +31 -0
- data/lib/orats/templates/base/app/helpers/pages_helper.rb +2 -0
- data/lib/orats/templates/base/app/jobs/application_job.rb +2 -0
- data/lib/orats/templates/base/app/mailers/application_mailer.rb +4 -0
- data/lib/orats/templates/base/app/models/application_record.rb +3 -0
- data/lib/orats/templates/base/app/models/concerns/.keep +0 -0
- data/lib/orats/templates/{includes/new/rails → base}/app/views/layouts/_flash.html.erb +1 -1
- data/lib/orats/templates/base/app/views/layouts/_footer.html.erb +3 -0
- data/lib/orats/templates/{includes/new/rails/app/views/layouts/_google_analytics_snippet.html.erb → base/app/views/layouts/_google_analytics.html.erb} +5 -9
- data/lib/orats/templates/{includes/new/rails → base}/app/views/layouts/_navigation.html.erb +5 -4
- data/lib/orats/templates/base/app/views/layouts/application.html.erb +48 -0
- data/lib/orats/templates/base/app/views/layouts/mailer.html.erb +13 -0
- data/lib/orats/templates/base/app/views/layouts/mailer.text.erb +1 -0
- data/lib/orats/templates/base/app/views/pages/home.html.erb +46 -0
- data/lib/orats/templates/base/bin/bundle +3 -0
- data/lib/orats/templates/base/bin/rails +4 -0
- data/lib/orats/templates/base/bin/rake +4 -0
- data/lib/orats/templates/base/bin/setup +34 -0
- data/lib/orats/templates/base/bin/update +29 -0
- data/lib/orats/templates/base/cable/config.ru +4 -0
- data/lib/orats/templates/base/config.ru +5 -0
- data/lib/orats/templates/base/config/application.rb +71 -0
- data/lib/orats/templates/base/config/boot.rb +3 -0
- data/lib/orats/templates/base/config/cable.yml +14 -0
- data/lib/orats/templates/base/config/database.yml +13 -0
- data/lib/orats/templates/base/config/environment.rb +5 -0
- data/lib/orats/templates/base/config/environments/development.rb +49 -0
- data/lib/orats/templates/base/config/environments/production.rb +56 -0
- data/lib/orats/templates/base/config/environments/staging.rb +6 -0
- data/lib/orats/templates/base/config/environments/test.rb +40 -0
- data/lib/orats/templates/base/config/initializers/application_controller_renderer.rb +6 -0
- data/lib/orats/templates/base/config/initializers/assets.rb +12 -0
- data/lib/orats/templates/base/config/initializers/backtrace_silencers.rb +9 -0
- data/lib/orats/templates/base/config/initializers/cookies_serializer.rb +5 -0
- data/lib/orats/templates/base/config/initializers/filter_parameter_logging.rb +4 -0
- data/lib/orats/templates/base/config/initializers/inflections.rb +16 -0
- data/lib/orats/templates/base/config/initializers/mime_types.rb +4 -0
- data/lib/orats/templates/base/config/initializers/new_framework_defaults.rb +27 -0
- data/lib/orats/templates/base/config/initializers/session_store.rb +4 -0
- data/lib/orats/templates/{includes/new/rails → base}/config/initializers/sidekiq.rb +1 -4
- data/lib/orats/templates/base/config/initializers/timeout.rb +1 -0
- data/lib/orats/templates/base/config/initializers/wrap_parameters.rb +15 -0
- data/lib/orats/templates/base/config/locales/en.yml +23 -0
- data/lib/orats/templates/base/config/puma.rb +60 -0
- data/lib/orats/templates/base/config/routes.rb +3 -0
- data/lib/orats/templates/{includes/new/rails → base}/config/secrets.yml +3 -2
- data/lib/orats/templates/base/config/sidekiq.yml.erb +5 -0
- data/lib/orats/templates/base/config/spring.rb +6 -0
- data/lib/orats/templates/base/db/seeds.rb +9 -0
- data/lib/orats/templates/base/docker-compose.yml +59 -0
- data/lib/orats/templates/base/lib/assets/.keep +0 -0
- data/lib/orats/templates/base/lib/tasks/.keep +0 -0
- data/lib/orats/templates/base/log/.keep +0 -0
- data/lib/orats/templates/base/public/404.html +67 -0
- data/lib/orats/templates/base/public/422.html +67 -0
- data/lib/orats/templates/base/public/500.html +66 -0
- data/lib/orats/templates/base/public/apple-touch-icon-precomposed.png +0 -0
- data/lib/orats/templates/base/public/apple-touch-icon.png +0 -0
- data/lib/orats/templates/base/public/favicon.ico +0 -0
- data/lib/orats/templates/base/public/robots.txt +5 -0
- data/lib/orats/templates/base/test/controllers/.keep +0 -0
- data/lib/orats/templates/base/test/controllers/pages_controller_test.rb +9 -0
- data/lib/orats/templates/base/test/fixtures/.keep +0 -0
- data/lib/orats/templates/base/test/fixtures/files/.keep +0 -0
- data/lib/orats/templates/base/test/helpers/.keep +0 -0
- data/lib/orats/templates/base/test/integration/.keep +0 -0
- data/lib/orats/templates/base/test/mailers/.keep +0 -0
- data/lib/orats/templates/base/test/models/.keep +0 -0
- data/lib/orats/templates/base/test/test_helper.rb +11 -0
- data/lib/orats/templates/base/tmp/.keep +0 -0
- data/lib/orats/templates/base/vendor/assets/javascripts/.keep +0 -0
- data/lib/orats/templates/base/vendor/assets/stylesheets/.keep +0 -0
- data/lib/orats/ui.rb +5 -5
- data/lib/orats/util.rb +14 -0
- data/lib/orats/version.rb +1 -1
- data/orats.gemspec +3 -2
- data/test/integration/cli_test.rb +43 -65
- data/test/test_helper.rb +9 -58
- metadata +114 -66
- data/lib/orats/argv_adjust.rb +0 -61
- data/lib/orats/cli_help/nuke +0 -19
- data/lib/orats/commands/new/exec.rb +0 -59
- data/lib/orats/commands/new/rails.rb +0 -215
- data/lib/orats/commands/new/server.rb +0 -67
- data/lib/orats/commands/nuke.rb +0 -108
- data/lib/orats/postgres.rb +0 -92
- data/lib/orats/process.rb +0 -35
- data/lib/orats/redis.rb +0 -25
- data/lib/orats/shell.rb +0 -12
- data/lib/orats/templates/auth.rb +0 -394
- data/lib/orats/templates/base.rb +0 -546
- data/lib/orats/templates/includes/common/.gitignore +0 -6
- data/lib/orats/templates/includes/common/LICENSE +0 -22
- data/lib/orats/templates/includes/new/rails/.env +0 -59
- data/lib/orats/templates/includes/new/rails/Gemfile +0 -48
- data/lib/orats/templates/includes/new/rails/Procfile +0 -3
- data/lib/orats/templates/includes/new/rails/README.md +0 -3
- data/lib/orats/templates/includes/new/rails/app/assets/favicon/favicon_base.png +0 -0
- data/lib/orats/templates/includes/new/rails/app/helpers/application_helper.rb +0 -53
- data/lib/orats/templates/includes/new/rails/app/models/account.rb +0 -40
- data/lib/orats/templates/includes/new/rails/app/views/devise/confirmations/new.html.erb +0 -26
- data/lib/orats/templates/includes/new/rails/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
- data/lib/orats/templates/includes/new/rails/app/views/devise/mailer/reset_password_instructions.html.erb +0 -10
- data/lib/orats/templates/includes/new/rails/app/views/devise/mailer/unlock_instructions.html.erb +0 -8
- data/lib/orats/templates/includes/new/rails/app/views/devise/passwords/edit.html.erb +0 -28
- data/lib/orats/templates/includes/new/rails/app/views/devise/passwords/new.html.erb +0 -26
- data/lib/orats/templates/includes/new/rails/app/views/devise/registrations/edit.html.erb +0 -51
- data/lib/orats/templates/includes/new/rails/app/views/devise/registrations/new.html.erb +0 -31
- data/lib/orats/templates/includes/new/rails/app/views/devise/sessions/new.html.erb +0 -39
- data/lib/orats/templates/includes/new/rails/app/views/devise/shared/_links.html.erb +0 -38
- data/lib/orats/templates/includes/new/rails/app/views/devise/unlocks/new.html.erb +0 -26
- data/lib/orats/templates/includes/new/rails/app/views/layouts/_disqus_comments_snippet.html.erb +0 -19
- data/lib/orats/templates/includes/new/rails/app/views/layouts/_disqus_count_snippet.html.erb +0 -12
- data/lib/orats/templates/includes/new/rails/app/views/layouts/_footer.html.erb +0 -2
- data/lib/orats/templates/includes/new/rails/app/views/layouts/_navigation_auth.html.erb +0 -15
- data/lib/orats/templates/includes/new/rails/app/views/layouts/_navigation_links.html.erb +0 -3
- data/lib/orats/templates/includes/new/rails/app/views/layouts/application.html.erb +0 -47
- data/lib/orats/templates/includes/new/rails/app/views/pages/home.html.erb +0 -58
- data/lib/orats/templates/includes/new/rails/config/database.yml +0 -6
- data/lib/orats/templates/includes/new/rails/config/environments/staging.rb +0 -5
- data/lib/orats/templates/includes/new/rails/config/initializers/devise_async.rb +0 -1
- data/lib/orats/templates/includes/new/rails/config/initializers/mini_profiler.rb +0 -4
- data/lib/orats/templates/includes/new/rails/config/puma.rb +0 -39
- data/lib/orats/templates/includes/new/rails/config/schedule.rb +0 -3
- data/lib/orats/templates/includes/new/rails/config/sidekiq.yml +0 -7
- data/lib/orats/templates/includes/new/rails/config/sitemap.rb +0 -20
- data/lib/orats/templates/includes/new/rails/config/unicorn.rb +0 -84
- data/lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake +0 -48
- data/lib/orats/templates/includes/new/rails/public/404.html +0 -13
- data/lib/orats/templates/includes/new/rails/public/422.html +0 -13
- data/lib/orats/templates/includes/new/rails/public/500.html +0 -13
- data/lib/orats/templates/includes/new/rails/public/502.html +0 -13
- data/lib/orats/templates/includes/new/rails/public/deploy.html +0 -14
- data/lib/orats/templates/includes/new/rails/test/fixtures/accounts.yml +0 -27
- data/lib/orats/templates/includes/new/rails/test/models/account_test.rb +0 -46
data/test/test_helper.rb
CHANGED
@@ -1,56 +1,18 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
require 'securerandom'
|
3
|
-
require_relative '../lib/orats/commands/new/server'
|
4
3
|
|
5
4
|
module Orats
|
6
5
|
# test helpers
|
7
6
|
module Test
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
# commands when the host isn't localhost or 127.0.0.1
|
12
|
-
|
13
|
-
TEST_PATH = ENV['TEST_PATH'] || '/tmp/orats'
|
14
|
-
POSTGRES_LOCATION = ENV['POSTGRES_LOCATION'] || 'localhost'
|
15
|
-
POSTGRES_PORT = ENV['POSTGRES_PORT'] || '5432'
|
16
|
-
POSTGRES_USERNAME = ENV['POSTGRES_USERNAME'] || 'postgres'
|
17
|
-
POSTGRES_PASSWORD = ENV['POSTGRES_PASSWORD'] || ''
|
18
|
-
REDIS_LOCATION = ENV['REDIS_LOCATION'] || 'localhost'
|
19
|
-
REDIS_PORT = ENV['REDIS_PORT'] || '6379'
|
20
|
-
REDIS_PASSWORD = ENV['REDIS_PASSWORD'] || ''
|
21
|
-
|
22
|
-
CREDENTIALS = "-l #{POSTGRES_LOCATION} -o #{POSTGRES_PORT} " + \
|
23
|
-
"-u #{POSTGRES_USERNAME} -p #{POSTGRES_PASSWORD} " + \
|
24
|
-
"-n #{REDIS_LOCATION} -r #{REDIS_PORT} -d #{REDIS_PASSWORD}"
|
25
|
-
|
26
|
-
INCLUDES_PATH = File.absolute_path('../../lib/orats/templates/includes',
|
27
|
-
__FILE__)
|
28
|
-
BINARY_PATH = File.absolute_path('../../bin/orats', __FILE__)
|
29
|
-
ORATS_NEW_FLAGS = "#{CREDENTIALS} -S"
|
7
|
+
TEST_PATH = ENV['TEST_PATH'] || '/tmp'
|
8
|
+
TEMPLATES_PATH = File.absolute_path('../../lib/orats/templates', __FILE__)
|
9
|
+
BINARY_PATH = File.absolute_path('../../bin/orats', __FILE__)
|
30
10
|
|
31
11
|
def orats(command, options = {})
|
32
|
-
cmd, app_name
|
33
|
-
command
|
34
|
-
|
35
|
-
insert_answer = answer(options)
|
36
|
-
if insert_answer
|
37
|
-
prepend_command = "#{insert_answer} | "
|
38
|
-
else
|
39
|
-
prepend_command = ''
|
40
|
-
end
|
41
|
-
|
42
|
-
system "#{prepend_command} #{BINARY_PATH} #{command} #{options[:flags]}"
|
43
|
-
end
|
12
|
+
cmd, app_name = command.split(' ')
|
13
|
+
command = "#{cmd} #{TEST_PATH}/#{app_name}" unless app_name.nil?
|
44
14
|
|
45
|
-
|
46
|
-
assert input.scan(regex).size == expected,
|
47
|
-
"Found #{input.scan(regex).size} matches for '#{regex}' but " + \
|
48
|
-
"expected #{expected}"
|
49
|
-
end
|
50
|
-
|
51
|
-
def assert_in_file(file_path, match_regex)
|
52
|
-
file_contents = `cat #{file_path}`
|
53
|
-
assert_match(/#{match_regex}/, file_contents)
|
15
|
+
system "#{BINARY_PATH} #{command} #{options[:flags]}"
|
54
16
|
end
|
55
17
|
|
56
18
|
def assert_path(file_or_dir)
|
@@ -58,25 +20,14 @@ module Orats
|
|
58
20
|
"Expected path '#{file_or_dir}' to exist"
|
59
21
|
end
|
60
22
|
|
61
|
-
def refute_path(file_or_dir)
|
62
|
-
refute File.exist?(file_or_dir),
|
63
|
-
"Expected path '#{file_or_dir}' to exist"
|
64
|
-
end
|
65
|
-
|
66
23
|
private
|
67
24
|
|
68
|
-
def
|
69
|
-
|
70
|
-
|
71
|
-
if options[:answer] == 'y' || options[:answer] == 'yes'
|
72
|
-
'yes'
|
73
|
-
else
|
74
|
-
'no'
|
75
|
-
end
|
25
|
+
def absolute_test_path
|
26
|
+
File.join(TEST_PATH, @target_path)
|
76
27
|
end
|
77
28
|
|
78
29
|
def generate_app_name
|
79
|
-
"
|
30
|
+
"orats_#{SecureRandom.hex(8)}"
|
80
31
|
end
|
81
32
|
end
|
82
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Janetakis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,7 +66,21 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '5.3'
|
69
|
-
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.41'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.41'
|
83
|
+
description: Generate Dockerized Ruby on Rails applications using best practices.
|
70
84
|
email:
|
71
85
|
- nick.janetakis@gmail.com
|
72
86
|
executables:
|
@@ -75,77 +89,112 @@ extensions: []
|
|
75
89
|
extra_rdoc_files: []
|
76
90
|
files:
|
77
91
|
- ".gitignore"
|
92
|
+
- ".rubocop.yml"
|
93
|
+
- ".travis.yml"
|
78
94
|
- Gemfile
|
79
95
|
- LICENSE
|
80
96
|
- README.md
|
81
97
|
- Rakefile
|
82
98
|
- bin/orats
|
83
99
|
- lib/orats.rb
|
84
|
-
- lib/orats/argv_adjust.rb
|
85
100
|
- lib/orats/cli.rb
|
101
|
+
- lib/orats/cli_help/destroy
|
86
102
|
- lib/orats/cli_help/new
|
87
|
-
- lib/orats/
|
88
|
-
- lib/orats/commands/new/exec.rb
|
89
|
-
- lib/orats/commands/new/rails.rb
|
90
|
-
- lib/orats/commands/new/server.rb
|
91
|
-
- lib/orats/commands/nuke.rb
|
103
|
+
- lib/orats/commands/new.rb
|
92
104
|
- lib/orats/common.rb
|
93
|
-
- lib/orats/
|
94
|
-
- lib/orats/
|
95
|
-
- lib/orats/
|
96
|
-
- lib/orats/
|
97
|
-
- lib/orats/templates/
|
98
|
-
- lib/orats/templates/base.
|
99
|
-
- lib/orats/templates/
|
100
|
-
- lib/orats/templates/
|
101
|
-
- lib/orats/templates/
|
102
|
-
- lib/orats/templates/
|
103
|
-
- lib/orats/templates/
|
104
|
-
- lib/orats/templates/
|
105
|
-
- lib/orats/templates/
|
106
|
-
- lib/orats/templates/
|
107
|
-
- lib/orats/templates/
|
108
|
-
- lib/orats/templates/
|
109
|
-
- lib/orats/templates/
|
110
|
-
- lib/orats/templates/
|
111
|
-
- lib/orats/templates/
|
112
|
-
- lib/orats/templates/
|
113
|
-
- lib/orats/templates/
|
114
|
-
- lib/orats/templates/
|
115
|
-
- lib/orats/templates/
|
116
|
-
- lib/orats/templates/
|
117
|
-
- lib/orats/templates/
|
118
|
-
- lib/orats/templates/
|
119
|
-
- lib/orats/templates/
|
120
|
-
- lib/orats/templates/
|
121
|
-
- lib/orats/templates/
|
122
|
-
- lib/orats/templates/
|
123
|
-
- lib/orats/templates/
|
124
|
-
- lib/orats/templates/
|
125
|
-
- lib/orats/templates/
|
126
|
-
- lib/orats/templates/
|
127
|
-
- lib/orats/templates/
|
128
|
-
- lib/orats/templates/
|
129
|
-
- lib/orats/templates/
|
130
|
-
- lib/orats/templates/
|
131
|
-
- lib/orats/templates/
|
132
|
-
- lib/orats/templates/
|
133
|
-
- lib/orats/templates/
|
134
|
-
- lib/orats/templates/
|
135
|
-
- lib/orats/templates/
|
136
|
-
- lib/orats/templates/
|
137
|
-
- lib/orats/templates/
|
138
|
-
- lib/orats/templates/
|
139
|
-
- lib/orats/templates/
|
140
|
-
- lib/orats/templates/
|
141
|
-
- lib/orats/templates/
|
142
|
-
- lib/orats/templates/
|
143
|
-
- lib/orats/templates/
|
144
|
-
- lib/orats/templates/
|
145
|
-
- lib/orats/templates/
|
146
|
-
- lib/orats/templates/
|
147
|
-
- lib/orats/templates/
|
105
|
+
- lib/orats/templates/base/.dockerignore
|
106
|
+
- lib/orats/templates/base/.gitignore
|
107
|
+
- lib/orats/templates/base/.rubocop.yml
|
108
|
+
- lib/orats/templates/base/Dockerfile
|
109
|
+
- lib/orats/templates/base/Gemfile
|
110
|
+
- lib/orats/templates/base/Gemfile.lock
|
111
|
+
- lib/orats/templates/base/README.md
|
112
|
+
- lib/orats/templates/base/Rakefile
|
113
|
+
- lib/orats/templates/base/app/assets/config/manifest.js
|
114
|
+
- lib/orats/templates/base/app/assets/images/.keep
|
115
|
+
- lib/orats/templates/base/app/assets/javascripts/application.js
|
116
|
+
- lib/orats/templates/base/app/assets/javascripts/cable.js
|
117
|
+
- lib/orats/templates/base/app/assets/javascripts/channels/.keep
|
118
|
+
- lib/orats/templates/base/app/assets/stylesheets/application.scss
|
119
|
+
- lib/orats/templates/base/app/channels/application_cable/channel.rb
|
120
|
+
- lib/orats/templates/base/app/channels/application_cable/connection.rb
|
121
|
+
- lib/orats/templates/base/app/controllers/application_controller.rb
|
122
|
+
- lib/orats/templates/base/app/controllers/concerns/.keep
|
123
|
+
- lib/orats/templates/base/app/controllers/pages_controller.rb
|
124
|
+
- lib/orats/templates/base/app/helpers/application_helper.rb
|
125
|
+
- lib/orats/templates/base/app/helpers/pages_helper.rb
|
126
|
+
- lib/orats/templates/base/app/jobs/application_job.rb
|
127
|
+
- lib/orats/templates/base/app/mailers/application_mailer.rb
|
128
|
+
- lib/orats/templates/base/app/models/application_record.rb
|
129
|
+
- lib/orats/templates/base/app/models/concerns/.keep
|
130
|
+
- lib/orats/templates/base/app/views/layouts/_flash.html.erb
|
131
|
+
- lib/orats/templates/base/app/views/layouts/_footer.html.erb
|
132
|
+
- lib/orats/templates/base/app/views/layouts/_google_analytics.html.erb
|
133
|
+
- lib/orats/templates/base/app/views/layouts/_navigation.html.erb
|
134
|
+
- lib/orats/templates/base/app/views/layouts/application.html.erb
|
135
|
+
- lib/orats/templates/base/app/views/layouts/mailer.html.erb
|
136
|
+
- lib/orats/templates/base/app/views/layouts/mailer.text.erb
|
137
|
+
- lib/orats/templates/base/app/views/pages/home.html.erb
|
138
|
+
- lib/orats/templates/base/bin/bundle
|
139
|
+
- lib/orats/templates/base/bin/rails
|
140
|
+
- lib/orats/templates/base/bin/rake
|
141
|
+
- lib/orats/templates/base/bin/setup
|
142
|
+
- lib/orats/templates/base/bin/update
|
143
|
+
- lib/orats/templates/base/cable/config.ru
|
144
|
+
- lib/orats/templates/base/config.ru
|
145
|
+
- lib/orats/templates/base/config/application.rb
|
146
|
+
- lib/orats/templates/base/config/boot.rb
|
147
|
+
- lib/orats/templates/base/config/cable.yml
|
148
|
+
- lib/orats/templates/base/config/database.yml
|
149
|
+
- lib/orats/templates/base/config/environment.rb
|
150
|
+
- lib/orats/templates/base/config/environments/development.rb
|
151
|
+
- lib/orats/templates/base/config/environments/production.rb
|
152
|
+
- lib/orats/templates/base/config/environments/staging.rb
|
153
|
+
- lib/orats/templates/base/config/environments/test.rb
|
154
|
+
- lib/orats/templates/base/config/initializers/application_controller_renderer.rb
|
155
|
+
- lib/orats/templates/base/config/initializers/assets.rb
|
156
|
+
- lib/orats/templates/base/config/initializers/backtrace_silencers.rb
|
157
|
+
- lib/orats/templates/base/config/initializers/cookies_serializer.rb
|
158
|
+
- lib/orats/templates/base/config/initializers/filter_parameter_logging.rb
|
159
|
+
- lib/orats/templates/base/config/initializers/inflections.rb
|
160
|
+
- lib/orats/templates/base/config/initializers/mime_types.rb
|
161
|
+
- lib/orats/templates/base/config/initializers/new_framework_defaults.rb
|
162
|
+
- lib/orats/templates/base/config/initializers/session_store.rb
|
163
|
+
- lib/orats/templates/base/config/initializers/sidekiq.rb
|
164
|
+
- lib/orats/templates/base/config/initializers/timeout.rb
|
165
|
+
- lib/orats/templates/base/config/initializers/wrap_parameters.rb
|
166
|
+
- lib/orats/templates/base/config/locales/en.yml
|
167
|
+
- lib/orats/templates/base/config/puma.rb
|
168
|
+
- lib/orats/templates/base/config/routes.rb
|
169
|
+
- lib/orats/templates/base/config/secrets.yml
|
170
|
+
- lib/orats/templates/base/config/sidekiq.yml.erb
|
171
|
+
- lib/orats/templates/base/config/spring.rb
|
172
|
+
- lib/orats/templates/base/db/seeds.rb
|
173
|
+
- lib/orats/templates/base/docker-compose.yml
|
174
|
+
- lib/orats/templates/base/lib/assets/.keep
|
175
|
+
- lib/orats/templates/base/lib/tasks/.keep
|
176
|
+
- lib/orats/templates/base/log/.keep
|
177
|
+
- lib/orats/templates/base/public/404.html
|
178
|
+
- lib/orats/templates/base/public/422.html
|
179
|
+
- lib/orats/templates/base/public/500.html
|
180
|
+
- lib/orats/templates/base/public/apple-touch-icon-precomposed.png
|
181
|
+
- lib/orats/templates/base/public/apple-touch-icon.png
|
182
|
+
- lib/orats/templates/base/public/favicon.ico
|
183
|
+
- lib/orats/templates/base/public/robots.txt
|
184
|
+
- lib/orats/templates/base/test/controllers/.keep
|
185
|
+
- lib/orats/templates/base/test/controllers/pages_controller_test.rb
|
186
|
+
- lib/orats/templates/base/test/fixtures/.keep
|
187
|
+
- lib/orats/templates/base/test/fixtures/files/.keep
|
188
|
+
- lib/orats/templates/base/test/helpers/.keep
|
189
|
+
- lib/orats/templates/base/test/integration/.keep
|
190
|
+
- lib/orats/templates/base/test/mailers/.keep
|
191
|
+
- lib/orats/templates/base/test/models/.keep
|
192
|
+
- lib/orats/templates/base/test/test_helper.rb
|
193
|
+
- lib/orats/templates/base/tmp/.keep
|
194
|
+
- lib/orats/templates/base/vendor/assets/javascripts/.keep
|
195
|
+
- lib/orats/templates/base/vendor/assets/stylesheets/.keep
|
148
196
|
- lib/orats/ui.rb
|
197
|
+
- lib/orats/util.rb
|
149
198
|
- lib/orats/version.rb
|
150
199
|
- orats.gemspec
|
151
200
|
- test/integration/cli_test.rb
|
@@ -170,11 +219,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
219
|
version: '0'
|
171
220
|
requirements: []
|
172
221
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
222
|
+
rubygems_version: 2.5.1
|
174
223
|
signing_key:
|
175
224
|
specification_version: 4
|
176
225
|
summary: Opinionated rails application templates.
|
177
226
|
test_files:
|
178
227
|
- test/integration/cli_test.rb
|
179
228
|
- test/test_helper.rb
|
180
|
-
has_rdoc:
|
data/lib/orats/argv_adjust.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'orats/ui'
|
2
|
-
|
3
|
-
module Orats
|
4
|
-
# adjust ARGV by adding args from the .oratsrc file if necessary
|
5
|
-
class ARGVAdjust
|
6
|
-
include Orats::UI
|
7
|
-
|
8
|
-
def initialize(argv = ARGV)
|
9
|
-
@argv = argv
|
10
|
-
|
11
|
-
@default_rc_file = File.expand_path('~/.oratsrc')
|
12
|
-
@rc_path = ''
|
13
|
-
end
|
14
|
-
|
15
|
-
def init
|
16
|
-
rc_path @argv.first
|
17
|
-
return @argv if @rc_path.empty?
|
18
|
-
|
19
|
-
argv
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def rc_path(command)
|
25
|
-
return unless command == 'new' || command == 'nuke'
|
26
|
-
|
27
|
-
rc_flag = @argv.index { |item| item.include?('--rc') }
|
28
|
-
|
29
|
-
if rc_flag
|
30
|
-
cli_rc_file(rc_flag)
|
31
|
-
elsif File.exist?(@default_rc_file)
|
32
|
-
@rc_path = @default_rc_file
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def argv
|
37
|
-
if File.exist?(@rc_path)
|
38
|
-
extra_args = File.readlines(@rc_path).flat_map(&:split)
|
39
|
-
results 'Using values from an .oratsrc file',
|
40
|
-
'args', extra_args.join(' ')
|
41
|
-
puts
|
42
|
-
|
43
|
-
(@argv += extra_args).flatten
|
44
|
-
else
|
45
|
-
error 'The .oratsrc file cannot be found', @rc_path
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def cli_rc_file(index)
|
50
|
-
rc_value = @argv[index]
|
51
|
-
|
52
|
-
if rc_value.include?('=')
|
53
|
-
@rc_path = rc_value.gsub('--rc=', '')
|
54
|
-
@argv.slice! index
|
55
|
-
elsif rc_value == '--rc'
|
56
|
-
@rc_path = @argv[index + 1]
|
57
|
-
@argv.slice! index + 1
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
data/lib/orats/cli_help/nuke
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Delete the target path and optionally all data associated to it.
|
2
|
-
|
3
|
-
Development server credentials:
|
4
|
-
|
5
|
-
`--pg-location` to supply a custom postgres location [localhost]
|
6
|
-
|
7
|
-
`--pg-username` to supply a custom postgres username [postgres]
|
8
|
-
|
9
|
-
`--pg-password` to supply your postgres password []
|
10
|
-
|
11
|
-
`--redis-location` to supply a custom redis location [localhost]
|
12
|
-
|
13
|
-
`--redis-password` to supply your redis password []
|
14
|
-
|
15
|
-
Options:
|
16
|
-
|
17
|
-
`--skip-data` to skip deleting app specific postgres and redis data [false]
|
18
|
-
|
19
|
-
`--rc` to supply an .oratsrc file path to automatically populate credentials []
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'orats/common'
|
2
|
-
require 'orats/commands/new/rails'
|
3
|
-
require 'orats/commands/new/server'
|
4
|
-
|
5
|
-
module Orats
|
6
|
-
module Commands
|
7
|
-
module New
|
8
|
-
# entry point to the new command
|
9
|
-
class Exec < Common
|
10
|
-
include Rails
|
11
|
-
include Server
|
12
|
-
|
13
|
-
AVAILABLE_TEMPLATES = {
|
14
|
-
auth: 'add authentication and authorization'
|
15
|
-
}
|
16
|
-
|
17
|
-
def initialize(target_path = '', options = {})
|
18
|
-
super
|
19
|
-
end
|
20
|
-
|
21
|
-
def init
|
22
|
-
check_exit_conditions
|
23
|
-
|
24
|
-
rails_template 'base' do
|
25
|
-
rails_template_actions
|
26
|
-
end
|
27
|
-
|
28
|
-
orats_rails_template if template_exist?(@options[:template])
|
29
|
-
custom_rails_template unless @options[:custom].empty?
|
30
|
-
server_start
|
31
|
-
end
|
32
|
-
|
33
|
-
def available_templates
|
34
|
-
puts
|
35
|
-
log 'templates',
|
36
|
-
'Add `-t TEMPLATE` to the new command to mixin a template',
|
37
|
-
:magenta
|
38
|
-
puts
|
39
|
-
|
40
|
-
AVAILABLE_TEMPLATES.each_pair do |key, value|
|
41
|
-
log key, value, :cyan
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
|
47
|
-
def orats_to_local(source, dest)
|
48
|
-
includes_path = "#{base_path}/templates/includes"
|
49
|
-
|
50
|
-
unless Dir.exist?(File.dirname(dest))
|
51
|
-
system "mkdir -p #{File.dirname(dest)}"
|
52
|
-
end
|
53
|
-
|
54
|
-
system "cp #{includes_path}/#{source} #{dest}"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|