Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update template, split toys into gems #57

Merged
merged 62 commits into from Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
918408b
Split `toys` into external gems
AlexWayfer Apr 21, 2020
9752e8a
Update to a new gem template
AlexWayfer Aug 2, 2020
f9be9a7
Update application template, finally split toys into gems
AlexWayfer Aug 2, 2020
bdeb352
Remove Ruby 2.5 from CI
AlexWayfer Aug 2, 2020
87d36c4
Update a template again
AlexWayfer Aug 21, 2020
148167e
Add tests via `rack-test`, update code a bit
AlexWayfer Sep 21, 2020
fa4bea2
Drop extra `TargetRubyVersion` for RuboCop
AlexWayfer Sep 23, 2020
2487acf
Delete unused `rubocop` toys tool
AlexWayfer Sep 23, 2020
696340c
Use `pnpm run` instead of `npm run`
AlexWayfer Sep 23, 2020
1b7b6f0
Update setup instruction in the README
AlexWayfer Sep 23, 2020
bebc58b
Don't use extra `Bundler.with_unbundled_env` in specs
AlexWayfer Sep 23, 2020
574469a
Update template again
AlexWayfer Sep 23, 2020
b7da510
Add `--domain` option
AlexWayfer Nov 11, 2020
1cbe688
Fix path to index from 404 view
AlexWayfer Nov 11, 2020
6503006
Simplify `constants.rb`
AlexWayfer Nov 11, 2020
acfa3f8
Add small helper JS script for custom confirmations on forms submitting
AlexWayfer Nov 11, 2020
17d43d4
Update styles, especially for forms
AlexWayfer Nov 11, 2020
6167b3b
Redirect Puma output into file for production environment
AlexWayfer Nov 11, 2020
3d55dc3
Add forgotten `highlighted_backtrace_for(exception)` for 500 error page
AlexWayfer Nov 11, 2020
dda5f69
Fix code documentation a bit
AlexWayfer Nov 11, 2020
cffe646
Move `git pull` commands from `setup.sh` to `update.sh`
AlexWayfer Nov 11, 2020
77f2412
Add forgotten locales for errors pages
AlexWayfer Nov 11, 2020
d698b05
Improve arrays of assets in `layout.html.erb`
AlexWayfer Nov 11, 2020
a49c200
Replace relative path for Puma's UNIX socket with `/run`
AlexWayfer Nov 11, 2020
dbc9f58
Fix general assets linting, add specs for this
AlexWayfer Nov 11, 2020
a32ea52
Fix `@app_name` render in `configserver.example.yaml`
AlexWayfer Nov 11, 2020
c291469
Merge inherited `Include` and `Exclude` in RuboCop config
AlexWayfer Nov 16, 2020
6446c8d
Replace `<%= "<\%` with `<%%`
AlexWayfer Nov 16, 2020
a4038b7
Add `nginx` config example files
AlexWayfer Nov 16, 2020
4cb3388
Rename `.cirrus.yml` to `.yaml`
AlexWayfer Nov 16, 2020
40eaf96
Add `bundle audit` dependency and CI task
AlexWayfer Nov 16, 2020
cb34228
Fix `setup/ruby` script in tests, avoid current Bundler
AlexWayfer Nov 17, 2020
188f447
Add `bundle audit` spec for generated application
AlexWayfer Nov 17, 2020
f468704
Fix duplicate `bundler-audit` gem in template
AlexWayfer Nov 17, 2020
b951625
Add `<header>` and `<footer>` into `site/layout`
AlexWayfer Nov 17, 2020
710a926
Add specs for `--domain` option
AlexWayfer Nov 17, 2020
388a941
Add `--project-name` option for `new app` CLI
AlexWayfer Nov 18, 2020
9013fe4
Simplify `new app generation` specs
AlexWayfer Nov 18, 2020
11800da
Lock template to the latest Ruby version
AlexWayfer Nov 18, 2020
6f3e9bf
Improve required Ruby version lock, avoid 3.0
AlexWayfer Nov 18, 2020
c767527
Update required Ruby version to 2.7 as template requires
AlexWayfer Nov 18, 2020
0ec6566
Drop `rspec` and `rubocop` toys, just use `bundle exec`
AlexWayfer Nov 18, 2020
d5f9bf3
Use default `ruby` image for `rubocop` CI task
AlexWayfer Nov 18, 2020
de80a0e
Move glob files patterns in `rspec` CI task to a separate line
AlexWayfer Nov 18, 2020
d7b8033
Setup `rbenv` and `nodenv` for `rspec` CI task
AlexWayfer Nov 18, 2020
d21dd89
Return Ruby 2.6 support for the gem itself
AlexWayfer Nov 18, 2020
5d082c7
Delete `.ruby-version` file inside template, now there is a `rbenv` s…
AlexWayfer Nov 18, 2020
983f5eb
Change Linux distribution from `alpine` to `fedora` for `rspec` CI task
AlexWayfer Nov 18, 2020
838f4f3
Install `git` and `which` required for `rbenv` and `nodenv`
AlexWayfer Nov 18, 2020
854884b
Improve OS setup script for CI
AlexWayfer Nov 18, 2020
cd43f11
Change Docker image from `fedora` to `ruby` for `rspec` CI task
AlexWayfer Nov 19, 2020
c9eaf59
Fix `rbenv` and `nodenv` in `rspec` CI task
AlexWayfer Nov 19, 2020
d29f8b8
Don't establish database connection without models
AlexWayfer Nov 19, 2020
ab39451
Comment `import 'core-js/'` code, it's not always necessary
AlexWayfer Nov 19, 2020
caf37db
Cache `rbenv` and `nodenv` in CI
AlexWayfer Nov 19, 2020
b583509
Make `rbenv` and `nodenv` cache uploading always
AlexWayfer Nov 19, 2020
2394b8a
Increase waiting for application start in specs
AlexWayfer Nov 19, 2020
84c549f
Rescue an exception in tests when server already stopped
AlexWayfer Dec 1, 2020
563ddac
Remove `cat ~/.bashrc` in CI for debugging
AlexWayfer Dec 1, 2020
ec7d5dd
Fix `~/.bashrc` for Cirrus CI
AlexWayfer Dec 1, 2020
104aecf
Update dependencies
AlexWayfer Dec 1, 2020
a9591fc
Add `systemd` service example
AlexWayfer Dec 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
114 changes: 114 additions & 0 deletions .cirrus.yaml
@@ -0,0 +1,114 @@
bundle_cache: &bundle_cache
bundle_cache:
folder: /usr/local/bundle
fingerprint_script:
- echo $CIRRUS_OS
- ruby -v
- cat Gemfile
- cat *.gemspec
install_script:
- gem install bundler
- bundle update

remark_task:
container:
image: node
node_modules_cache:
folder: node_modules
fingerprint_script:
- echo $CIRRUS_OS
- node -v
- cat package.json
install_script: npm install
lint_script: npm run remark
only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'package.json', '.remarkrc.yaml', '**.md'
)

bundle-audit_task:
container:
image: ruby
<<: *bundle_cache
bundle-audit_script: bundle audit check --update
only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'Gemfile', '*.gemspec'
)

rubocop_task:
container:
image: ruby
<<: *bundle_cache
lint_script: bundle exec rubocop
only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'Gemfile', 'Rakefile', '.rubocop.yml', '*.gemspec',
'**.rb', '**.ru'
)

rspec_task:

depends_on:
- remark
- rubocop

container:
## https://cirrus-ci.com/task/5233441622982656?command=bundle#L3
image: ruby

os_setup_script:
## https://cirrus-ci.com/task/6357513148825600
## https://cirrus-ci.com/task/6270527041961984?command=os_setup#L535
- apt update && apt upgrade -y && apt install git make gcc -y

## Modify `.bashrc` here because it doesn't run on cache hit:
## https://cirrus-ci.com/task/6153771409473536?command=test#L42

## https://cirrus-ci.com/task/6270527041961984?command=os_setup#L543
- echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
## https://cirrus-ci.com/task/5656294977699840?command=os_setup#L633
- echo 'eval "$(rbenv init -)"' >> ~/.bashrc

## https://cirrus-ci.com/task/6270527041961984?command=os_setup#L543
- echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc
## https://cirrus-ci.com/task/5656294977699840?command=os_setup#L633
- echo 'eval "$(nodenv init -)"' >> ~/.bashrc

always:
rbenv_cache:
folder: $HOME/.rbenv
populate_script:
- git clone https://github.com/rbenv/rbenv.git ~/.rbenv

- source ~/.bashrc

## https://github.com/rbenv/ruby-build#installation
- mkdir -p "$(rbenv root)"/plugins
- git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

nodenv_cache:
folder: $HOME/.nodenv
populate_script:
- git clone https://github.com/nodenv/nodenv.git ~/.nodenv

- source ~/.bashrc

## https://github.com/nodenv/node-build#installation
- mkdir -p "$(nodenv root)"/plugins
- git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build

<<: *bundle_cache

environment:
CODECOV_TOKEN: ENCRYPTED[5bfb9cd3d53a72c8423ce1b84b18cf7d30fbdcf3a56a25f9cd79dbdff1c3552542578272db8088ec27d7de7f2c363d72]

test_script:
- source ~/.bashrc
- bundle exec rspec

only_if: ($CIRRUS_BRANCH == 'master') ||
changesInclude(
'.cirrus.yaml', '.gitignore', 'Gemfile', 'Rakefile', '.rspec',
'*.gemspec', 'lib/**', 'spec/**'
)
25 changes: 0 additions & 25 deletions .cirrus.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .editorconfig
Expand Up @@ -2,11 +2,17 @@ root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[*.y{a,}ml]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 4
15 changes: 8 additions & 7 deletions .gitignore
@@ -1,9 +1,10 @@
Gemfile.lock
.ruby-version
!template/.ruby-version
/Gemfile.lock
/.ruby-version

# Gem files
*.gem
/node_modules/
/package-lock.json
/yarn.lock

# Tests coverage
coverage/
/coverage/

/pkg/
2 changes: 2 additions & 0 deletions .remarkrc.yaml
@@ -0,0 +1,2 @@
plugins:
- remark-preset-lint-recommended
1 change: 1 addition & 0 deletions .rspec
@@ -1,2 +1,3 @@
--require spec_helper.rb
--warnings
--color
43 changes: 18 additions & 25 deletions .rubocop.yml
Expand Up @@ -2,23 +2,30 @@ require:
- rubocop-performance
- rubocop-rspec

Layout/Tab:
Enabled: false
inherit_mode:
merge:
- Include
- Exclude

Layout/IndentationStyle:
EnforcedStyle: tabs
IndentationWidth: 2
Layout/IndentationWidth:
Width: 1
Layout/LineLength:
Max: 100
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Layout/FirstParameterIndentation:
EnforcedStyle: consistent
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/FirstArgumentIndentation:
EnforcedStyle: consistent
Layout/FirstParameterIndentation:
EnforcedStyle: consistent
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
Expand All @@ -27,37 +34,23 @@ Layout/MultilineArrayBraceLayout:
EnforcedStyle: new_line
Layout/MultilineHashBraceLayout:
EnforcedStyle: new_line
Layout/FirstArrayElementLineBreak:
Enabled: true
Layout/FirstHashElementLineBreak:
Enabled: true
Layout/FirstMethodArgumentLineBreak:
Enabled: true
Layout/FirstMethodParameterLineBreak:
Enabled: true

Style/ParenthesesAroundCondition:
AllowInMultilineConditions: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true

Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true

AllCops:
TargetRubyVersion: 2.6
AlexWayfer marked this conversation as resolved.
Show resolved Hide resolved
NewCops: enable

Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- '*.gemspec'

RSpec/NestedGroups:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: false
## Because of we're testing CLI through native calls
RSpec/DescribeClass:
Enabled: false
Expand Down
8 changes: 8 additions & 0 deletions .toys.rb
@@ -0,0 +1,8 @@
# frozen_string_literal: true

include :bundler, static: true

require 'gem_toys'
expand GemToys::Template

alias_tool :g, :gem
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,5 @@
# Changelog

## master (unreleased)

* Initial release.
21 changes: 21 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Alexander Popov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
45 changes: 45 additions & 0 deletions README.md
@@ -0,0 +1,45 @@
# Flame CLI

[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/flame-cli?style=flat-square)](https://cirrus-ci.com/github/AlexWayfer/flame-cli)
[![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/flame-cli/master.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/flame-cli)
[![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/flame-cli.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/flame-cli)
[![Depfu](https://img.shields.io/depfu/AlexWayfer/flame-cli?style=flat-square)](https://depfu.com/repos/github/AlexWayfer/flame-cli)
[![Inline docs](https://inch-ci.org/github/AlexWayfer/flame-cli.svg?branch=master)](https://inch-ci.org/github/AlexWayfer/flame-cli)
[![license](https://img.shields.io/github/license/AlexWayfer/flame-cli.svg?style=flat-square)](https://github.com/AlexWayfer/flame-cli/blob/master/LICENSE.txt)
[![Gem](https://img.shields.io/gem/v/flame-cli.svg?style=flat-square)](https://rubygems.org/gems/flame-cli)

CLI for [Flame web framework](https://github.com/AlexWayfer/flame).

## Installation

Install it globally as:

```shell
gem install flame-cli
```

## Usage

```ruby
flame --help
```

## Development

After checking out the repo, run `bundle install` to install dependencies.

Then, run `toys rspec` to run the tests.

To install this gem onto your local machine, run `toys gem install`.

To release a new version, run `toys gem release %version%`.
See how it works [here](https://github.com/AlexWayfer/gem_toys#release).

## Contributing

Bug reports and pull requests are welcome on [GitHub](https://github.com/AlexWayfer/flame-cli).

## License

The gem is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT).
11 changes: 0 additions & 11 deletions Rakefile

This file was deleted.