gnarails 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +21 -90
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +50 -0
  5. data/README.md +1 -34
  6. data/bin/ci_pronto +1 -1
  7. data/gnarails.gemspec +2 -3
  8. data/gnarly.rb +44 -137
  9. data/lib/gnarails/version.rb +1 -1
  10. data/templates/.circleci/config.yml +7 -2
  11. data/templates/Procfile +1 -0
  12. data/templates/{script → bin}/brakeman +1 -1
  13. data/templates/{script → bin}/ci_pronto +1 -1
  14. data/test-app/app/views/layouts/application.html.erb +4 -2
  15. data/test-app/spec/factories/job_postings.rb +1 -1
  16. metadata +9 -64
  17. data/bin/generate-react-test-app.sh +0 -2
  18. data/templates/.ruby-version +0 -1
  19. data/templates/Dockerfile-assets +0 -24
  20. data/templates/docker-compose.yml/docker-compose-webpack.yml +0 -26
  21. data/templates/react/.babelrc +0 -18
  22. data/templates/react/.eslintrc.js +0 -45
  23. data/templates/react/controllers/home_controller.rb +0 -4
  24. data/templates/react/js/Router/Router.jsx +0 -22
  25. data/templates/react/js/Router/index.js +0 -3
  26. data/templates/react/js/api/index.js +0 -17
  27. data/templates/react/js/api/sessions.js +0 -8
  28. data/templates/react/js/app_constants/index.js +0 -6
  29. data/templates/react/js/components/App/App.jsx +0 -15
  30. data/templates/react/js/components/App/App.tests.jsx +0 -15
  31. data/templates/react/js/components/App/_styles.scss +0 -3
  32. data/templates/react/js/components/App/index.js +0 -3
  33. data/templates/react/js/index.scss +0 -2
  34. data/templates/react/js/packs/main.jsx +0 -13
  35. data/templates/react/js/redux/entity_getter.js +0 -7
  36. data/templates/react/js/redux/history.js +0 -5
  37. data/templates/react/js/redux/initial_state.js +0 -5
  38. data/templates/react/js/redux/middlewares/authentication_middleware/authentication_middleware.tests.js +0 -109
  39. data/templates/react/js/redux/middlewares/authentication_middleware/helpers.js +0 -21
  40. data/templates/react/js/redux/middlewares/authentication_middleware/helpers.tests.js +0 -84
  41. data/templates/react/js/redux/middlewares/authentication_middleware/index.js +0 -20
  42. data/templates/react/js/redux/middlewares/index.js +0 -11
  43. data/templates/react/js/redux/nodes/app/actions.js +0 -36
  44. data/templates/react/js/redux/nodes/app/config.js +0 -12
  45. data/templates/react/js/redux/nodes/app/reducer.js +0 -35
  46. data/templates/react/js/redux/nodes/app/reducer.tests.js +0 -78
  47. data/templates/react/js/redux/reducers.js +0 -11
  48. data/templates/react/js/redux/store.js +0 -14
  49. data/templates/react/js/storage.js +0 -15
  50. data/templates/react/js/styles/_variables.scss +0 -1
  51. data/templates/react/js/test/.setup.js +0 -51
  52. data/templates/react/js/test/connect_wrapper.jsx +0 -28
  53. data/templates/react/js/test/create_request_mock.js +0 -29
  54. data/templates/react/js/test/mock_store.js +0 -12
  55. data/templates/react/layout.html.erb +0 -16
  56. data/templates/react/rails_routes.rb +0 -5
  57. data/templates/react/views/home/default.html.erb +0 -1
@@ -1,3 +1,3 @@
1
1
  module Gnarails
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -48,12 +48,12 @@ jobs:
48
48
  command: bundle exec bundle-audit update && bundle exec bundle-audit check
49
49
  - run:
50
50
  name: Brakeman
51
- command: ./script/brakeman
51
+ command: ./bin/brakeman
52
52
 
53
53
  # Pronto
54
54
  - run:
55
55
  name: Pronto
56
- command: ./script/ci_pronto
56
+ command: ./bin/ci_pronto
57
57
 
58
58
  # Save Brakeman
59
59
  - store_artifacts:
@@ -64,3 +64,8 @@ jobs:
64
64
  - store_artifacts:
65
65
  path: coverage
66
66
  destination: coverage
67
+
68
+ # Save Capybara Screenshots
69
+ - store_artifacts:
70
+ path: tmp/screenshots
71
+ destination: capybara/screenshots
@@ -0,0 +1 @@
1
+ web: bundle exec puma
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Script for running Brakeman tests
4
4
  # Brakeman is a security scanner https://github.com/presidentbeef/brakeman.
5
- gem install --no-rdoc --no-ri brakeman
5
+ gem install brakeman --no-document
6
6
 
7
7
  brakeman --exit-on-warn --separate-models -o tmp/brakeman.html -o tmp/brakeman.text .
8
8
  brakeman_exit_code=$?
@@ -3,4 +3,4 @@
3
3
  # Script for running pronto on CI
4
4
  export PRONTO_PULL_REQUEST_ID=${CI_PULL_REQUEST##*/}
5
5
 
6
- bundle exec pronto run -f text github_pr github_status -c origin/master
6
+ bundle exec pronto run -f text github_pr_review github_status -c origin/master
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en" role="main">
2
+ <html lang="en">
3
3
  <head>
4
4
  <title>RailsTestApp</title>
5
5
  <%= csrf_meta_tags %>
@@ -9,6 +9,8 @@
9
9
  </head>
10
10
 
11
11
  <body>
12
- <%= yield %>
12
+ <main>
13
+ <%= yield %>
14
+ </main>
13
15
  </body>
14
16
  </html>
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
2
  factory :job_posting do
3
- title "Software Developer"
3
+ title { "Software Developer" }
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnarails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Gnar Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-28 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,28 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.5
19
+ version: 5.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.5
27
- - !ruby/object:Gem::Dependency
28
- name: rspec-rails
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
26
+ version: 5.2.1
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: thor
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +148,6 @@ files:
162
148
  - Rakefile
163
149
  - bin/ci_pronto
164
150
  - bin/console
165
- - bin/generate-react-test-app.sh
166
151
  - bin/generate-test-app.sh
167
152
  - bin/setup
168
153
  - bin/test-setup.sh
@@ -182,53 +167,14 @@ files:
182
167
  - templates/.pronto.yml
183
168
  - templates/.rspec
184
169
  - templates/.rubocop.yml
185
- - templates/.ruby-version
186
170
  - templates/.scss-lint.yml
187
171
  - templates/Dockerfile
188
- - templates/Dockerfile-assets
172
+ - templates/Procfile
189
173
  - templates/README.md
174
+ - templates/bin/brakeman
175
+ - templates/bin/ci_pronto
190
176
  - templates/database.yml
191
177
  - templates/docker-compose.yml/docker-compose-standard.yml
192
- - templates/docker-compose.yml/docker-compose-webpack.yml
193
- - templates/react/.babelrc
194
- - templates/react/.eslintrc.js
195
- - templates/react/controllers/home_controller.rb
196
- - templates/react/js/Router/Router.jsx
197
- - templates/react/js/Router/index.js
198
- - templates/react/js/api/index.js
199
- - templates/react/js/api/sessions.js
200
- - templates/react/js/app_constants/index.js
201
- - templates/react/js/components/App/App.jsx
202
- - templates/react/js/components/App/App.tests.jsx
203
- - templates/react/js/components/App/_styles.scss
204
- - templates/react/js/components/App/index.js
205
- - templates/react/js/index.scss
206
- - templates/react/js/packs/main.jsx
207
- - templates/react/js/redux/entity_getter.js
208
- - templates/react/js/redux/history.js
209
- - templates/react/js/redux/initial_state.js
210
- - templates/react/js/redux/middlewares/authentication_middleware/authentication_middleware.tests.js
211
- - templates/react/js/redux/middlewares/authentication_middleware/helpers.js
212
- - templates/react/js/redux/middlewares/authentication_middleware/helpers.tests.js
213
- - templates/react/js/redux/middlewares/authentication_middleware/index.js
214
- - templates/react/js/redux/middlewares/index.js
215
- - templates/react/js/redux/nodes/app/actions.js
216
- - templates/react/js/redux/nodes/app/config.js
217
- - templates/react/js/redux/nodes/app/reducer.js
218
- - templates/react/js/redux/nodes/app/reducer.tests.js
219
- - templates/react/js/redux/reducers.js
220
- - templates/react/js/redux/store.js
221
- - templates/react/js/storage.js
222
- - templates/react/js/styles/_variables.scss
223
- - templates/react/js/test/.setup.js
224
- - templates/react/js/test/connect_wrapper.jsx
225
- - templates/react/js/test/create_request_mock.js
226
- - templates/react/js/test/mock_store.js
227
- - templates/react/layout.html.erb
228
- - templates/react/rails_routes.rb
229
- - templates/react/views/home/default.html.erb
230
- - templates/script/brakeman
231
- - templates/script/ci_pronto
232
178
  - templates/spec/support/factory_bot.rb
233
179
  - templates/spec/support/system_test_configuration.rb
234
180
  - test-app/app/controllers/job_postings_controller.rb
@@ -255,15 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
255
201
  requirements:
256
202
  - - ">="
257
203
  - !ruby/object:Gem::Version
258
- version: 2.5.0
204
+ version: 2.6.0
259
205
  required_rubygems_version: !ruby/object:Gem::Requirement
260
206
  requirements:
261
207
  - - ">="
262
208
  - !ruby/object:Gem::Version
263
209
  version: '0'
264
210
  requirements: []
265
- rubyforge_project:
266
- rubygems_version: 2.7.3
211
+ rubygems_version: 3.0.1
267
212
  signing_key:
268
213
  specification_version: 4
269
214
  summary: Easily create a gnarly rails app.
@@ -1,2 +0,0 @@
1
- #!/bin/bash
2
- bundle exec exe/gnarails new rails-react-test-app --webpack=react
@@ -1 +0,0 @@
1
- __ruby_version__
@@ -1,24 +0,0 @@
1
- FROM ruby:__ruby_version__
2
-
3
- # use a newer version of Node to use Yarn
4
- RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
5
-
6
- # nodejs: Rails needs a JS runtime
7
- # cmake: required by Rugged, dependency of Pronto
8
- RUN apt-get update -qq \
9
- && apt-get install -y -qq nodejs cmake
10
-
11
- RUN npm install -g yarn
12
-
13
- RUN mkdir /app
14
- WORKDIR /app
15
-
16
- ADD Gemfile /app/Gemfile
17
- ADD Gemfile.lock /app/Gemfile.lock
18
- RUN bundle install
19
-
20
- ADD package.json /app/package.json
21
- ADD yarn.lock /app/yarn.lock
22
- RUN yarn install
23
-
24
- ADD . /app
@@ -1,26 +0,0 @@
1
- version: '3'
2
- services:
3
- db:
4
- image: postgres
5
- assets:
6
- build:
7
- context: .
8
- dockerfile: Dockerfile-assets
9
- command: yarn start
10
- volumes:
11
- - .:/app
12
- - /app/node_modules
13
- env_file:
14
- - .env.docker-assets
15
- web:
16
- build: .
17
- command: bash -c 'rm -f tmp/pids/server.pid && bundle exec rails s --port 3000 --binding 0.0.0.0'
18
- volumes:
19
- - .:/app
20
- ports:
21
- - 3000:3000
22
- depends_on:
23
- - db
24
- - assets
25
- env_file:
26
- - .env.docker
@@ -1,18 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "env",
5
- {
6
- "modules": false,
7
- "targets": {
8
- "browsers": "> 1%",
9
- "uglify": true
10
- },
11
- "useBuiltIns": true
12
- }
13
- ],
14
- "react",
15
- "es2015",
16
- "stage-3"
17
- ],
18
- }
@@ -1,45 +0,0 @@
1
- var path = require('path');
2
-
3
- module.exports = {
4
- extends: 'airbnb',
5
- parser: 'babel-eslint',
6
- env: {
7
- 'node': true,
8
- 'mocha': true
9
- },
10
- globals: {
11
- 'expect': false,
12
- 'describe': false
13
- },
14
- rules: {
15
- 'consistent-return': 1,
16
- 'arrow-body-style': 0,
17
- 'max-len': 0,
18
- 'jsx-a11y/img-has-alt': 0,
19
- 'no-use-before-define': [2, 'nofunc'],
20
- 'no-unused-expressions': 0,
21
- 'no-console': 0,
22
- 'space-before-function-paren': 0,
23
- 'react/prefer-stateless-function': 0,
24
- 'react/no-multi-comp': 0,
25
- 'react/no-unused-prop-types': [1, { 'customValidators': [], skipShapeProps: true }],
26
- 'no-param-reassign': 0,
27
- 'new-cap': 0,
28
- 'import/no-unresolved': 'error',
29
- 'import/no-extraneous-dependencies': ['error', { 'devDependencies': true }],
30
- 'linebreak-style': 0,
31
- 'import/no-named-as-default': 'off',
32
- 'import/no-named-as-default-member': 'off',
33
- 'no-underscore-dangle': 0
34
- },
35
- settings: {
36
- 'import/resolver': {
37
- webpack: {
38
- config: path.join(__dirname, 'webpack.config.js')
39
- },
40
- node: {
41
- paths: 'app/javascript'
42
- }
43
- }
44
- }
45
- }
@@ -1,4 +0,0 @@
1
- class HomeController < ApplicationController
2
- def default
3
- end
4
- end
@@ -1,22 +0,0 @@
1
- import React, { Component } from 'react';
2
- import { Provider } from 'react-redux';
3
- import { ConnectedRouter } from 'react-router-redux'
4
- import { Route } from 'react-router';
5
-
6
- import App from 'components/App';
7
- import history from 'redux/history';
8
- import store from 'redux/store';
9
-
10
- export default class Router extends Component {
11
- render () {
12
- return (
13
- <Provider store={store}>
14
- <ConnectedRouter history={history}>
15
- <App>
16
- <h1>Welcome to Gnarails</h1>
17
- </App>
18
- </ConnectedRouter>
19
- </Provider>
20
- )
21
- }
22
- }
@@ -1,3 +0,0 @@
1
- import Router from './Router';
2
-
3
- export default Router;
@@ -1,17 +0,0 @@
1
- import Schlepp from 'schlepp';
2
-
3
- import appConstants from 'app_constants';
4
- import sessionMethods from 'api/sessions';
5
-
6
- class Api extends Schlepp {
7
- constructor(options) {
8
- super(options);
9
-
10
- this.sessions = sessionMethods(this);
11
- }
12
- }
13
-
14
- export default new Api({
15
- host: appConstants.API_HOST,
16
- bearerTokenKeyInLocalStorage: `${appConstants.APP_NAME}:auth_token`,
17
- });
@@ -1,8 +0,0 @@
1
- export default () => {
2
- return {
3
- create: ({ email, password }) => {
4
- return Promise.resolve({ email, password, jwt: 'jwt' });
5
- },
6
- destroy: () => Promise.resolve({}),
7
- };
8
- };
@@ -1,6 +0,0 @@
1
- const { origin } = global.window;
2
-
3
- export default {
4
- API_HOST: `${origin}/api`,
5
- APP_NAME: 'CHANGE_ME',
6
- };
@@ -1,15 +0,0 @@
1
- import React, { Component } from 'react';
2
- import { withRouter } from 'react-router-dom';
3
-
4
- class App extends Component {
5
- render () {
6
- const { children } = this.props;
7
- return (
8
- <div className="app">
9
- {children}
10
- </div>
11
- );
12
- }
13
- };
14
-
15
- export default withRouter(App);
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import expect from 'expect';
3
- import { mount } from 'enzyme';
4
-
5
- import App from 'components/App';
6
- import connectWrapper from 'test/connect_wrapper';
7
-
8
- describe('App - component', () => {
9
- it('renders', () => {
10
- const WrappedApp = connectWrapper(App);
11
- const Component = mount(<WrappedApp />);
12
-
13
- expect(Component.find('App').length).toEqual(1);
14
- });
15
- });
@@ -1,3 +0,0 @@
1
- .app {
2
- color: $black;
3
- }