act_with_bag 1.1.1 → 1.1.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: 4ecc3541b5c744c54c7f53770c3b7172e4935fb0d5f4b7e7edf39502e334ca6e
4
- data.tar.gz: da6b991ddd14d98b4b079c258544b9fb4408d24f73553a796a71212c8865e23d
3
+ metadata.gz: 17a9af8503db5d084ade7fe944161376b15f00425c59e2a329ba974e13618c1f
4
+ data.tar.gz: d02c7d5937cd1a3568165a951fe45580c46557f32421a698fa697dfad0e933d9
5
5
  SHA512:
6
- metadata.gz: 8a5960ac831f6404d46b1843933bdf533203917187244442e0c38f74c41bdcf39b5651d1fde36b02190a757a92ebbe5a4f7fb4ca638a1087b9d2d503c91d4044
7
- data.tar.gz: 69ec721ff96ccbd202daf926127a2f484e47244af0c9bb6abac5cf799eb175c5ec50ae4c9cb053d6b935165e1494b17b5b8e1f44bee1e1a69a68a3cb51008fb6
6
+ metadata.gz: a26a90082c19ddf7317bc37b4e79fe673a781fb04acbaabe06b761433e5a429e3acf635ca94dfd3724369e30d4f2698f4a8852bf27ce8bfdad7ba56b4aa9f853
7
+ data.tar.gz: 908c5d0231989d24be70fcd4c9fe231af6b80f5e0ed6883afd4b897c946402b7f54990ae969e48b22e43b76a66ceb125e8ad27ebf151f80393607f3003eb3e9d
@@ -1,7 +1,6 @@
1
1
  # see also https://github.com/whitequark/parser/blob/master/.github/workflows/test.yml
2
2
  name: Rake
3
3
 
4
- #on: [push, pull_request]
5
4
  on: [push]
6
5
 
7
6
  jobs:
@@ -9,22 +8,20 @@ jobs:
9
8
  strategy:
10
9
  fail-fast: false
11
10
  matrix:
12
- # os: [ubuntu-latest, macos-latest]
13
- os: [ubuntu-latest]
14
- # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
15
- # ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
16
- ruby: ["2.7.2", 3.1.0, head]
17
- test_command: ["bundle exec rake test"]
18
- runs-on: ${{ matrix.os }}
11
+ ruby_version: ["3.0", 3.2]
12
+ gemfile:
13
+ - Gemfile
14
+ - gemfiles/Gemfile.rails-6.1
15
+ - gemfiles/Gemfile.rails-7.0
16
+ - gemfiles/Gemfile.rails-7.1
17
+ runs-on: ubuntu-latest
19
18
 
20
19
  steps:
21
- - uses: actions/checkout@v2
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- - name: Bundle install
26
- run: |
27
- bundle config path /home/runner/bundle
28
- bundle install
29
- bundle update
30
- - run: ${{ matrix.test_command }}
20
+ - uses: actions/checkout@v3
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby_version }}
25
+ bundler-cache: true
26
+ - name: Build and test with Rake
27
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  .bundle/
2
2
  coverage/
3
+ .watchr
3
4
 
4
5
  *.gem
5
6
  *.log
@@ -8,3 +9,6 @@ coverage/
8
9
  **/*.gem
9
10
  **/*.log
10
11
  **/*.lock
12
+ **/test.sqlite3*
13
+
14
+ test/internal/tmp/
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- rails-7.0
1
+ rails-7.1
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.1.3
1
+ ruby-3.2.2
data/Appraisals CHANGED
@@ -1,24 +1,27 @@
1
- appraise "rails-6.1" do
2
- gem "rails", "~> 6.1"
3
- gem "dryer-config", "~> 6.0"
1
+ appraise "rails-7.1" do
2
+ gem "rails", "~> 7.1"
4
3
  end
5
4
 
6
- appraise "rails-6.0" do
7
- gem "rails", "~> 6.0"
5
+ appraise "rails-7.0" do
6
+ gem "rails", "~> 7.0"
7
+ end
8
+
9
+ appraise "rails-6.1" do
10
+ gem "rails", "~> 6.1"
8
11
  gem "dryer-config", "~> 6.0"
9
12
  end
10
13
 
14
+ # appraise "rails-6.0" do
15
+ # gem "rails", "~> 6.0"
16
+ # gem "dryer-config", "~> 6.0"
17
+ # end
18
+ #
11
19
  # appraise 'rails-5.2' do
12
20
  # gem 'rails', '~> 5.2.0'
13
21
  # gem 'dryer-config', '~> 5.2.0'
14
22
  # end
15
-
23
+ #
16
24
  # appraise 'rails-5.0' do
17
25
  # gem 'rails', '~> 5.0.0'
18
26
  # gem 'dryer-config', '~> 5.0.0'
19
27
  # end
20
-
21
- # appraise 'rails-4.1' do
22
- # gem 'rails', '= 4.1.1'
23
- ## gem 'dryer-config', '~> 5.1.0'
24
- # end
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gem "rails"
5
5
 
6
6
  group :test do
7
7
  gem "observr"
8
- gem "standard", require: false
9
- gem "simplecov", require: false
10
8
  gem "ricecream"
9
+ gem "simplecov", require: false
10
+ gem "standard", require: false
11
11
  end
data/MIT-LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright 2010-2022 Dittmar Krall - www.matiq.com
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2010-2023 Dittmar Krall (www.matiq.com)
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,14 +1,22 @@
1
- ActWithBag
2
- ==========
3
- [![Gem Version](https://badge.fury.io/rb/act_with_bag.png)](http://badge.fury.io/rb/act_with_bag)
4
-
5
- In Gemfile:
1
+ # ActWithBag
6
2
 
7
- gem 'act_with_bag'
3
+ [![Gem Version](https://badge.fury.io/rb/act_with_bag.png)](http://badge.fury.io/rb/act_with_bag)
4
+ [![GEM Downloads](https://img.shields.io/gem/dt/act_with_bag?color=168AFE&logo=ruby&logoColor=FE1616)](https://rubygems.org/gems/act_with_bag)
8
5
 
9
6
  Bag helps when fields in a Rails database table are not yet settled down
10
7
  or when many fields without business logic are required.
11
8
 
9
+ ## Installation
10
+
11
+ As usual:
12
+ ```ruby
13
+ # Gemfile
14
+ gem "act_with_bag"
15
+ ```
16
+ and run "bundle install".
17
+
18
+ ## Usage
19
+
12
20
  Install (migrate) one bag as a text field in a table to collect many fields.
13
21
  Additional fields or removal of them are easy;
14
22
  no migrations are required for them.
@@ -36,8 +44,7 @@ Obsolete fields are deleted before_save by:
36
44
  delete_from_bag :field
37
45
 
38
46
 
39
- Warning
40
- =======
47
+ ## Warning
41
48
 
42
49
  1. Please add a:
43
50
 
@@ -68,8 +75,7 @@ The configuration
68
75
  may be incomplete requiring additional classes like "Time" and "Date".
69
76
  (credits to Martin Sch�ttler).
70
77
 
71
- Example
72
- =======
78
+ ## Example
73
79
 
74
80
  In model:
75
81
 
@@ -103,9 +109,11 @@ In controller:
103
109
  params = Order.merge(@order.bag, self.params) # only if type :date is being used
104
110
  @order.update_attributes(params[:order])
105
111
 
106
- Test
107
- ====
112
+ ## Test
113
+
114
+ bundle exec rake
108
115
 
109
- rake
116
+ ## Miscellaneous
110
117
 
111
- Copyright (c) 2009-2022 [Dittmar Krall], released under the MIT license
118
+ Copyright (c) 2009-2023 Dittmar Krall (www.matiq.com),
119
+ released under the [MIT license](https://opensource.org/licenses/MIT).
data/act_with_bag.gemspec CHANGED
@@ -9,12 +9,10 @@ Gem::Specification.new do |s|
9
9
  s.description = "Add a bag to a Rails model"
10
10
  s.authors = ["Dittmar Krall"]
11
11
  s.email = ["dittmar.krall@matiq.com"]
12
- s.homepage = "http://matiq.com"
12
+ s.homepage = "https://github.com/matique/act_with_bag"
13
13
  s.license = "MIT"
14
14
  s.platform = Gem::Platform::RUBY
15
15
 
16
- s.metadata["source_code_uri"] = "https://github.com/matique/act_with_bag"
17
-
18
16
  s.files = `git ls-files -z`.split("\x0")
19
17
  s.require_paths = ["lib"]
20
18
 
@@ -7,9 +7,9 @@ gem "dryer-config", "~> 6.0"
7
7
 
8
8
  group :test do
9
9
  gem "observr"
10
- gem "standard", require: false
11
- gem "simplecov", require: false
12
10
  gem "ricecream"
11
+ gem "simplecov", require: false
12
+ gem "standard", require: false
13
13
  end
14
14
 
15
15
  gemspec path: "../"
@@ -2,14 +2,13 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 6.0"
6
- gem "dryer-config", "~> 6.0"
5
+ gem "rails", "~> 7.0"
7
6
 
8
7
  group :test do
9
8
  gem "observr"
10
- gem "standard", require: false
11
- gem "simplecov", require: false
12
9
  gem "ricecream"
10
+ gem "simplecov", require: false
11
+ gem "standard", require: false
13
12
  end
14
13
 
15
14
  gemspec path: "../"
@@ -0,0 +1,14 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 7.1"
6
+
7
+ group :test do
8
+ gem "observr"
9
+ gem "ricecream"
10
+ gem "simplecov", require: false
11
+ gem "standard", require: false
12
+ end
13
+
14
+ gemspec path: "../"
@@ -1,5 +1,7 @@
1
1
  module ActWithBag
2
- VERSION = "1.1.1" # 2022-12-11
2
+ VERSION = "1.1.3" # 2023-12-10
3
+ # VERSION = "1.1.2" # 2023-04-22
4
+ # VERSION = "1.1.1" # 2022-12-11
3
5
  # VERSION = "1.1.0" # 2022-08-07
4
6
  # VERSION = "1.0.4" # 2021-06-17
5
7
  # VERSION = "1.0.3" # 2021-05-18
data/lib/act_with_bag.rb CHANGED
@@ -3,6 +3,11 @@
3
3
  class << ActiveRecord::Base
4
4
  def add_to_bag(*baglets)
5
5
  # p "baglets #{baglets.inspect}"
6
+ # if Rails.version < "7.1.0"
7
+ # serialize :bag, Hash
8
+ # else
9
+ # serialize :bag, type: Hash, coder: YAML
10
+ # end
6
11
  serialize :bag, Hash
7
12
 
8
13
  class_eval %{
@@ -11,7 +16,7 @@ class << ActiveRecord::Base
11
16
  #bag changes disabled as it must be handled by Bag himself
12
17
  end
13
18
  end
14
- }, __FILE__, __LINE__ - 4
19
+ }, __FILE__, __LINE__ - 6
15
20
 
16
21
  @baggies_date ||= {}
17
22
  baglets.each { |b|
@@ -1,3 +1,3 @@
1
1
  class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
2
+ primary_abstract_class
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: act_with_bag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-11 00:00:00.000000000 Z
11
+ date: 2023-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,15 +105,15 @@ files:
105
105
  - ".gitignore"
106
106
  - ".ruby-gemset"
107
107
  - ".ruby-version"
108
- - ".watchr"
109
108
  - Appraisals
110
109
  - Gemfile
111
110
  - MIT-LICENSE
112
111
  - README.md
113
112
  - Rakefile
114
113
  - act_with_bag.gemspec
115
- - gemfiles/rails_6.0.gemfile
116
114
  - gemfiles/rails_6.1.gemfile
115
+ - gemfiles/rails_7.0.gemfile
116
+ - gemfiles/rails_7.1.gemfile
117
117
  - lib/act_with_bag.rb
118
118
  - lib/act_with_bag/version.rb
119
119
  - test/accessor_test.rb
@@ -130,11 +130,10 @@ files:
130
130
  - test/string_test.rb
131
131
  - test/test_helper.rb
132
132
  - test/type_test.rb
133
- homepage: http://matiq.com
133
+ homepage: https://github.com/matique/act_with_bag
134
134
  licenses:
135
135
  - MIT
136
- metadata:
137
- source_code_uri: https://github.com/matique/act_with_bag
136
+ metadata: {}
138
137
  post_install_message:
139
138
  rdoc_options: []
140
139
  require_paths:
@@ -150,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
149
  - !ruby/object:Gem::Version
151
150
  version: '0'
152
151
  requirements: []
153
- rubygems_version: 3.3.26
152
+ rubygems_version: 3.4.20
154
153
  signing_key:
155
154
  specification_version: 4
156
155
  summary: act_with_bag (baggies) gem
data/.watchr DELETED
@@ -1,61 +0,0 @@
1
- TESTING = %w[test]
2
- HH = "#" * 22 unless defined?(HH)
3
- H = "#" * 5 unless defined?(H)
4
-
5
- def usage
6
- puts <<-EOS
7
- Ctrl-\\ or ctrl-4 Running all tests
8
- Ctrl-C Exit
9
- EOS
10
- end
11
-
12
- def run(cmd)
13
- puts "#{HH} #{Time.now} #{HH}"
14
- puts "#{H} #{cmd}"
15
- system "/usr/bin/time --format '#{HH} Elapsed time %E' #{cmd}"
16
- end
17
-
18
- def run_it(type, files)
19
- files.split(" ").flatten.each do |file|
20
- case type
21
- when "test" then run %(bundle exec ruby -I test #{file})
22
- # when 'spec'; run %(rspec -X #{file})
23
- else; puts "#{H} unknown type: #{type}, file: #{file}"
24
- end
25
- end
26
- end
27
-
28
- def run_all_tests
29
- puts "\n#{HH} Running all tests #{HH}\n"
30
- TESTING.each { |dir| run "bundle exec rake #{dir}" if File.exist?(dir) }
31
- end
32
-
33
- def run_matching_files(base)
34
- base = base.split("_").first
35
- TESTING.each { |type|
36
- files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
37
- run_it type, files.join(" ") unless files.empty?
38
- }
39
- end
40
-
41
- TESTING.each { |type|
42
- watch("#{type}/#{type}_helper\.rb") { run_all_tests }
43
- watch("lib/.*\.rb") { run_all_tests }
44
- watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
45
- watch("#{type}/data/(.*)\.rb") { |match|
46
- m1 = match[1]
47
- run_matching_files("#{type}/#{m1}/#{m1}_#{type}.rb")
48
- }
49
- }
50
-
51
- %w[rb erb haml slim].each { |type|
52
- watch(".*/(.*)\.#{type}") { |match|
53
- run_matching_files(match[1])
54
- }
55
- }
56
-
57
- # Ctrl-\ or ctrl-4
58
- Signal.trap("QUIT") { run_all_tests }
59
- # Ctrl-C
60
- Signal.trap("INT") { abort("Interrupted\n") }
61
- usage