stipa 0.2.2 → 0.2.3

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: 44e8a86e067f00d98d94e1ac514d0969f6e1d79cb6ff1daa2af9660bb81d0ea0
4
- data.tar.gz: 5fa375199a8fc3c5dd13e15e42c57b379edccfbf710d64cc58d75f06c8460abf
3
+ metadata.gz: 629ad04a4c8bcd7193a81038be6845f90d9e01b229bfbc0b2d1cb7931359ac06
4
+ data.tar.gz: 7d57a8f7839381d2abfe434221cc58de4a8bddf945d7f55ced2c7c9f272c6bef
5
5
  SHA512:
6
- metadata.gz: 42eda5ad003db0db62f75e87a4e4ee4de386bd1770a9aac217e539a88b19ae9e4b9d49f84f01c32bdb1d64d2f190fac66aacff800952f7b203a876f4755bdc4a
7
- data.tar.gz: e9ff02cd8fb6c8a10818304148de906c4011f010ab4f0bbba890acbd8406dbb49daac17feede3c9f9196a352b332e5361d09c97e0f2e1a9e94cf2608196982a3
6
+ metadata.gz: d96ce9f31e87e046095910f784526cc9a7eb7ca98e5af626b07dd668a12c0eb46e7bab0bd60950788ca924ea75aea08b97b981e38b4ba6615edb2dfbaf72661c
7
+ data.tar.gz: 74e83a3380253c27ef9eddbd4cdba82b3a7658b9261a4dc5ad2b2a58a75cd5820799f9a6ba0cd2512f485ec38c5cb7b354dd07368769c34dc2ab214bee89fc7a
@@ -54,8 +54,7 @@ module Stipa
54
54
  Stipa::Database.connect!
55
55
 
56
56
  # Models must be loaded after the database connection is established.
57
- # If tables don't exist yet, run: rake db:migrate
58
- require_relative 'models/application_model' rescue warn "⚠ Run 'rake db:migrate' to set up the database."
57
+ require_relative 'models/application_model'
59
58
 
60
59
  app = Stipa::App.new
61
60
 
@@ -190,8 +190,18 @@ module Stipa
190
190
 
191
191
  require 'stipa/model'
192
192
 
193
- class ApplicationModel < Sequel::Model
194
- include Stipa::Model
193
+ # Include this in any Sequel::Model subclass to get
194
+ # timestamps, UUID, soft delete, and serialization.
195
+ #
196
+ # Usage:
197
+ # class Post < Sequel::Model
198
+ # include ApplicationModel
199
+ # end
200
+
201
+ module ApplicationModel
202
+ def self.included(base)
203
+ base.include Stipa::Model
204
+ end
195
205
  end
196
206
  RUBY
197
207
  end
@@ -217,7 +227,7 @@ module Stipa
217
227
  RUBY
218
228
  end
219
229
 
220
- def t_rakefile
230
+ def t_rakefile(config_path: 'config')
221
231
  <<~RUBY
222
232
  # frozen_string_literal: true
223
233
 
@@ -251,7 +261,7 @@ module Stipa
251
261
  task default: 'db:migrate'
252
262
 
253
263
  def load_config
254
- require_relative 'config/database'
264
+ require_relative '#{config_path}/database'
255
265
  Stipa::Database.connect!
256
266
  end
257
267
 
@@ -56,7 +56,7 @@ module Stipa
56
56
  {
57
57
  '.gitignore' => t_gitignore,
58
58
  'Gemfile' => t_gemfile,
59
- 'Rakefile' => t_rakefile,
59
+ 'Rakefile' => t_rakefile(config_path: 'app/config'),
60
60
  'package.json' => t_package_json,
61
61
  'rollup.config.js' => t_rollup_config,
62
62
  'tsconfig.json' => t_tsconfig,
@@ -164,8 +164,7 @@ module Stipa
164
164
  Stipa::Database.connect!
165
165
 
166
166
  # Models must be loaded after the database connection is established.
167
- # If tables don't exist yet, run: rake db:migrate
168
- require_relative 'app/models/application_model' rescue warn "⚠ Run 'rake db:migrate' to set up the database."
167
+ require_relative 'app/models/application_model'
169
168
 
170
169
  APP_DIR = __dir__
171
170
 
data/lib/stipa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stipa
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stipa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jānis Harbs