hoboken 0.0.1.beta2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
- data/.github/ISSUE_TEMPLATE/code_change.md +11 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +25 -0
- data/.github/dependabot.yml +7 -0
- data/.github/workflows/ruby.yml +28 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +41 -0
- data/.ruby-version +1 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +131 -0
- data/CODE_OF_CONDUCT.md +8 -0
- data/CONTRIBUTING.md +16 -0
- data/Gemfile +2 -0
- data/IDEAS.md +57 -0
- data/LICENSE.txt +1 -1
- data/README.md +28 -17
- data/Rakefile +14 -8
- data/bin/hoboken +2 -1
- data/hoboken.gemspec +63 -16
- data/lib/hoboken/actions.rb +11 -6
- data/lib/hoboken/add_ons/active_record.rb +142 -0
- data/lib/hoboken/add_ons/airbrake.rb +64 -0
- data/lib/hoboken/add_ons/github_action.rb +14 -0
- data/lib/hoboken/add_ons/heroku.rb +29 -0
- data/lib/hoboken/add_ons/internationalization.rb +28 -0
- data/lib/hoboken/add_ons/metrics.rb +60 -0
- data/lib/hoboken/add_ons/omniauth.rb +174 -0
- data/lib/hoboken/add_ons/rubocop.rb +46 -0
- data/lib/hoboken/add_ons/sequel.rb +135 -0
- data/lib/hoboken/add_ons/sidekiq.rb +137 -0
- data/lib/hoboken/add_ons/travis.rb +15 -0
- data/lib/hoboken/add_ons/turnip.rb +109 -0
- data/lib/hoboken/add_ons/twbs.rb +50 -0
- data/lib/hoboken/add_ons/vcr.rb +54 -0
- data/lib/hoboken/generate.rb +146 -46
- data/lib/hoboken/templates/Gemfile.erb.tt +43 -8
- data/lib/hoboken/templates/README.md.tt +117 -35
- data/lib/hoboken/templates/Rakefile.tt +20 -16
- data/lib/hoboken/templates/active_record.rake +11 -0
- data/lib/hoboken/templates/airbrake.rb.tt +13 -0
- data/lib/hoboken/templates/classic.rb.tt +25 -11
- data/lib/hoboken/templates/classic_environment.rb.tt +51 -0
- data/lib/hoboken/templates/config.ru.tt +4 -2
- data/lib/hoboken/templates/console +19 -0
- data/lib/hoboken/templates/db.rb.tt +24 -0
- data/lib/hoboken/templates/example_worker.rb.tt +14 -0
- data/lib/hoboken/templates/github_action.tt +28 -0
- data/lib/hoboken/templates/gitignore +8 -0
- data/lib/hoboken/templates/metrics.rake.tt +12 -9
- data/lib/hoboken/templates/modular.rb.tt +28 -15
- data/lib/hoboken/templates/modular_environment.rb.tt +62 -0
- data/lib/hoboken/templates/puma.rb.tt +21 -0
- data/lib/hoboken/templates/rspec.rake.tt +9 -0
- data/lib/hoboken/templates/rubocop.yml.tt +51 -0
- data/lib/hoboken/templates/seeds.rb +12 -0
- data/lib/hoboken/templates/sequel.rake +21 -0
- data/lib/hoboken/templates/server +15 -0
- data/lib/hoboken/templates/setup +28 -0
- data/lib/hoboken/templates/sidekiq.rb.tt +21 -0
- data/lib/hoboken/templates/spec/app_spec.rb.tt +13 -0
- data/lib/hoboken/templates/spec/example_worker_spec.rb.tt +16 -0
- data/lib/hoboken/templates/spec/rack_matchers.rb.tt +58 -0
- data/lib/hoboken/templates/spec/spec_helper.rb.tt +37 -0
- data/lib/hoboken/templates/spec/turnip_helper.rb.tt +10 -0
- data/lib/hoboken/templates/styles.css.tt +1 -1
- data/lib/hoboken/templates/support/rack_helpers.rb.tt +55 -0
- data/lib/hoboken/templates/support/rack_test_assertions.rb.tt +113 -0
- data/lib/hoboken/templates/test/test_helper.rb.tt +47 -0
- data/lib/hoboken/templates/test/unit/app_test.rb.tt +11 -3
- data/lib/hoboken/templates/test/unit/example_worker_test.rb.tt +20 -0
- data/lib/hoboken/templates/test_unit.rake.tt +18 -0
- data/lib/hoboken/templates/vcr_setup.rb.tt +15 -0
- data/lib/hoboken/templates/views/index.erb.tt +11 -4
- data/lib/hoboken/templates/views/layout.erb.tt +7 -4
- data/lib/hoboken/version.rb +3 -1
- data/lib/hoboken.rb +147 -325
- data/test/fixtures/Gemfile +3 -3
- data/test/fixtures/Gemfile.pristine +3 -2
- data/test/integration/active_record_test.rb +66 -0
- data/test/integration/airbrake_test.rb +31 -0
- data/test/integration/generate_classic_test.rb +75 -0
- data/test/integration/generate_modular_test.rb +83 -0
- data/test/integration/github_action_test.rb +13 -0
- data/test/integration/heroku_test.rb +14 -0
- data/test/integration/internationalization_test.rb +26 -0
- data/test/integration/metrics_test.rb +54 -0
- data/test/integration/omniauth_test.rb +143 -0
- data/test/integration/rubocop_test.rb +39 -0
- data/test/integration/sequel_test.rb +64 -0
- data/test/integration/sidekiq_test.rb +105 -0
- data/test/integration/travis_test.rb +13 -0
- data/test/integration/turnip_test.rb +51 -0
- data/test/integration/twitter_bootstrap_test.rb +39 -0
- data/test/integration/vcr_test.rb +54 -0
- data/test/test_helper.rb +109 -0
- data/test/unit/hoboken_actions_test.rb +82 -53
- data/www/Gemfile +4 -0
- data/www/README.md +2 -0
- data/www/config.rb +11 -0
- data/www/source/documentation.html.erb +274 -0
- data/www/source/images/hoboken-running.png +0 -0
- data/www/source/images/hoboken.png +0 -0
- data/www/source/images/sinatra.png +0 -0
- data/www/source/index.html.erb +44 -0
- data/www/source/javascripts/all.js +1 -0
- data/www/source/layouts/layout.erb +38 -0
- data/www/source/stylesheets/all.css.scss +116 -0
- data/www/source/stylesheets/normalize.css +375 -0
- metadata +655 -29
- data/lib/hoboken/templates/sprockets.rake +0 -33
- data/lib/hoboken/templates/sprockets_chain.rb +0 -26
- data/lib/hoboken/templates/sprockets_helper.rb +0 -13
- data/lib/hoboken/templates/test/support/rack_test_assertions.rb.tt +0 -79
- data/lib/hoboken/templates/test/unit/test_helper.rb.tt +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2fcb30215523759b04d0249c6ced1c702ece948178682820867f7fb9bc8a84cd
|
4
|
+
data.tar.gz: 80e5100fc0a2e7aa1fd319b7fc6b1555633ab936b1fa487845a5010dcf149153
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4752cce9842dcedc3f9163c11d0470fb9ce21a049a08b3086a7955c492503dc573a97f6bdf548a9532b9853721ee5e079a0ebb0e49fe6e5b90121a7efa3b24d5
|
7
|
+
data.tar.gz: 8b186dbe7ee60e1a50445fa787abe02333eb23960034685b394a14d46014a946f1f0de9122169fb1e9fec750b68c451d98ea3b10db8d7b745473521faa37afdb
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: bug?
|
6
|
+
assignees: bnadlerjr
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
<!--- The GitHub Issue tracker is **ONLY** used for reporting bugs and tracking code changes. Please use StackOverflow or GitHub Discussions for questions or support issues. New features should be discussed on GitHub Discussions **before** creating an issue. For a roadmap of upcoming features, check the GitHub Projects page. --->
|
11
|
+
|
12
|
+
<!--- Make sure to add **all the information needed to understand the bug** so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information. --->
|
13
|
+
|
14
|
+
**Describe the bug**
|
15
|
+
<!--- A clear and concise description of what the bug is. --->
|
16
|
+
|
17
|
+
**To Reproduce**
|
18
|
+
<!--- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant. --->
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
<!--- A clear and concise description of what you expected to happen. --->
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
<!--- If applicable, add screenshots to help explain your problem. --->
|
25
|
+
|
26
|
+
**Environment (please complete the following information):**
|
27
|
+
- Hoboken Version: [e.g. 0.8.0]
|
28
|
+
- Ruby Version: [e.g. 2.7]
|
29
|
+
- OS and Version: [e.g. macOS Big Sur, Windows 10]
|
30
|
+
- Browser and Version (if applicable): [e.g. chrome, safari]
|
31
|
+
|
32
|
+
**Additional context**
|
33
|
+
<!--- Add any other context about the problem here. --->
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
name: Code change
|
3
|
+
about: Feature work, refactoring or any other code changes
|
4
|
+
title: ''
|
5
|
+
assignees: bnadlerjr
|
6
|
+
|
7
|
+
---
|
8
|
+
|
9
|
+
<!--- The GitHub Issue tracker is **ONLY** used for reporting bugs and tracking code changes. Please use StackOverflow or GitHub Discussions for questions or support issues. New features should be discussed on GitHub Discussions **before** creating an issue. For a roadmap of upcoming features, check the GitHub Projects page. --->
|
10
|
+
|
11
|
+
<!--- Describe the requested code change. --->
|
@@ -0,0 +1,25 @@
|
|
1
|
+
**Description**
|
2
|
+
<!--- Describe your changes. Why is this change required? What problem does it solve? Does this PR introduce a breaking change to the public API? --->
|
3
|
+
|
4
|
+
**Related Issue**
|
5
|
+
<!--- Link to related issue --->
|
6
|
+
|
7
|
+
**Screenshots**
|
8
|
+
<!--- Optional screenshots --->
|
9
|
+
|
10
|
+
**Type of Change**
|
11
|
+
<!--- Place an `x` in each box that applies: --->
|
12
|
+
[ ] Bug fix (non-breaking change which fixes an issue)
|
13
|
+
[ ] New feature (non-breaking change which adds functionality)
|
14
|
+
[ ] Code change (non-breaking change which changes existing non-public API)
|
15
|
+
[ ] Breaking change (fix or feature that would cause existing functionality to change)
|
16
|
+
|
17
|
+
**Checklist**
|
18
|
+
<!--- Place an `x` in each box if you have performed the indicated task. --->
|
19
|
+
[ ] I have followed the guidelines in the `CONTRIBUTING.md` document.
|
20
|
+
[ ] I have ensured that my code follows the code style of this project.
|
21
|
+
[ ] I have checked to ensure there aren't other open [Pull Requests](../../../pulls) for the same update / change.
|
22
|
+
[ ] I have checked that the CI build passes all tests and linters.
|
23
|
+
[ ] I have added tests to cover my changes.
|
24
|
+
[ ] I have made any necessary changes to the documentation.
|
25
|
+
[ ] I have updated the `Unreleased` section of the `CHANGELOG.md` with a brief description of my change along with my GitHub username.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
2
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
3
|
+
|
4
|
+
name: Ruby
|
5
|
+
|
6
|
+
on:
|
7
|
+
push:
|
8
|
+
pull_request:
|
9
|
+
schedule:
|
10
|
+
- cron: "0 4 * * *"
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
strategy:
|
17
|
+
matrix:
|
18
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby-version }}
|
26
|
+
bundler-cache: true
|
27
|
+
- name: Run tests
|
28
|
+
run: bundle exec rake ci
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rake
|
3
|
+
- rubocop-performance
|
4
|
+
- rubocop-rspec # for generated projects
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
Exclude:
|
8
|
+
- 'test/tmp/*/sample/Gemfile'
|
9
|
+
- 'test/fixtures/**/*'
|
10
|
+
- 'vendor/bundle/**/*'
|
11
|
+
- 'www/**/*'
|
12
|
+
NewCops: enable
|
13
|
+
TargetRubyVersion: 2.6
|
14
|
+
|
15
|
+
Layout/LineLength:
|
16
|
+
Max: 90
|
17
|
+
|
18
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
19
|
+
EnforcedStyle: no_space
|
20
|
+
|
21
|
+
Metrics/BlockLength:
|
22
|
+
IgnoredMethods:
|
23
|
+
- run_hoboken
|
24
|
+
|
25
|
+
Metrics/ClassLength:
|
26
|
+
Max: 150
|
27
|
+
|
28
|
+
Metrics/MethodLength:
|
29
|
+
Max: 15
|
30
|
+
|
31
|
+
RSpec/DescribeClass:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
RSpec/MultipleDescribes:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Style/BlockDelimiters:
|
38
|
+
EnforcedStyle: braces_for_chaining
|
39
|
+
|
40
|
+
Style/YodaCondition:
|
41
|
+
EnforcedStyle: require_for_equality_operators_only
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.3
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.3
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
### Added
|
9
|
+
### Changed
|
10
|
+
### Removed
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
## [0.10.0] - 2022-01-17
|
14
|
+
### Added
|
15
|
+
* Add-on for Sidekiq.
|
16
|
+
|
17
|
+
* Add-on for Turnip.
|
18
|
+
|
19
|
+
* Add-on for VCR.
|
20
|
+
|
21
|
+
* Add-on for Airbrake.
|
22
|
+
|
23
|
+
* Add-on for `sinatra-activerecord`.
|
24
|
+
|
25
|
+
* Sinatra configuration block for test environment.
|
26
|
+
|
27
|
+
* More response codes for RSpec matchers / test unit assertions.
|
28
|
+
|
29
|
+
### Changed
|
30
|
+
* Define `SESSION_SECRET` in `.env` file so that it is defined only once and
|
31
|
+
can be re-used by other things (like the Sidekiq UI).
|
32
|
+
|
33
|
+
* Switch `bin` scripts from bash to Ruby for consistency. Also fixes foreman
|
34
|
+
errors w/ rerun gem by installing them separately from the bundle.
|
35
|
+
|
36
|
+
* Force https in production.
|
37
|
+
|
38
|
+
* Switch to `sinatra-asset-pipeline`. Remove Sprockets add-on. All non-API
|
39
|
+
generated projects use `sinatra-asset-pipeline`.
|
40
|
+
|
41
|
+
* Various generated `README` improvements.
|
42
|
+
|
43
|
+
* `--api-only` apps don't get CSRF or cookie support.
|
44
|
+
|
45
|
+
* Sequel add-on now installs `rubocop-sequel` if Rubocop is detected.
|
46
|
+
|
47
|
+
* Simplecov from metrics add-on ignores `db/migrate` directory.
|
48
|
+
|
49
|
+
* RSpec and Rubocop Rake tasks are not loaded in production.
|
50
|
+
|
51
|
+
* Don't require a CSRF token when running in a test environment.
|
52
|
+
|
53
|
+
* Allow Rake in all environments.
|
54
|
+
|
55
|
+
* Enable performance plugin for Rubocop add-on by default.
|
56
|
+
|
57
|
+
* Database rollbacks now occur for all Rack-enabled test unit tests. For RSpec
|
58
|
+
specs, they are enabled for all specs.
|
59
|
+
|
60
|
+
### Fixed
|
61
|
+
* Set proper application root for BetterErrors gem.
|
62
|
+
|
63
|
+
* CI task for RSpec projects.
|
64
|
+
|
65
|
+
* Rerun install in `setup` script needs `fs-event` gem.
|
66
|
+
|
67
|
+
## [0.9.0] - 2021-05-06
|
68
|
+
### Added
|
69
|
+
* `--api-only` option for core generator.
|
70
|
+
|
71
|
+
* Add-on for Twitter Bootstrap.
|
72
|
+
|
73
|
+
* Add-on for GitHub Action.
|
74
|
+
|
75
|
+
* Add-on for Rubocop.
|
76
|
+
|
77
|
+
* Added `pry-byebug` gem as part of the core generator.
|
78
|
+
|
79
|
+
* RSpec support. Add RSpec as an available `--test-framework` option.
|
80
|
+
|
81
|
+
* Console support via the `racksh` gem along with a Rake task for starting the
|
82
|
+
console.
|
83
|
+
|
84
|
+
* BetterErrors gem as part of the core generator.
|
85
|
+
|
86
|
+
* `sinatra-flash` for all non-API projects.
|
87
|
+
|
88
|
+
* Rakefile gets a `ci` task that runs the installed test runner. If the Rubocop
|
89
|
+
add-on is also detected, Rubocop will run after the tests.
|
90
|
+
|
91
|
+
### Changed
|
92
|
+
* Switch to Puma as default server instead of Thin. Add an explicit Puma
|
93
|
+
config (`config/puma.rb`).
|
94
|
+
|
95
|
+
* Switched from sinatra-reloader to [rerun](https://github.com/alexch/rerun).
|
96
|
+
|
97
|
+
* Update all dependencies.
|
98
|
+
|
99
|
+
* Silence warnings from transitive gem dependencies in test output.
|
100
|
+
|
101
|
+
* Move generated Sequel DB setup out of `config.ru` and into its own
|
102
|
+
file (`config/db.rb`).
|
103
|
+
|
104
|
+
* Dev server updates: always include a Procfile; create scripts for `setup`,
|
105
|
+
`console`, `server`; server script uses foreman if it's available,
|
106
|
+
otherwise rackup; remove Rake tasks for console, server.
|
107
|
+
|
108
|
+
* Use `sinatra-json` gem from `sinatra-contrib` instead of default JSON gem.
|
109
|
+
|
110
|
+
* Switch default templates to Erubi; escape HTML by default.
|
111
|
+
|
112
|
+
* Switch to `test-unit` gem.
|
113
|
+
|
114
|
+
* Generated `README` overhaul. Show environment variables in a table, bullet
|
115
|
+
points showing default options and libraries installed, table of contents,
|
116
|
+
etc.
|
117
|
+
|
118
|
+
### Fixed
|
119
|
+
* Don't attempt to add metrics snippets to non-existent files.
|
120
|
+
|
121
|
+
* `assert_redirected_to helper` argument.
|
122
|
+
|
123
|
+
* Hardcoded Omniauth route in generated tests.
|
124
|
+
|
125
|
+
## [0.1.0] - 2014-09-05
|
126
|
+
* Initial version
|
127
|
+
|
128
|
+
[Unreleased]: https://github.com/bnadlerjr/hoboken/compare/v0.10.0...HEAD
|
129
|
+
[0.10.0]: https://github.com/bnadlerjr/hoboken/compare/v0.9.0...v0.10.0
|
130
|
+
[0.9.0]: https://github.com/bnadlerjr/hoboken/compare/v0.0.1...v0.9.0
|
131
|
+
[0.0.1]: https://github.com/bnadlerjr/hoboken/releases/tag/v0.0.1
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
## Code of Conduct
|
2
|
+
This code of conduct applies to all of the project's "collaborative space", which is defined as community communications channels, including GitHub Issues, GitHub project, and source code repository.
|
3
|
+
|
4
|
+
1. Participants must ensure that their language and actions are free of personal attacks and remarks disparaging to people or groups.
|
5
|
+
1. Behaviour which can be reasonably considered harassment will not be tolerated.
|
6
|
+
1. Discussion should be limited to the project and related technologies.
|
7
|
+
|
8
|
+
You can report a violation of this code of conduct to the project maintainer, who will take appropriate action.
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
## How to contribute to Hoboken
|
2
|
+
|
3
|
+
#### Issue Guidelines
|
4
|
+
1. Issues should only be created for things that are definitely bugs. If you are not sure that the behavior is a bug, ask about it on [GitHub Discussions](https://github.com/bnadlerjr/hoboken/discussions). GitHub Issues should not be used as a help forum.
|
5
|
+
1. **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/bnadlerjr/hoboken/issues).
|
6
|
+
1. If you are sure it is a bug, then post a complete description of the issue, the simplest possible self-contained example showing the problem, and the full backtrace of any exception.
|
7
|
+
1. Issues are generally closed as soon as the problem is considered fixed. However, discussion can still happen after the issue is closed, and the issue will be reopened if additional evidence is provided showing the issue still exists.
|
8
|
+
|
9
|
+
#### Pull Request Guidelines
|
10
|
+
1. Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
|
11
|
+
1. Try to include tests for all new features and substantial bug fixes.
|
12
|
+
1. Try to include documentation for all new features. In most cases this should include RDoc method documentation, but updates to the [documentation site](https://github.com/bnadlerjr/hoboken-docs) are also appropriate in some cases.
|
13
|
+
1. Follow the style conventions of the surrounding code. In most cases, this is standard ruby style.
|
14
|
+
1. All code in pull requests is assumed to be MIT licensed. Do not submit a pull request if that isn't the case.
|
15
|
+
1. Please do not submit pull requests for code that is not ready to be merged. Pull requests should not be used to "start a conversation" about a possible code change. If the pull request requires a conversation, that conversation should take place on [GitHub Discussions](https://github.com/bnadlerjr/hoboken/discussions).
|
16
|
+
1. Pull requests are generally closed as soon as it appears that the branch will not be merged. However, discussion about the code can still happen after the pull request is closed, and the pull request can be reopened if additional commits to the branch or other changes make it likely that it will be merged.
|
data/Gemfile
CHANGED
data/IDEAS.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# Project Ideas
|
2
|
+
|
3
|
+
## New Directory Structure
|
4
|
+
|
5
|
+
General idea is similar to Hexagonal or Ports and Adapters architecture. Web
|
6
|
+
and DB concerns depend on the application core, not the other way around.
|
7
|
+
|
8
|
+
/web -- depends on --> /db
|
9
|
+
/web -- depends on --> /lib
|
10
|
+
/db -- depends on --> /lib
|
11
|
+
/lib -- depends on --> nothing from from /web or /db
|
12
|
+
|
13
|
+
```
|
14
|
+
Gemfile
|
15
|
+
Gemfile.lock
|
16
|
+
README.md
|
17
|
+
Rakefile
|
18
|
+
config.ru
|
19
|
+
app.rb
|
20
|
+
db.rb
|
21
|
+
/config
|
22
|
+
db.rb
|
23
|
+
environment.rb
|
24
|
+
puma.rb
|
25
|
+
/db
|
26
|
+
/mappers
|
27
|
+
some_mapper.rb
|
28
|
+
/migrate
|
29
|
+
migration_001.rb
|
30
|
+
sequel_mapper.rb
|
31
|
+
/lib
|
32
|
+
<project_name>.rb
|
33
|
+
/<project_name>
|
34
|
+
... files
|
35
|
+
/helpers
|
36
|
+
some_helper.rb
|
37
|
+
/public
|
38
|
+
/css
|
39
|
+
styles.css
|
40
|
+
/img
|
41
|
+
favicon.png
|
42
|
+
hoboken.png
|
43
|
+
sinatra.png
|
44
|
+
/js
|
45
|
+
app.js
|
46
|
+
/views
|
47
|
+
index.erb
|
48
|
+
layout.erb
|
49
|
+
/test
|
50
|
+
test_helper.rb
|
51
|
+
/<project_name>
|
52
|
+
/db
|
53
|
+
some_mapper_test.rb
|
54
|
+
/support
|
55
|
+
rack_test_assertions.rb
|
56
|
+
app_test.rb
|
57
|
+
```
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Hoboken
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/hoboken.png)](http://badge.fury.io/rb/hoboken)
|
4
|
+
![Build Status](https://github.com/bnadlerjr/hoboken/actions/workflows/ruby.yml/badge.svg)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/75e09f25ee70d6858519/maintainability)](https://codeclimate.com/github/bnadlerjr/hoboken/maintainability)
|
4
6
|
|
5
|
-
|
7
|
+
Sinatra project generator and templates.
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -25,12 +27,14 @@ To see a list of options for the generate command:
|
|
25
27
|
hoboken generate [APP_NAME]
|
26
28
|
|
27
29
|
Options:
|
28
|
-
[--ruby-version=RUBY_VERSION]
|
29
|
-
|
30
|
-
[--
|
31
|
-
|
32
|
-
|
33
|
-
[--
|
30
|
+
[--ruby-version=RUBY_VERSION] # Ruby version for Gemfile
|
31
|
+
[--tiny], [--no-tiny] # Generate views inline; do not create /public folder
|
32
|
+
[--type=TYPE] # Architecture type (classic or modular)
|
33
|
+
# Default: classic
|
34
|
+
[--git], [--no-git] # Create a Git repository and make initial commit
|
35
|
+
[--api-only], [--no-api-only] # API only, no views, public folder, etc.
|
36
|
+
[--test-framework=TEST_FRAMEWORK] # Testing framework; can be either test-unit or rspec
|
37
|
+
# Default: test-unit
|
34
38
|
|
35
39
|
Generate a new Sinatra app
|
36
40
|
|
@@ -38,16 +42,23 @@ To see a list of options for the generate command:
|
|
38
42
|
|
39
43
|
Additional generators are available for existing projects generated using Hoboken:
|
40
44
|
|
45
|
+
$ hoboken add:github_action # Github action that runs CI task
|
41
46
|
$ hoboken add:heroku # Heroku deployment support
|
42
47
|
$ hoboken add:i18n # Internationalization support using sinatra-r18n
|
43
48
|
$ hoboken add:metrics # Add metrics (flog, flay, simplecov)
|
44
49
|
$ hoboken add:omniauth # OmniAuth authentication (allows you to select a provider)
|
45
|
-
$ hoboken add:
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
$ hoboken add:rubocop # Basic Rubocop configuration and Rake task.
|
51
|
+
$ hoboken add:sequel # Database access via Sequel gem
|
52
|
+
$ hoboken add:sidekiq # Background processing with the Sidekiq gem
|
53
|
+
$ hoboken add:travis # Basic Travis-CI YAML config
|
54
|
+
$ hoboken add:turnip # Gherkin extension for RSpec
|
55
|
+
$ hoboken add:twbs # Twitter Bootstrap (requires Sprockets add-on)
|
56
|
+
$ hoboken add:vcr # Record HTTP interactions and replay them during test runs
|
57
|
+
|
58
|
+
## Resources
|
59
|
+
|
60
|
+
* [Website](https://bobnadler.com/hoboken/)
|
61
|
+
* [Source Code](https://github.com/bnadlerjr/hoboken)
|
62
|
+
* [Bug Tracking](https://github.com/bnadlerjr/hoboken/issues)
|
63
|
+
* [Discussion Forum](https://github.com/bnadlerjr/hoboken/discussions)
|
64
|
+
* [Contribution Guidelines](https://github.com/bnadlerjr/hoboken/blob/main/CONTRIBUTING.md)
|
data/Rakefile
CHANGED
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
require "rake/testtask"
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'rubocop/rake_task'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
RuboCop::RakeTask.new
|
8
|
+
|
9
|
+
Rake::TestTask.new do |t|
|
10
|
+
t.libs << 'test'
|
11
|
+
t.test_files = Dir['test/**/*_test.rb']
|
11
12
|
end
|
13
|
+
|
14
|
+
task default: 'test'
|
15
|
+
|
16
|
+
desc 'Run CI checks'
|
17
|
+
task ci: %w[test rubocop]
|
data/bin/hoboken
CHANGED
data/hoboken.gemspec
CHANGED
@@ -1,25 +1,72 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'English'
|
4
|
+
require_relative 'lib/hoboken/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'hoboken'
|
8
8
|
spec.version = Hoboken::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description =
|
12
|
-
spec.summary =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
9
|
+
spec.authors = ['Bob Nadler']
|
10
|
+
spec.email = ['bnadlerjr@gmail.com']
|
11
|
+
spec.description = 'Sinatra project generator.'
|
12
|
+
spec.summary = 'Sinatra project generator.'
|
13
|
+
spec.homepage = 'https://github.com/bnadlerjr/hoboken'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
17
|
+
spec.required_ruby_version = '>= 2.6'
|
15
18
|
|
16
|
-
spec.files = `git ls-files`.split(
|
19
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_dependency 'thor', '~> 1.1'
|
20
25
|
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
26
|
+
spec.add_development_dependency 'bundler', '~> 2.2'
|
27
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.9'
|
28
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 1.12'
|
30
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.5'
|
31
|
+
spec.add_development_dependency 'test-unit', '~> 3.4'
|
32
|
+
spec.add_development_dependency 'warning', '~> 1.2'
|
23
33
|
|
24
|
-
|
34
|
+
# These dependencies are installed by the generated projects. Including them
|
35
|
+
# here so that:
|
36
|
+
#
|
37
|
+
# a) We can get Dependabot notifications for them
|
38
|
+
# b) We can run tests for generated projects
|
39
|
+
spec.add_development_dependency 'airbrake', '~> 12.0'
|
40
|
+
spec.add_development_dependency 'better_errors', '~> 2.9'
|
41
|
+
spec.add_development_dependency 'binding_of_caller', '~> 1.0'
|
42
|
+
spec.add_development_dependency 'bootstrap', '~> 5.1.0'
|
43
|
+
spec.add_development_dependency 'contest', '~> 0.1'
|
44
|
+
spec.add_development_dependency 'dotenv', '~> 2.7'
|
45
|
+
spec.add_development_dependency 'erubi', '~> 1.10'
|
46
|
+
spec.add_development_dependency 'flay', '~> 2.12'
|
47
|
+
spec.add_development_dependency 'flog', '~> 4.6'
|
48
|
+
spec.add_development_dependency 'omniauth-twitter', '~> 1.4'
|
49
|
+
spec.add_development_dependency 'puma', '~> 5.2'
|
50
|
+
spec.add_development_dependency 'rack_csrf', '~> 2.6'
|
51
|
+
spec.add_development_dependency 'racksh', '~> 1.0'
|
52
|
+
spec.add_development_dependency 'rack-test', '~> 1.1'
|
53
|
+
spec.add_development_dependency 'rspec', '~> 3.10'
|
54
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.13'
|
55
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.2'
|
56
|
+
spec.add_development_dependency 'rubocop-sequel', '~> 0.2'
|
57
|
+
spec.add_development_dependency 'sassc', '~> 2.4'
|
58
|
+
spec.add_development_dependency 'sequel', '~> 5.43'
|
59
|
+
spec.add_development_dependency 'sidekiq', '~> 6.2'
|
60
|
+
spec.add_development_dependency 'simplecov', '~> 0.21'
|
61
|
+
spec.add_development_dependency 'sinatra', '~> 2.1'
|
62
|
+
spec.add_development_dependency 'sinatra-activerecord', '~> 2.0'
|
63
|
+
spec.add_development_dependency 'sinatra-asset-pipeline', '~> 2.2'
|
64
|
+
spec.add_development_dependency 'sinatra-contrib', '~> 2.1'
|
65
|
+
spec.add_development_dependency 'sinatra-flash', '~> 0.3'
|
66
|
+
spec.add_development_dependency 'sinatra-r18n', '~> 5.0'
|
67
|
+
spec.add_development_dependency 'sqlite3', '~> 1.4'
|
68
|
+
spec.add_development_dependency 'turnip', '~> 4.3'
|
69
|
+
spec.add_development_dependency 'uglifier', '~> 4.2'
|
70
|
+
spec.add_development_dependency 'vcr', '~> 6.0'
|
71
|
+
spec.add_development_dependency 'webmock', '~> 3.13'
|
25
72
|
end
|
data/lib/hoboken/actions.rb
CHANGED
@@ -1,16 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Hoboken
|
4
|
+
# Custom actions.
|
5
|
+
#
|
2
6
|
module Actions
|
3
|
-
def gem(name,
|
4
|
-
verbose = opts.
|
7
|
+
def gem(name, opts={})
|
8
|
+
verbose = opts.key?(:verbose) ? opts.delete(:verbose) : true
|
9
|
+
version = opts.key?(:version) ? opts.delete(:version) : nil
|
5
10
|
|
6
|
-
parts = [
|
11
|
+
parts = ["'#{name}'"]
|
12
|
+
parts << "'~> #{version}'" unless version.nil? || version.empty?
|
7
13
|
opts.each { |k, v| parts << "#{k}: #{v.inspect}" }
|
8
|
-
|
9
|
-
append_file("Gemfile", "\ngem #{parts.join(", ")}", verbose: verbose)
|
14
|
+
append_file('Gemfile', "gem #{parts.join(', ')}\n", verbose: verbose)
|
10
15
|
end
|
11
16
|
|
12
17
|
def indent(text, num_spaces)
|
13
|
-
text.gsub(/^/, 1.upto(num_spaces).map { |
|
18
|
+
text.gsub(/^/, 1.upto(num_spaces).map { |_| ' ' }.join)
|
14
19
|
end
|
15
20
|
end
|
16
21
|
end
|