kowl 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37b79c3271568b76ecec53940a1c57cb99746d520b5a6f6ab5cf9f9e8cca7c35
4
- data.tar.gz: 48292531cc963a910fdf60b85018b3536c828553206f5a92a985fca5691979d6
3
+ metadata.gz: 37626221be27260120fd6a0f658280f422fe7e93e696e5fac6502f7d644470f7
4
+ data.tar.gz: ec6f8debdb845e0638c7c3ad5739a59d8e164142a9dc3fced6150e0b6b8799c9
5
5
  SHA512:
6
- metadata.gz: 60023e7a74732f0b65e5d120f3dce0ec2157d2eee1a5d2b8a4bd099d37d42dc61f2dbb0d57eac23f9fb6170a3cf05d5091bc229a9ad5a5abb5cff5552e2dc9a0
7
- data.tar.gz: 985cd1a6d89df7bf30c11595babd094f3ce5f9af66bad9a0eaa69be168798337dfd324f59e130dc7636df42777bd312dc25c5bc063d9fcf816dee571cdc3da2c
6
+ metadata.gz: 643d150a84ca6d872cf7fdb9488fea678e9edc6d0a1172175b804858cf46ef659bed67c90eefd0ea46845b9392cb7648ab1c425e7c2dda2206f68343f882aed0
7
+ data.tar.gz: a4d0ee1bfae9b4616d9de8502bd49b1aaa03517962767364c9755f8dd7ed9f60e6c384c73650cdac321fa7b083649c208bf1b961a23421c4d5b4d4c9089342b8
data/README.md CHANGED
@@ -374,7 +374,7 @@ Project Link: [https://github.com/tarellel/kowl](https://github.com/tarellel/kow
374
374
  [issues-shield]: https://img.shields.io/github/issues/tarellel/kowl.svg?style=flat-square
375
375
  [issues-url]: https://github.com/tarellel/kowl/issues
376
376
  [license-shield]: https://img.shields.io/github/license/tarellel/kowl.svg?style=flat-square
377
- [license-url]: https://github.com/tarellel/kowl/blob/master/LICENSE.txt
377
+ [license-url]: https://github.com/tarellel/kowl/blob/master/LICENSE
378
378
  [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
379
379
  [product-screenshot]: docs/images/cover.png
380
380
 
data/bin/console CHANGED
@@ -3,12 +3,5 @@
3
3
  require 'bundler/setup'
4
4
  require 'kowl'
5
5
 
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require 'pry'
11
- # Pry.start
12
-
13
6
  require 'irb'
14
7
  IRB.start(__FILE__)
data/lib/kowl/version.rb CHANGED
@@ -5,5 +5,5 @@ module Kowl
5
5
  # Minimum required ruby version which to install the gem
6
6
  RUBY_VERSION = '2.5'
7
7
  WEBPACKER_VERSION = '5.0'
8
- VERSION = '0.0.1'
8
+ VERSION = '0.0.2'
9
9
  end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Kowl::Docker do
6
+ before(:each) do
7
+ # Include the Kowl::Docker module in a class in order to make it testible
8
+ # => This is because it is also included into the Rails generator class
9
+ class KowlClass
10
+ include Kowl::Docker
11
+ end
12
+ @kowl = KowlClass.new
13
+ end
14
+
15
+ context 'Dockerfile migration' do
16
+ describe 'no database' do
17
+ it { expect(@kowl.dockerfile_migration_snip).to eq('') }
18
+ end
19
+
20
+ describe 'sqlite3' do
21
+ it { expect(@kowl.dockerfile_migration_snip('sqlite3')).to eq(' && rails db:migrate db:seed') }
22
+ end
23
+
24
+ describe 'other database' do
25
+ it { expect(@kowl.dockerfile_migration_snip('postgresql')).to include('# RUN ["bin/rails", "db:seed"]') }
26
+ end
27
+ end
28
+
29
+ context 'dockerfile args' do
30
+ it { expect(@kowl.dockerfile_database_args).to include('ARG DB_HOST') }
31
+ end
32
+
33
+ context 'docker database port' do
34
+ it { expect(@kowl.docker_port_watcher('mysql', true)).to eq("dockerize -wait tcp://db:3306 -timeout 60m &&\n") }
35
+ it { expect(@kowl.docker_port_watcher('mysql')).to eq("dockerize -wait tcp://db:3306 -wait tcp://redis:6379 -timeout 60m &&\n") }
36
+
37
+ # to use sqlite and skip_sidekiq
38
+ it { expect(@kowl.docker_port_watcher('sqlite3', true)).to eq('') }
39
+ it { expect(@kowl.docker_port_watcher('sqlite3')).to eq("dockerize -wait tcp://redis:6379 -timeout 60m &&\n") }
40
+ end
41
+
42
+ context 'database volumes' do
43
+ it { expect(@kowl.db_volumes('sqlite3')).to eq('') }
44
+ it { expect(@kowl.db_volumes('postgresql')).to eq("postgresconfig:\npostgresdata:\npostgreslog:\n") }
45
+ end
46
+
47
+ context 'js volumes' do
48
+ it { expect(@kowl.js_volumes(true)).to eq('') }
49
+ it { expect(@kowl.js_volumes).to include('packs:') }
50
+ end
51
+
52
+ context 'redis volumes' do
53
+ it { expect(@kowl.redis_volumes).to eq('redis:') }
54
+ # with skip_sidekiq
55
+ it { expect(@kowl.redis_volumes(true)).to eq('') }
56
+ end
57
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe 'Kowl Helpers' do
6
+ context 'template engine str' do
7
+ it { expect(template_engine_gem_str('semantic')).to eq('semantic_ui') }
8
+ it { expect(template_engine_gem_str).to eq('bootstrap') }
9
+ end
10
+
11
+ context 'highlight' do
12
+ it { expect(highlight('')).to eq('') }
13
+ # without string to split
14
+ it { expect(highlight('asdf')).to eq("\e[32masdf\e[0m") }
15
+ it { expect(highlight('asd=efg')).to eq("\e[32masd=\e[33mefg\e[0m") }
16
+ end
17
+
18
+ context 'dh (default highlight)' do
19
+ it { expect(dh('foo')).to eq("\e[34mfoo\e[0m") }
20
+ it { expect(dh()).to eq('') }
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe 'VERSIONS' do
6
+ context 'ensure versions defined' do
7
+ describe 'Kowl version defined' do
8
+ it { expect(::Kowl::VERSION).to be_truthy }
9
+ end
10
+
11
+ describe 'ruby_version defined' do
12
+ it { expect(::Kowl::RUBY_VERSION).to be_truthy }
13
+ end
14
+
15
+ describe 'rails version defined' do
16
+ it { expect(::Kowl::RAILS_VERSION).to be_truthy }
17
+ end
18
+
19
+ describe 'webpacker version defined' do
20
+ it { expect(::Kowl::WEBPACKER_VERSION).to be_truthy }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].sort.each { |f| require f }
4
+
5
+ require 'kowl'
6
+
7
+ # This file was generated by the `rspec --init` command. Conventionally, all
8
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
9
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
10
+ # this file to always be loaded, without a need to explicitly require it in any
11
+ # files.
12
+ #
13
+ # Given that it is always loaded, you are encouraged to keep this file as
14
+ # light-weight as possible. Requiring heavyweight dependencies from this file
15
+ # will add to the boot time of your test suite on EVERY test run, even for an
16
+ # individual file that may not need all of that loaded. Instead, consider making
17
+ # a separate helper file that requires the additional dependencies and performs
18
+ # the additional setup, and require it from the spec files that actually need
19
+ # it.
20
+ #
21
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
22
+ RSpec.configure do |config|
23
+ # rspec-expectations config goes here. You can use an alternate
24
+ # assertion/expectation library such as wrong or the stdlib/minitest
25
+ # assertions if you prefer.
26
+ config.expect_with :rspec do |expectations|
27
+ # This option will default to `true` in RSpec 4. It makes the `description`
28
+ # and `failure_message` of custom matchers include text for helper methods
29
+ # defined using `chain`, e.g.:
30
+ # be_bigger_than(2).and_smaller_than(4).description
31
+ # # => "be bigger than 2 and smaller than 4"
32
+ # ...rather than:
33
+ # # => "be bigger than 2"
34
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
35
+ end
36
+
37
+ # rspec-mocks config goes here. You can use an alternate test double
38
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
39
+ config.mock_with :rspec do |mocks|
40
+ # Prevents you from mocking or stubbing a method that does not exist on
41
+ # a real object. This is generally recommended, and will default to
42
+ # `true` in RSpec 4.
43
+ mocks.verify_partial_doubles = true
44
+ end
45
+
46
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
47
+ # have no way to turn it off -- the option exists only for backwards
48
+ # compatibility in RSpec 3). It causes shared context metadata to be
49
+ # inherited by the metadata hash of host groups and examples, rather than
50
+ # triggering implicit auto-inclusion in groups with matching metadata.
51
+ config.shared_context_metadata_behavior = :apply_to_host_groups
52
+
53
+ # The settings below are suggested to provide a good initial experience
54
+ # with RSpec, but feel free to customize to your heart's content.
55
+ =begin
56
+ # This allows you to limit a spec run to individual examples or groups
57
+ # you care about by tagging them with `:focus` metadata. When nothing
58
+ # is tagged with `:focus`, all examples get run. RSpec also provides
59
+ # aliases for `it`, `describe`, and `context` that include `:focus`
60
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
61
+ config.filter_run_when_matching :focus
62
+
63
+ # Allows RSpec to persist some state between runs in order to support
64
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
65
+ # you configure your source control system to ignore this file.
66
+ config.example_status_persistence_file_path = "spec/examples.txt"
67
+
68
+ # Limits the available syntax to the non-monkey patched syntax that is
69
+ # recommended. For more details, see:
70
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
71
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
72
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
73
+ config.disable_monkey_patching!
74
+
75
+ # This setting enables warnings. It's recommended, but in some cases may
76
+ # be too noisy due to issues in dependencies.
77
+ config.warnings = true
78
+
79
+ # Many RSpec users commonly either run the entire suite or an individual
80
+ # file, and it's useful to allow more verbose output when running an
81
+ # individual spec file.
82
+ if config.files_to_run.one?
83
+ # Use the documentation formatter for detailed output,
84
+ # unless a formatter has already been configured
85
+ # (e.g. via a command-line flag).
86
+ config.default_formatter = "doc"
87
+ end
88
+
89
+ # Print the 10 slowest examples and example groups at the
90
+ # end of the spec run, to help surface which specs are running
91
+ # particularly slow.
92
+ config.profile_examples = 10
93
+
94
+ # Run specs in random order to surface order dependencies. If you find an
95
+ # order dependency and want to debug it, you can fix the order by providing
96
+ # the seed, which is printed after each run.
97
+ # --seed 1234
98
+ config.order = :random
99
+
100
+ # Seed global randomization in this process using the `--seed` CLI option.
101
+ # Setting this allows you to use `--seed` to deterministically reproduce
102
+ # test failures related to randomization by passing the same `--seed` value
103
+ # as the one that triggered the failure.
104
+ Kernel.srand config.seed
105
+ =end
106
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simplecov'
4
+ SimpleCov.start if defined?(SimpleCov)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kowl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hicks
@@ -114,7 +114,7 @@ dependencies:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: 0.9.24
117
- description: 'Used to generate a Rails application following a basic setep of best
117
+ description: 'Used to generate a Rails application following a basic setup of best
118
118
  practices, guidelines, and basic setup; to get your Rails application started with
119
119
  a bang. '
120
120
  email:
@@ -374,6 +374,11 @@ files:
374
374
  - lib/kowl/templates/text_files/robots.txt.tt
375
375
  - lib/kowl/templates/text_files/security.txt
376
376
  - lib/kowl/version.rb
377
+ - spec/kowl/docker_spec.rb
378
+ - spec/kowl/helpers_spec.rb
379
+ - spec/kowl/version_spec.rb
380
+ - spec/spec_helper.rb
381
+ - spec/support/simplecov.rb
377
382
  homepage: https://github.com/tarellel/kowl
378
383
  licenses:
379
384
  - MIT
@@ -401,4 +406,9 @@ signing_key:
401
406
  specification_version: 4
402
407
  summary: A rails application generator to get you out the door and started without
403
408
  wasting hours to get started.
404
- test_files: []
409
+ test_files:
410
+ - spec/kowl/docker_spec.rb
411
+ - spec/kowl/helpers_spec.rb
412
+ - spec/kowl/version_spec.rb
413
+ - spec/spec_helper.rb
414
+ - spec/support/simplecov.rb