react_on_rails 1.2.2 → 2.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +5 -126
- data/.babelrc +0 -3
- data/.coveralls.yml +0 -1
- data/.dockerignore +0 -2
- data/.eslintignore +0 -5
- data/.eslintrc +0 -48
- data/.gitignore +0 -26
- data/.jscsrc +0 -26
- data/.rspec +0 -2
- data/.rubocop.yml +0 -70
- data/.scss-lint.yml +0 -205
- data/.travis.yml +0 -41
- data/CHANGELOG.md +0 -42
- data/Dockerfile_tests +0 -12
- data/Gemfile +0 -38
- data/README.md +0 -363
- data/Rakefile +0 -5
- data/app/assets/javascripts/react_on_rails.js +0 -241
- data/app/helpers/react_on_rails_helper.rb +0 -224
- data/docker-compose.yml +0 -11
- data/docs/LICENSE +0 -21
- data/docs/additional_reading/heroku_deployment.md +0 -23
- data/docs/additional_reading/manual_installation.md +0 -142
- data/docs/additional_reading/node_dependencies_and_npm.md +0 -29
- data/docs/additional_reading/optional_configuration.md +0 -34
- data/docs/additional_reading/react-and-redux.md +0 -36
- data/docs/additional_reading/react_router.md +0 -45
- data/docs/additional_reading/server_rendering_tips.md +0 -16
- data/docs/additional_reading/tips.md +0 -10
- data/docs/additional_reading/webpack.md +0 -46
- data/docs/code_of_conduct.md +0 -13
- data/docs/coding-style/linters.md +0 -64
- data/docs/coding-style/style.md +0 -42
- data/docs/contributing.md +0 -62
- data/docs/generator_testing.md +0 -20
- data/docs/install_and_releasing.md +0 -24
- data/docs/sample_generated_js/README.md +0 -4
- data/docs/sample_generated_js/client-generated.js +0 -12
- data/docs/sample_generated_js/server-generated.js +0 -25
- data/lib/generators/USAGE +0 -99
- data/lib/generators/react_on_rails/base_generator.rb +0 -198
- data/lib/generators/react_on_rails/bootstrap_generator.rb +0 -91
- data/lib/generators/react_on_rails/dev_tests_generator.rb +0 -30
- data/lib/generators/react_on_rails/generator_errors.rb +0 -15
- data/lib/generators/react_on_rails/generator_helper.rb +0 -58
- data/lib/generators/react_on_rails/heroku_deployment_generator.rb +0 -30
- data/lib/generators/react_on_rails/install_generator.rb +0 -111
- data/lib/generators/react_on_rails/js_linters_generator.rb +0 -19
- data/lib/generators/react_on_rails/react_no_redux_generator.rb +0 -41
- data/lib/generators/react_on_rails/react_with_redux_generator.rb +0 -52
- data/lib/generators/react_on_rails/ruby_linters_generator.rb +0 -33
- data/lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt +0 -4
- data/lib/generators/react_on_rails/templates/base/base/REACT_ON_RAILS.md +0 -16
- data/lib/generators/react_on_rails/templates/base/base/app/controllers/hello_world_controller.rb +0 -5
- data/lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt +0 -5
- data/lib/generators/react_on_rails/templates/base/base/client/.babelrc +0 -3
- data/lib/generators/react_on_rails/templates/base/base/client/REACT_ON_RAILS_CLIENT_README.md +0 -3
- data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/globals.jsx.tt +0 -5
- data/lib/generators/react_on_rails/templates/base/base/client/index.jade +0 -15
- data/lib/generators/react_on_rails/templates/base/base/client/npm-shrinkwrap.json +0 -2907
- data/lib/generators/react_on_rails/templates/base/base/client/package.json.tt +0 -98
- data/lib/generators/react_on_rails/templates/base/base/client/server.js +0 -64
- data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js.tt +0 -67
- data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.hot.config.js.tt +0 -67
- data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js +0 -41
- data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +0 -28
- data/lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt +0 -26
- data/lib/generators/react_on_rails/templates/base/base/lib/tasks/linters.rake.tt +0 -88
- data/lib/generators/react_on_rails/templates/base/base/package.json +0 -31
- data/lib/generators/react_on_rails/templates/base/server_rendering/client/app/bundles/HelloWorld/startup/serverGlobals.jsx +0 -3
- data/lib/generators/react_on_rails/templates/base/server_rendering/client/webpack.server.rails.config.js +0 -40
- data/lib/generators/react_on_rails/templates/bootstrap/app/assets/stylesheets/_bootstrap-custom.scss +0 -63
- data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_post-bootstrap.scss +0 -10
- data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_pre-bootstrap.scss +0 -8
- data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_react-on-rails-sass-helper.scss +0 -19
- data/lib/generators/react_on_rails/templates/bootstrap/client/bootstrap-sass.config.js +0 -89
- data/lib/generators/react_on_rails/templates/dev_tests/.rspec +0 -2
- data/lib/generators/react_on_rails/templates/dev_tests/spec/features/hello_world_spec.rb +0 -25
- data/lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb +0 -57
- data/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb +0 -21
- data/lib/generators/react_on_rails/templates/dev_tests/spec/spec_helper.rb +0 -95
- data/lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks +0 -2
- data/lib/generators/react_on_rails/templates/heroku_deployment/Procfile +0 -1
- data/lib/generators/react_on_rails/templates/heroku_deployment/config/puma.rb +0 -15
- data/lib/generators/react_on_rails/templates/js_linters/client/.eslintignore +0 -1
- data/lib/generators/react_on_rails/templates/js_linters/client/.eslintrc +0 -48
- data/lib/generators/react_on_rails/templates/js_linters/client/.jscsrc +0 -18
- data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -39
- data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +0 -33
- data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt +0 -12
- data/lib/generators/react_on_rails/templates/no_redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx +0 -11
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx +0 -8
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -48
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/constants/helloWorldConstants.jsx +0 -8
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +0 -43
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx +0 -21
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/index.jsx +0 -14
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt +0 -21
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/store/helloWorldStore.jsx +0 -35
- data/lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js +0 -20
- data/lib/generators/react_on_rails/templates/redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx +0 -21
- data/lib/generators/react_on_rails/templates/ruby_linters/.rubocop.yml +0 -26
- data/lib/generators/react_on_rails/templates/ruby_linters/.scss-lint.yml +0 -205
- data/lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/brakeman.rake +0 -17
- data/lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/ci.rake +0 -33
- data/lib/generators/react_on_rails/templates/ruby_linters/ruby-lint.yml +0 -20
- data/lib/react_on_rails.rb +0 -6
- data/lib/react_on_rails/configuration.rb +0 -53
- data/lib/react_on_rails/engine.rb +0 -7
- data/lib/react_on_rails/prerender_error.rb +0 -31
- data/lib/react_on_rails/server_rendering_pool.rb +0 -111
- data/lib/react_on_rails/version.rb +0 -3
- data/rakelib/docker.rake +0 -33
- data/rakelib/dummy_apps.rake +0 -29
- data/rakelib/example_type.rb +0 -160
- data/rakelib/examples.rake +0 -103
- data/rakelib/examples_config.yml +0 -19
- data/rakelib/lint.rake +0 -37
- data/rakelib/run_rspec.rake +0 -65
- data/rakelib/task_helpers.rb +0 -44
- data/react_on_rails.gemspec +0 -31
- data/ruby-lint.yml +0 -24
@@ -1,31 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "react-webpack-rails-tutorial",
|
3
|
-
"version": "1.1.1",
|
4
|
-
"description": "Built using the react_on_rails generator. Allows you to run npm install from root.",
|
5
|
-
"main": "server.js",
|
6
|
-
"engines": {
|
7
|
-
"node": "4.2.0",
|
8
|
-
"npm": "3.3.6"
|
9
|
-
},
|
10
|
-
"scripts": {
|
11
|
-
"postinstall": "cd client && npm install",
|
12
|
-
"test": "rspec && (cd client && npm run lint)"
|
13
|
-
},
|
14
|
-
"repository": {
|
15
|
-
"type": "git",
|
16
|
-
"url": "https://github.com/shakacode/react-webpack-rails-tutorial.git"
|
17
|
-
},
|
18
|
-
"keywords": [
|
19
|
-
"react",
|
20
|
-
"tutorial",
|
21
|
-
"comment",
|
22
|
-
"example"
|
23
|
-
],
|
24
|
-
"author": "justin808",
|
25
|
-
"license": "MIT",
|
26
|
-
"bugs": {
|
27
|
-
"url": "https://github.com/shakacode/react-webpack-rails-tutorial/issues"
|
28
|
-
},
|
29
|
-
"homepage": "https://github.com/shakacode/react-webpack-rails-tutorial",
|
30
|
-
"dependencies": {}
|
31
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
// Webpack configuration for server bundle
|
2
|
-
|
3
|
-
const webpack = require('webpack');
|
4
|
-
const path = require('path');
|
5
|
-
|
6
|
-
const devBuild = process.env.NODE_ENV !== 'production';
|
7
|
-
const nodeEnv = devBuild ? 'development' : 'production';
|
8
|
-
|
9
|
-
module.exports = {
|
10
|
-
|
11
|
-
// the project dir
|
12
|
-
context: __dirname,
|
13
|
-
entry: ['./app/bundles/HelloWorld/startup/serverGlobals', 'react', 'react-dom/server'],
|
14
|
-
output: {
|
15
|
-
filename: 'server-bundle.js',
|
16
|
-
path: '../app/assets/javascripts/generated',
|
17
|
-
},
|
18
|
-
resolve: {
|
19
|
-
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', 'config.js'],
|
20
|
-
alias: {
|
21
|
-
lib: path.join(process.cwd(), 'app', 'lib'),
|
22
|
-
},
|
23
|
-
},
|
24
|
-
plugins: [
|
25
|
-
new webpack.DefinePlugin({
|
26
|
-
'process.env': {
|
27
|
-
NODE_ENV: JSON.stringify('production'),
|
28
|
-
},
|
29
|
-
}),
|
30
|
-
],
|
31
|
-
module: {
|
32
|
-
loaders: [
|
33
|
-
{test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/},
|
34
|
-
|
35
|
-
// React is necessary for the client rendering:
|
36
|
-
{test: require.resolve('react'), loader: 'expose?React'},
|
37
|
-
{test: require.resolve('react-dom/server'), loader: 'expose?ReactDOMServer'},
|
38
|
-
],
|
39
|
-
},
|
40
|
-
};
|
data/lib/generators/react_on_rails/templates/bootstrap/app/assets/stylesheets/_bootstrap-custom.scss
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
// This file loads Bootstrap by importing components explicitly instead of doing `@import 'bootstrap';`
|
2
|
-
// Doing so allows for customization of exactly which components are imported.
|
3
|
-
// The components themselves are made available via bootstrap-sass (https://github.com/twbs/bootstrap-sass#sass)
|
4
|
-
|
5
|
-
// IMPORTANT: Make sure to keep the customizations defined in this file
|
6
|
-
// in-sync with the ones defined in client/bootstrap-sass.config.js.
|
7
|
-
|
8
|
-
// For a reference on customizations,refer to:
|
9
|
-
// https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/_bootstrap.scss
|
10
|
-
|
11
|
-
// If you are looking to merely change bootstrap variables from their default,
|
12
|
-
// you should instead declare them in client/assets/stylesheets/_post-bootstrap.scss
|
13
|
-
|
14
|
-
// Core variables and mixins
|
15
|
-
@import 'bootstrap/variables';
|
16
|
-
@import 'bootstrap/mixins';
|
17
|
-
|
18
|
-
// Reset and dependencies
|
19
|
-
@import 'bootstrap/normalize';
|
20
|
-
@import 'bootstrap/print';
|
21
|
-
@import 'bootstrap/glyphicons';
|
22
|
-
|
23
|
-
// Core CSS
|
24
|
-
@import 'bootstrap/scaffolding';
|
25
|
-
@import 'bootstrap/type';
|
26
|
-
@import 'bootstrap/code';
|
27
|
-
@import 'bootstrap/grid';
|
28
|
-
@import 'bootstrap/tables';
|
29
|
-
@import 'bootstrap/forms';
|
30
|
-
@import 'bootstrap/buttons';
|
31
|
-
|
32
|
-
// Components
|
33
|
-
@import 'bootstrap/component-animations';
|
34
|
-
@import 'bootstrap/dropdowns';
|
35
|
-
@import 'bootstrap/button-groups';
|
36
|
-
@import 'bootstrap/input-groups';
|
37
|
-
@import 'bootstrap/navs';
|
38
|
-
@import 'bootstrap/navbar';
|
39
|
-
@import 'bootstrap/breadcrumbs';
|
40
|
-
@import 'bootstrap/pagination';
|
41
|
-
@import 'bootstrap/pager';
|
42
|
-
@import 'bootstrap/labels';
|
43
|
-
@import 'bootstrap/badges';
|
44
|
-
@import 'bootstrap/jumbotron';
|
45
|
-
@import 'bootstrap/thumbnails';
|
46
|
-
@import 'bootstrap/alerts';
|
47
|
-
@import 'bootstrap/progress-bars';
|
48
|
-
@import 'bootstrap/media';
|
49
|
-
@import 'bootstrap/list-group';
|
50
|
-
@import 'bootstrap/panels';
|
51
|
-
@import 'bootstrap/responsive-embed';
|
52
|
-
@import 'bootstrap/wells';
|
53
|
-
@import 'bootstrap/close';
|
54
|
-
|
55
|
-
// Components w/ JavaScript
|
56
|
-
@import 'bootstrap/modals';
|
57
|
-
@import 'bootstrap/tooltip';
|
58
|
-
@import 'bootstrap/popovers';
|
59
|
-
@import 'bootstrap/carousel';
|
60
|
-
|
61
|
-
// Utility classes
|
62
|
-
@import 'bootstrap/utilities';
|
63
|
-
@import 'bootstrap/responsive-utilities';
|
@@ -1,10 +0,0 @@
|
|
1
|
-
// The Rails server imports this file via app/assets/stylesheets/application.css.scss
|
2
|
-
// The webpack HMR dev server loads this file via client/bootstrap-sass.config.js
|
3
|
-
|
4
|
-
// In either case, this file is loaded AFTER bootstrap has been loaded.
|
5
|
-
// This is where you can add your own styles and override bootstrap styles
|
6
|
-
// utilizing bootstrap variables and mixins.
|
7
|
-
|
8
|
-
.this-works {
|
9
|
-
color: orange !important;
|
10
|
-
}
|
data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_pre-bootstrap.scss
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
// The Rails server imports this file via app/assets/stylesheets/application.css.scss
|
2
|
-
// The webpack HMR dev server loads this file via client/bootstrap-sass.config.js
|
3
|
-
|
4
|
-
// In either case, this file is loaded BEFORE bootstrap has been loaded.
|
5
|
-
// Use it to define variables BEFORE bootstrap loads. See http://getbootstrap.com/customize/
|
6
|
-
|
7
|
-
// This is a file that provides a fallback for `img-url` and fonts
|
8
|
-
@import 'react-on-rails-sass-helper';
|
@@ -1,19 +0,0 @@
|
|
1
|
-
// The Rails server imports this file via app/assets/stylesheets/application.css.scss
|
2
|
-
// The webpack HMR dev server loads this file via client/bootstrap-sass.config.js
|
3
|
-
|
4
|
-
// This file allows the same sass code with Rails and node-sass for the Webpack Dev Server.
|
5
|
-
// It is CRTICAL that this file is loaded first.
|
6
|
-
|
7
|
-
$rails: false !default; // defaults to false (e.g. webpack environment)
|
8
|
-
|
9
|
-
// Sass 3 removes image-url helper
|
10
|
-
// https://github.com/sass/libsass/issues/489
|
11
|
-
$image-url-path: '/assets/images/' !default;
|
12
|
-
|
13
|
-
@function img-url($image) {
|
14
|
-
@if $rails {
|
15
|
-
@return image-url($image);
|
16
|
-
} @else {
|
17
|
-
@return url('#{$image-url-path}#{$image}');
|
18
|
-
}
|
19
|
-
}
|
@@ -1,89 +0,0 @@
|
|
1
|
-
// See https://github.com/shakacode/bootstrap-sass-loader for more information
|
2
|
-
|
3
|
-
// IMPORTANT: Make sure to keep the customizations defined in this file
|
4
|
-
// in-sync with the ones defined in app/assets/stylesheets/_bootstrap-custom.scss.
|
5
|
-
|
6
|
-
// For a reference on customizations,refer to:
|
7
|
-
// https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/_bootstrap.scss
|
8
|
-
|
9
|
-
module.exports = {
|
10
|
-
bootstrapCustomizations: './assets/stylesheets/_pre-bootstrap.scss',
|
11
|
-
mainSass: './assets/stylesheets/_post-bootstrap.scss',
|
12
|
-
|
13
|
-
// Default for the style loading is to put in your js files
|
14
|
-
// styleLoader: 'style-loader!css-loader!sass-loader',
|
15
|
-
|
16
|
-
// See: https://github.com/sass/node-sass#outputstyle
|
17
|
-
// https://github.com/sass/node-sass#imagepath
|
18
|
-
styleLoader: 'style-loader!css-loader!sass-loader?imagePath=/assets/images',
|
19
|
-
|
20
|
-
// ### Scripts
|
21
|
-
// Any scripts here set to false will never make it to the client,
|
22
|
-
// i.e. it's not packaged by webpack.
|
23
|
-
scripts: {
|
24
|
-
transition: true,
|
25
|
-
alert: true,
|
26
|
-
button: true,
|
27
|
-
|
28
|
-
carousel: true,
|
29
|
-
collapse: true,
|
30
|
-
dropdown: true,
|
31
|
-
|
32
|
-
modal: true,
|
33
|
-
tooltip: true,
|
34
|
-
popover: true,
|
35
|
-
scrollspy: true,
|
36
|
-
tab: true,
|
37
|
-
affix: true,
|
38
|
-
},
|
39
|
-
|
40
|
-
// ### Styles
|
41
|
-
// Enable or disable certain less components and thus remove
|
42
|
-
// the css for them from the build.
|
43
|
-
styles: {
|
44
|
-
mixins: true,
|
45
|
-
|
46
|
-
normalize: true,
|
47
|
-
print: true,
|
48
|
-
|
49
|
-
scaffolding: true,
|
50
|
-
type: true,
|
51
|
-
code: true,
|
52
|
-
grid: true,
|
53
|
-
tables: true,
|
54
|
-
forms: true,
|
55
|
-
buttons: true,
|
56
|
-
|
57
|
-
'component-animations': true,
|
58
|
-
glyphicons: true,
|
59
|
-
dropdowns: true,
|
60
|
-
'button-groups': true,
|
61
|
-
'input-groups': true,
|
62
|
-
navs: true,
|
63
|
-
navbar: true,
|
64
|
-
breadcrumbs: true,
|
65
|
-
pagination: true,
|
66
|
-
pager: true,
|
67
|
-
labels: true,
|
68
|
-
badges: true,
|
69
|
-
|
70
|
-
jumbotron: true,
|
71
|
-
thumbnails: true,
|
72
|
-
alerts: true,
|
73
|
-
|
74
|
-
'progress-bars': true,
|
75
|
-
media: true,
|
76
|
-
'list-group': true,
|
77
|
-
panels: true,
|
78
|
-
wells: true,
|
79
|
-
close: true,
|
80
|
-
|
81
|
-
modals: true,
|
82
|
-
tooltip: true,
|
83
|
-
popovers: true,
|
84
|
-
carousel: true,
|
85
|
-
|
86
|
-
utilities: true,
|
87
|
-
'responsive-utilities': true,
|
88
|
-
},
|
89
|
-
};
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require_relative "../rails_helper"
|
2
|
-
|
3
|
-
feature "Hello World", js: true do
|
4
|
-
scenario "the hello world example works" do
|
5
|
-
visit "/hello_world"
|
6
|
-
expect(heading).to have_text("Rendering")
|
7
|
-
expect(message).to have_text("Stranger")
|
8
|
-
name_input.set("John Doe")
|
9
|
-
expect(message).to have_text("John Doe")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def name_input
|
16
|
-
page.first("input")
|
17
|
-
end
|
18
|
-
|
19
|
-
def message
|
20
|
-
page.first(:css, "h3")
|
21
|
-
end
|
22
|
-
|
23
|
-
def heading
|
24
|
-
page.first(:css, "h1")
|
25
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# This file is copied to spec/ when you run "rails generate rspec:install"
|
2
|
-
ENV["RAILS_ENV"] ||= "test"
|
3
|
-
require_relative "../config/environment"
|
4
|
-
require_relative "simplecov_helper"
|
5
|
-
# Prevent database truncation if the environment is production
|
6
|
-
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
7
|
-
require_relative "spec_helper"
|
8
|
-
|
9
|
-
# Add additional requires below this line. Rails is not loaded until this point!
|
10
|
-
|
11
|
-
require "rspec/rails"
|
12
|
-
require "capybara/rspec"
|
13
|
-
require "capybara/rails"
|
14
|
-
|
15
|
-
# Requires supporting ruby files with custom matchers and macros, etc, in
|
16
|
-
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
17
|
-
# run as spec files by default. This means that files in spec/support that end
|
18
|
-
# in _spec.rb will both be required and run as specs, causing the specs to be
|
19
|
-
# run twice. It is recommended that you do not name files matching this glob to
|
20
|
-
# end with _spec.rb. You can configure this pattern with the --pattern
|
21
|
-
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
22
|
-
#
|
23
|
-
# The following line is provided for convenience purposes. It has the downside
|
24
|
-
# of increasing the boot-up time by auto-requiring all files in the support
|
25
|
-
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
26
|
-
# require only the support files necessary.
|
27
|
-
#
|
28
|
-
# Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
29
|
-
|
30
|
-
# Checks for pending migrations before tests are run.
|
31
|
-
# If you are not using ActiveRecord, you can remove this line.
|
32
|
-
# ActiveRecord::Migration.maintain_test_schema!
|
33
|
-
|
34
|
-
RSpec.configure do |config|
|
35
|
-
# Remove this line if you"re not using ActiveRecord or ActiveRecord fixtures
|
36
|
-
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
37
|
-
|
38
|
-
# If you"re not using ActiveRecord, or you"d prefer not to run each of your
|
39
|
-
# examples within a transaction, remove the following line or assign false
|
40
|
-
# instead of true.
|
41
|
-
config.use_transactional_fixtures = true
|
42
|
-
|
43
|
-
# RSpec Rails can automatically mix in different behaviours to your tests
|
44
|
-
# based on their file location, for example enabling you to call `get` and
|
45
|
-
# `post` in specs under `spec/controllers`.
|
46
|
-
#
|
47
|
-
# You can disable this behaviour by removing the line below, and instead
|
48
|
-
# explicitly tag your specs with their type, e.g.:
|
49
|
-
#
|
50
|
-
# RSpec.describe UsersController, :type => :controller do
|
51
|
-
# # ...
|
52
|
-
# end
|
53
|
-
#
|
54
|
-
# The different available types are documented in the features, such as in
|
55
|
-
# https://relishapp.com/rspec/rspec-rails/docs
|
56
|
-
config.infer_spec_type_from_file_location!
|
57
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Starts SimpleCov for code coverage.
|
2
|
-
|
3
|
-
if ENV["COVERAGE"]
|
4
|
-
require "simplecov"
|
5
|
-
|
6
|
-
# Using a command name prevents results from getting clobbered by other test suites
|
7
|
-
example_name = File.basename(File.expand_path("../../../.", __FILE__))
|
8
|
-
SimpleCov.command_name(example_name)
|
9
|
-
|
10
|
-
SimpleCov.start("rails") do
|
11
|
-
# Consider the entire gem project as the root
|
12
|
-
# (typically this will be the folder named "react_on_rails")
|
13
|
-
gem_root_path = File.expand_path("../../../../.", __FILE__)
|
14
|
-
root gem_root_path
|
15
|
-
|
16
|
-
# Don't report anything that has "spec" in the path
|
17
|
-
add_filter do |src|
|
18
|
-
src.filename =~ %r{\/spec\/}
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,95 +0,0 @@
|
|
1
|
-
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
2
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
-
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
-
# files.
|
6
|
-
#
|
7
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
-
# a separate helper file that requires the additional dependencies and performs
|
12
|
-
# the additional setup, and require it from the spec files that actually need
|
13
|
-
# it.
|
14
|
-
#
|
15
|
-
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
-
# users commonly want.
|
17
|
-
#
|
18
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
-
RSpec.configure do |config|
|
20
|
-
# rspec-expectations config goes here. You can use an alternate
|
21
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
-
# assertions if you prefer.
|
23
|
-
config.expect_with :rspec do |expectations|
|
24
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
-
# and `failure_message` of custom matchers include text for helper methods
|
26
|
-
# defined using `chain`, e.g.:
|
27
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
-
# # => "be bigger than 2 and smaller than 4"
|
29
|
-
# ...rather than:
|
30
|
-
# # => "be bigger than 2"
|
31
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
-
end
|
33
|
-
|
34
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
-
config.mock_with :rspec do |mocks|
|
37
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
-
# a real object. This is generally recommended, and will default to
|
39
|
-
# `true` in RSpec 4.
|
40
|
-
mocks.verify_partial_doubles = true
|
41
|
-
end
|
42
|
-
|
43
|
-
# The settings below are suggested to provide a good initial experience
|
44
|
-
# with RSpec, but feel free to customize to your heart's content.
|
45
|
-
# rubocop:disable Style/BlockComments
|
46
|
-
=begin
|
47
|
-
|
48
|
-
# These two settings work together to allow you to limit a spec run
|
49
|
-
# to individual examples or groups you care about by tagging them with
|
50
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
51
|
-
# get run.
|
52
|
-
config.filter_run :focus
|
53
|
-
config.run_all_when_everything_filtered = true
|
54
|
-
|
55
|
-
# Allows RSpec to persist some state between runs in order to support
|
56
|
-
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
57
|
-
# you configure your source control system to ignore this file.
|
58
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
59
|
-
|
60
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
61
|
-
# recommended. For more details, see:
|
62
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
63
|
-
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
64
|
-
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
65
|
-
config.disable_monkey_patching!
|
66
|
-
|
67
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
68
|
-
# file, and it's useful to allow more verbose output when running an
|
69
|
-
# individual spec file.
|
70
|
-
if config.files_to_run.one?
|
71
|
-
# Use the documentation formatter for detailed output,
|
72
|
-
# unless a formatter has already been configured
|
73
|
-
# (e.g. via a command-line flag).
|
74
|
-
config.default_formatter = 'doc'
|
75
|
-
end
|
76
|
-
|
77
|
-
# Print the 10 slowest examples and example groups at the
|
78
|
-
# end of the spec run, to help surface which specs are running
|
79
|
-
# particularly slow.
|
80
|
-
config.profile_examples = 10
|
81
|
-
|
82
|
-
# Run specs in random order to surface order dependencies. If you find an
|
83
|
-
# order dependency and want to debug it, you can fix the order by providing
|
84
|
-
# the seed, which is printed after each run.
|
85
|
-
# --seed 1234
|
86
|
-
config.order = :random
|
87
|
-
|
88
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
89
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
90
|
-
# test failures related to randomization by passing the same `--seed` value
|
91
|
-
# as the one that triggered the failure.
|
92
|
-
Kernel.srand config.seed
|
93
|
-
=end
|
94
|
-
end
|
95
|
-
# rubocop:enable Style/BlockComments
|