Skip to content

Commit

Permalink
Merge pull request #57 from AlexWayfer/split_toys_into_gems
Browse files Browse the repository at this point in the history
Update template, split toys into gems
  • Loading branch information
AlexWayfer authored Dec 2, 2020
2 parents e0d0928 + a9591fc commit e49dc0c
Show file tree
Hide file tree
Showing 151 changed files with 3,462 additions and 2,329 deletions.
114 changes: 114 additions & 0 deletions .cirrus.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugins:
- remark-preset-lint-recommended
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--require spec_helper.rb
--warnings
--color
43 changes: 18 additions & 25 deletions .rubocop.yml
Original file line number Diff line number Diff line change
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
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## master (unreleased)

* Initial release.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.

Loading

0 comments on commit e49dc0c

Please sign in to comment.