railman 1.0.3 → 1.0.4
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/railman/version.rb +1 -1
- data/railman.gemspec +0 -2
- data/templates/rails_app/.babelrc +5 -0
- data/templates/rails_app/.gitignore +8 -2
- data/templates/rails_app/.postcssrc.yml +4 -0
- data/templates/rails_app/Gemfile +15 -13
- data/templates/rails_app/Rakefile +1 -1
- data/templates/rails_app/app/assets/javascripts/application.js +1 -1
- data/templates/rails_app/app/assets/stylesheets/application.sass +1 -1
- data/templates/rails_app/app/assets/stylesheets/main.sass +7 -2
- data/templates/rails_app/app/javascript/packs/app.vue +22 -0
- data/templates/rails_app/app/javascript/packs/application.js +2 -9
- data/templates/rails_app/app/javascript/packs/hello_vue.js +19 -0
- data/templates/rails_app/bin/rails +0 -5
- data/templates/rails_app/bin/rake +0 -5
- data/templates/rails_app/bin/webpack +25 -11
- data/templates/rails_app/bin/webpack-dev-server +22 -16
- data/templates/rails_app/bin/yarn +3 -2
- data/templates/rails_app/config.ru +1 -1
- data/templates/rails_app/config/application.rb.tt +3 -0
- data/templates/rails_app/config/database.yml.tt +2 -2
- data/templates/rails_app/config/environments/development.rb +0 -3
- data/templates/rails_app/config/environments/production.rb.tt +0 -3
- data/templates/rails_app/config/{puma.rb → puma.rb.tt} +5 -6
- data/templates/rails_app/config/webpack/configuration.js +26 -0
- data/templates/rails_app/config/webpack/development.js +3 -17
- data/templates/rails_app/config/webpack/development.server.js +17 -0
- data/templates/rails_app/config/webpack/development.server.yml +17 -0
- data/templates/rails_app/config/webpack/loaders/assets.js +12 -0
- data/templates/rails_app/config/webpack/loaders/babel.js +5 -0
- data/templates/rails_app/config/webpack/loaders/coffee.js +4 -0
- data/templates/rails_app/config/webpack/loaders/erb.js +9 -0
- data/templates/rails_app/config/webpack/loaders/sass.js +14 -0
- data/templates/rails_app/config/webpack/loaders/vue.js +12 -0
- data/templates/rails_app/config/webpack/paths.yml +33 -0
- data/templates/rails_app/config/webpack/production.js +5 -7
- data/templates/rails_app/config/webpack/shared.js +28 -54
- data/templates/rails_app/config/webpack/test.js +6 -0
- data/templates/rails_app/package.json.tt +24 -17
- data/templates/rails_app/public/404.html +51 -51
- data/templates/rails_app/public/422.html +51 -51
- data/templates/rails_app/public/500.html +50 -50
- data/templates/rails_app/test/application_system_test_case.rb +5 -2
- data/templates/rails_app/test/fixtures/files/.keep +0 -0
- metadata +20 -37
- data/templates/rails_app/app/javascript/packs/hello.vue +0 -11
- data/templates/rails_app/bin/spring +0 -17
- data/templates/rails_app/bin/webpack-watcher +0 -10
- data/templates/rails_app/config/initializers/new_framework_defaults.rb +0 -25
- data/templates/rails_app/config/spring.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf99b72362996a494129c8feca23e009e1e13394
|
4
|
+
data.tar.gz: 26fc41bb5d5438fc5182ee9f7b642eabb720c743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11a4676a4e52562ea77e37a925f545e40bd63b06ec383495da926379c6d55782cb80ac968f43341ea340d3b8b0161efbe1edf86b4e399c0400b5831b2f1d23c4
|
7
|
+
data.tar.gz: 6da0be1cadb3b59b28fe36bc5bddc2cfd0e1d0c03768fa10a06aba4eece536c87308fa265691be6ad223e467615d8bde39e015fc34b394a2c9916317f7293c00
|
data/lib/railman/version.rb
CHANGED
data/railman.gemspec
CHANGED
@@ -19,10 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 1.11"
|
21
21
|
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
-
spec.add_development_dependency "minitest", "~> 5.8"
|
23
22
|
spec.add_development_dependency "minitest-reporters", "~> 1.1"
|
24
23
|
spec.add_development_dependency "gem-release", "~> 0.7"
|
25
|
-
spec.add_development_dependency "geminabox", "~> 0.13"
|
26
24
|
spec.add_development_dependency "coveralls"
|
27
25
|
|
28
26
|
spec.add_dependency "thor", "~> 0.19"
|
@@ -2,8 +2,9 @@
|
|
2
2
|
.idea
|
3
3
|
.bundle
|
4
4
|
log/*
|
5
|
+
tmp/*
|
5
6
|
!/log/.keep
|
6
|
-
tmp
|
7
|
+
!/tmp/.keep
|
7
8
|
.env
|
8
9
|
|
9
10
|
coverage
|
@@ -13,6 +14,11 @@ test/screenshots
|
|
13
14
|
|
14
15
|
.sass-cache
|
15
16
|
public/assets
|
17
|
+
public/packs
|
16
18
|
refile_uploads
|
17
19
|
|
18
|
-
|
20
|
+
/node_modules
|
21
|
+
/yarn-error.log
|
22
|
+
|
23
|
+
brakeman-output.tabs
|
24
|
+
.byebug_history
|
data/templates/rails_app/Gemfile
CHANGED
@@ -6,23 +6,26 @@ git_source(:github) do |repo_name|
|
|
6
6
|
"https://github.com/#{repo_name}.git"
|
7
7
|
end
|
8
8
|
|
9
|
-
gem 'dotenv-rails', '2.
|
9
|
+
gem 'dotenv-rails', '2.2.1', require: 'dotenv/rails-now' # load ENV from .env
|
10
10
|
|
11
|
-
gem 'rails', '~> 5.1.0
|
11
|
+
gem 'rails', '~> 5.1.0'
|
12
12
|
gem 'pg', '0.18.2'
|
13
13
|
|
14
|
-
gem '
|
14
|
+
gem 'railman-ui' # bulma css framework + rails helpers
|
15
15
|
|
16
|
-
gem 'webpacker', '1.
|
16
|
+
gem 'webpacker', '1.2'
|
17
|
+
|
18
|
+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
|
19
|
+
# gem 'turbolinks', '~> 5'
|
17
20
|
|
18
21
|
gem 'hiredis', '0.6.1'
|
19
22
|
gem 'redis', '3.3.1', require: %w(redis redis/connection/hiredis)
|
23
|
+
gem 'redis-namespace', '1.5.2' # share same redis instance for multiple applications
|
20
24
|
gem 'redis-rails', '5.0.1'
|
21
25
|
|
22
26
|
gem 'sidekiq', '4.1.1' # backgroud jobs
|
23
27
|
gem 'sidekiq-scheduler', '2.0.6' # scheduled background jobs
|
24
|
-
gem '
|
25
|
-
gem 'sinatra', '2.0.0.beta2', :require => false # for sidekiq-web
|
28
|
+
gem 'sinatra', '2.0.0', :require => false # for sidekiq-web
|
26
29
|
|
27
30
|
gem 'puma', '~> 3.7'
|
28
31
|
|
@@ -30,15 +33,14 @@ gem 'railman-deployment', '~> 0.2' # capistrano deployment
|
|
30
33
|
|
31
34
|
gem 'exception_notification', '4.2.1' # exception notification per email
|
32
35
|
|
33
|
-
gem 'lograge', '~> 0.
|
36
|
+
gem 'lograge', '~> 0.5.0' # one-line-per-request log messages
|
34
37
|
|
35
38
|
group :development do
|
36
39
|
gem 'better_errors' # better error pages in development
|
37
40
|
gem 'binding_of_caller' # repl on the error page
|
41
|
+
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
|
42
|
+
gem 'web-console', '>= 3.3.0'
|
38
43
|
gem 'listen', '>= 3.0.5', '< 3.2'
|
39
|
-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
40
|
-
gem 'spring'
|
41
|
-
gem 'spring-watcher-listen', '~> 2.0.0'
|
42
44
|
gem 'annotate', '~> 2.7.1' # add comments to models with db column information
|
43
45
|
gem 'letter_opener', '1.4.1' # for email tests in development
|
44
46
|
# gem 'rack-mini-profiler'
|
@@ -49,9 +51,9 @@ group :test do
|
|
49
51
|
gem 'minitest-reporters', '1.1.7' # generate xml for jenkins
|
50
52
|
gem 'simplecov', require: false # generate coverage reports
|
51
53
|
gem 'simplecov-rcov', '0.2.3', require: false # generate coverage reports for jenkins
|
52
|
-
gem 'capybara', '2.
|
53
|
-
gem 'selenium-webdriver', '3.
|
54
|
-
gem 'poltergeist', '1.
|
54
|
+
gem 'capybara', '2.14.0' # dsl for browser tests
|
55
|
+
gem 'selenium-webdriver', '3.4.0' # use real browser for webtests
|
56
|
+
gem 'poltergeist', '1.15.0' # headless tests with phantom.js
|
55
57
|
end
|
56
58
|
|
57
59
|
# put additional application-specific gems to Gemfile.local
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
3
|
|
4
|
-
|
4
|
+
require_relative 'config/application'
|
5
5
|
|
6
6
|
Rails.application.load_tasks
|
@@ -1,2 +1,2 @@
|
|
1
|
-
@import "
|
1
|
+
@import "railman-ui"
|
2
2
|
@import "main"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<template>
|
2
|
+
<div id="app">
|
3
|
+
<p>{{ message }}</p>
|
4
|
+
</div>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<script>
|
8
|
+
export default {
|
9
|
+
data: function () {
|
10
|
+
return {
|
11
|
+
message: "Hello Vue!"
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
</script>
|
16
|
+
|
17
|
+
<style scoped>
|
18
|
+
p {
|
19
|
+
font-size: 2em;
|
20
|
+
text-align: center;
|
21
|
+
}
|
22
|
+
</style>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint no-console:0 */
|
1
2
|
// This file is automatically compiled by Webpack, along with any other files
|
2
3
|
// present in this directory. You're encouraged to place your actual application logic in
|
3
4
|
// a relevant structure within app/javascript and only use these pack files to reference
|
@@ -6,12 +7,4 @@
|
|
6
7
|
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
|
7
8
|
// layout file, like app/views/layouts/application.html.erb
|
8
9
|
|
9
|
-
|
10
|
-
import Hello from './hello.vue'
|
11
|
-
|
12
|
-
new Vue({
|
13
|
-
el: '#app',
|
14
|
-
template: '<Hello/>',
|
15
|
-
components: { Hello }
|
16
|
-
});
|
17
|
-
|
10
|
+
console.log('Hello World from Webpacker')
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/* eslint no-console: 0 */
|
2
|
+
// Run this example by adding <%= javascript_pack_tag 'hello_vue' %>
|
3
|
+
// to the head of your layout file,
|
4
|
+
// like app/views/layouts/application.html.erb.
|
5
|
+
// All it does is render <div>Hello Vue</div> at the bottom of the page.
|
6
|
+
|
7
|
+
import Vue from 'vue/dist/vue.esm'
|
8
|
+
import App from './app.vue'
|
9
|
+
|
10
|
+
document.addEventListener('DOMContentLoaded', () => {
|
11
|
+
document.body.appendChild(document.createElement('hello'))
|
12
|
+
const app = new Vue({
|
13
|
+
el: 'hello',
|
14
|
+
template: '<App/>',
|
15
|
+
components: { App }
|
16
|
+
})
|
17
|
+
|
18
|
+
console.log(app)
|
19
|
+
})
|
@@ -1,9 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
begin
|
3
|
-
load File.expand_path('../spring', __FILE__)
|
4
|
-
rescue LoadError => e
|
5
|
-
raise unless e.message.include?('spring')
|
6
|
-
end
|
7
2
|
APP_PATH = File.expand_path('../config/application', __dir__)
|
8
3
|
require_relative '../config/boot'
|
9
4
|
require 'rails/commands'
|
@@ -1,19 +1,33 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
$stdout.sync = true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require "shellwords"
|
5
|
+
require "yaml"
|
6
6
|
|
7
|
-
ENV[
|
8
|
-
|
7
|
+
ENV["RAILS_ENV"] ||= "development"
|
8
|
+
RAILS_ENV = ENV["RAILS_ENV"]
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
ENV["NODE_ENV"] ||= RAILS_ENV
|
11
|
+
NODE_ENV = ENV["NODE_ENV"]
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
APP_PATH = File.expand_path("../", __dir__)
|
14
|
+
CONFIG_PATH = File.join(APP_PATH, "config/webpack/paths.yml")
|
15
|
+
|
16
|
+
begin
|
17
|
+
paths = YAML.load(File.read(CONFIG_PATH))[NODE_ENV]
|
18
|
+
|
19
|
+
NODE_MODULES_PATH = File.join(APP_PATH.shellescape, paths["node_modules"])
|
20
|
+
WEBPACK_CONFIG_PATH = File.join(APP_PATH.shellescape, paths["config"])
|
21
|
+
rescue Errno::ENOENT, NoMethodError
|
22
|
+
puts "Configuration not found in config/webpack/paths.yml"
|
23
|
+
puts "Please run bundle exec rails webpacker:install to install webpacker"
|
24
|
+
exit!
|
25
|
+
end
|
26
|
+
|
27
|
+
WEBPACK_BIN = "#{NODE_MODULES_PATH}/.bin/webpack"
|
28
|
+
WEBPACK_CONFIG = "#{WEBPACK_CONFIG_PATH}/#{NODE_ENV}.js"
|
16
29
|
|
17
30
|
Dir.chdir(APP_PATH) do
|
18
|
-
exec "
|
31
|
+
exec "NODE_PATH=#{NODE_MODULES_PATH} #{WEBPACK_BIN} --config #{WEBPACK_CONFIG}" \
|
32
|
+
" #{ARGV.join(" ")}"
|
19
33
|
end
|
@@ -1,27 +1,33 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
$stdout.sync = true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require "shellwords"
|
5
|
+
require "yaml"
|
6
6
|
|
7
|
-
ENV[
|
8
|
-
|
7
|
+
ENV["RAILS_ENV"] ||= "development"
|
8
|
+
RAILS_ENV = ENV["RAILS_ENV"]
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
ENV["NODE_ENV"] ||= RAILS_ENV
|
11
|
+
NODE_ENV = ENV["NODE_ENV"]
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
WEBPACK_CONFIG = "#{ESCAPED_APP_PATH}/config/webpack/#{NODE_ENV}.js"
|
13
|
+
APP_PATH = File.expand_path("../", __dir__)
|
14
|
+
CONFIG_PATH = File.join(APP_PATH, "config/webpack/paths.yml")
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
begin
|
17
|
+
paths = YAML.load(File.read(CONFIG_PATH))[NODE_ENV]
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
NODE_MODULES_PATH = File.join(APP_PATH.shellescape, paths["node_modules"])
|
20
|
+
WEBPACK_CONFIG_PATH = File.join(APP_PATH.shellescape, paths["config"])
|
21
|
+
|
22
|
+
WEBPACK_BIN = "#{NODE_MODULES_PATH}/.bin/webpack-dev-server"
|
23
|
+
DEV_SERVER_CONFIG = "#{WEBPACK_CONFIG_PATH}/development.server.js"
|
24
|
+
rescue Errno::ENOENT, NoMethodError
|
25
|
+
puts "Configuration not found in config/webpacker/paths.yml."
|
26
|
+
puts "Please run bundle exec rails webpacker:install to install webpacker"
|
27
|
+
exit!
|
23
28
|
end
|
24
29
|
|
25
30
|
Dir.chdir(APP_PATH) do
|
26
|
-
exec "
|
31
|
+
exec "NODE_PATH=#{NODE_MODULES_PATH} #{WEBPACK_BIN} --progress --color " \
|
32
|
+
"--config #{DEV_SERVER_CONFIG} #{ARGV.join(" ")}"
|
27
33
|
end
|
@@ -4,7 +4,8 @@ Dir.chdir(VENDOR_PATH) do
|
|
4
4
|
begin
|
5
5
|
exec "yarnpkg #{ARGV.join(" ")}"
|
6
6
|
rescue Errno::ENOENT
|
7
|
-
puts "Yarn executable was not detected in the system."
|
8
|
-
puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
9
10
|
end
|
10
11
|
end
|
@@ -8,6 +8,9 @@ Bundler.require(*Rails.groups)
|
|
8
8
|
|
9
9
|
module <%= @config.class_name %>
|
10
10
|
class Application < Rails::Application
|
11
|
+
# Initialize configuration defaults for originally generated Rails version.
|
12
|
+
config.load_defaults 5.1
|
13
|
+
|
11
14
|
# Settings in config/environments/* take precedence over those specified here.
|
12
15
|
# Application configuration should go into files in config/initializers
|
13
16
|
# -- all .rb files in that directory are automatically loaded.
|
@@ -3,8 +3,8 @@ default: &default
|
|
3
3
|
encoding: unicode
|
4
4
|
host: localhost
|
5
5
|
port: 5432
|
6
|
-
username:
|
7
|
-
password:
|
6
|
+
username: <%%= ENV['DB_USER'] %>
|
7
|
+
password: <%%= ENV['DB_PASSWORD'] %>
|
8
8
|
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
9
9
|
timeout: 5000
|
10
10
|
|
@@ -1,7 +1,4 @@
|
|
1
1
|
Rails.application.configure do
|
2
|
-
# Make javascript_pack_tag load assets from webpack-dev-server.
|
3
|
-
config.x.webpacker[:dev_server_host] = "http://localhost:8080"
|
4
|
-
|
5
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
6
3
|
|
7
4
|
# In the development environment your application's code is reloaded on
|
@@ -1,7 +1,4 @@
|
|
1
1
|
Rails.application.configure do
|
2
|
-
# Make javascript_pack_tag lookup digest hash to enable long-term caching
|
3
|
-
config.x.webpacker[:digesting] = true
|
4
|
-
|
5
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
6
3
|
|
7
4
|
# Code is not reloaded between requests.
|
@@ -1,15 +1,14 @@
|
|
1
|
+
APP_ROOT = File.expand_path('../..', __FILE__)
|
2
|
+
|
3
|
+
require 'dotenv'
|
4
|
+
Dotenv.load
|
5
|
+
|
1
6
|
# Puma can serve each request in a thread from an internal thread pool.
|
2
7
|
# The `threads` method setting takes two numbers: a minimum and maximum.
|
3
8
|
# Any libraries that use thread pools should be configured to match
|
4
9
|
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
10
|
# and maximum; this matches the default thread size of Active Record.
|
6
11
|
#
|
7
|
-
|
8
|
-
APP_ROOT = File.expand_path('../..', __FILE__)
|
9
|
-
|
10
|
-
require 'dotenv'
|
11
|
-
Dotenv.load
|
12
|
-
|
13
12
|
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
14
13
|
threads threads_count, threads_count
|
15
14
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// Common configuration for webpacker loaded from config/webpack/paths.yml
|
2
|
+
|
3
|
+
const { join, resolve } = require('path')
|
4
|
+
const { env } = require('process')
|
5
|
+
const { safeLoad } = require('js-yaml')
|
6
|
+
const { readFileSync } = require('fs')
|
7
|
+
|
8
|
+
const configPath = resolve('config', 'webpack')
|
9
|
+
const loadersDir = join(__dirname, 'loaders')
|
10
|
+
const paths = safeLoad(readFileSync(join(configPath, 'paths.yml'), 'utf8'))[env.NODE_ENV]
|
11
|
+
const devServer = safeLoad(readFileSync(join(configPath, 'development.server.yml'), 'utf8'))[env.NODE_ENV]
|
12
|
+
|
13
|
+
// Compute public path based on environment and ASSET_HOST in production
|
14
|
+
const ifHasCDN = env.ASSET_HOST !== undefined && env.NODE_ENV === 'production'
|
15
|
+
const devServerUrl = `http://${devServer.host}:${devServer.port}/${paths.entry}/`
|
16
|
+
const publicUrl = ifHasCDN ? `${env.ASSET_HOST}/${paths.entry}/` : `/${paths.entry}/`
|
17
|
+
const publicPath = env.NODE_ENV !== 'production' ? devServerUrl : publicUrl
|
18
|
+
|
19
|
+
module.exports = {
|
20
|
+
devServer,
|
21
|
+
env,
|
22
|
+
paths,
|
23
|
+
loadersDir,
|
24
|
+
publicUrl,
|
25
|
+
publicPath
|
26
|
+
}
|