act_with_bag 1.1.0 → 1.1.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 +4 -4
- data/.github/workflows/rake.yml +2 -6
- data/.ruby-version +1 -1
- data/Appraisals +11 -11
- data/Gemfile +2 -3
- data/MIT-LICENSE +3 -1
- data/README.md +23 -14
- data/lib/act_with_bag/version.rb +3 -1
- data/lib/act_with_bag.rb +5 -3
- metadata +3 -4
- data/.watchr +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 871f3f51d537f9fb7c8c3ae382f5d7f2c7349deb804800ca542234efbb6a5610
|
4
|
+
data.tar.gz: 02d895e0fe5e183359a251ab4471251e72cd712fb857b58bd2c4da97dd7bf12a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cdfeb658c20412bb3bc41ab5356c339da8441bda6fbaea054ebb58aa9feb7bb969ed95fb6821a77193e1f564b6a7e5a39af87230359e7011f93d578910ab3be
|
7
|
+
data.tar.gz: 4eb41d1ffc191cc1f52a2cf35cb50d7c3b0144fa04bb8b91c439514a09c62df61c37c60cab26054d57c768b6134fe38501cb224c4c4eccf2f04d6bebe4845df1
|
data/.github/workflows/rake.yml
CHANGED
@@ -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,16 +8,13 @@ jobs:
|
|
9
8
|
strategy:
|
10
9
|
fail-fast: false
|
11
10
|
matrix:
|
12
|
-
# os: [ubuntu-latest, macos-latest]
|
13
11
|
os: [ubuntu-latest]
|
14
|
-
|
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, 3.1.2]
|
12
|
+
ruby: ["2.7", "3.0", "3.2", head]
|
17
13
|
test_command: ["bundle exec rake test"]
|
18
14
|
runs-on: ${{ matrix.os }}
|
19
15
|
|
20
16
|
steps:
|
21
|
-
- uses: actions/checkout@
|
17
|
+
- uses: actions/checkout@v3
|
22
18
|
- uses: ruby/setup-ruby@v1
|
23
19
|
with:
|
24
20
|
ruby-version: ${{ matrix.ruby }}
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-3.
|
1
|
+
ruby-3.2.2
|
data/Appraisals
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
appraise "rails-
|
2
|
-
gem "rails", "~>
|
3
|
-
gem "dryer-config", "~>
|
1
|
+
appraise "rails-7.0" do
|
2
|
+
gem "rails", "~> 7.0"
|
3
|
+
gem "dryer-config", "~> 7.0"
|
4
4
|
end
|
5
5
|
|
6
|
-
appraise "rails-6.
|
7
|
-
gem "rails", "~> 6.
|
6
|
+
appraise "rails-6.1" do
|
7
|
+
gem "rails", "~> 6.1"
|
8
8
|
gem "dryer-config", "~> 6.0"
|
9
9
|
end
|
10
10
|
|
11
|
+
# appraise "rails-6.0" do
|
12
|
+
# gem "rails", "~> 6.0"
|
13
|
+
# gem "dryer-config", "~> 6.0"
|
14
|
+
# end
|
15
|
+
#
|
11
16
|
# appraise 'rails-5.2' do
|
12
17
|
# gem 'rails', '~> 5.2.0'
|
13
18
|
# gem 'dryer-config', '~> 5.2.0'
|
14
19
|
# end
|
15
|
-
|
20
|
+
#
|
16
21
|
# appraise 'rails-5.0' do
|
17
22
|
# gem 'rails', '~> 5.0.0'
|
18
23
|
# gem 'dryer-config', '~> 5.0.0'
|
19
24
|
# 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
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
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,21 @@
|
|
1
|
-
ActWithBag
|
2
|
-
==========
|
3
|
-
[](http://badge.fury.io/rb/act_with_bag)
|
4
|
-
|
5
|
-
In Gemfile:
|
1
|
+
# ActWithBag
|
6
2
|
|
7
|
-
|
3
|
+
[](http://badge.fury.io/rb/act_with_bag)
|
8
4
|
|
9
5
|
Bag helps when fields in a Rails database table are not yet settled down
|
10
6
|
or when many fields without business logic are required.
|
11
7
|
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
As usual:
|
11
|
+
```ruby
|
12
|
+
# Gemfile
|
13
|
+
gem "act_with_bag"
|
14
|
+
```
|
15
|
+
and run "bundle install".
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
12
19
|
Install (migrate) one bag as a text field in a table to collect many fields.
|
13
20
|
Additional fields or removal of them are easy;
|
14
21
|
no migrations are required for them.
|
@@ -36,8 +43,7 @@ Obsolete fields are deleted before_save by:
|
|
36
43
|
delete_from_bag :field
|
37
44
|
|
38
45
|
|
39
|
-
Warning
|
40
|
-
=======
|
46
|
+
## Warning
|
41
47
|
|
42
48
|
1. Please add a:
|
43
49
|
|
@@ -68,8 +74,7 @@ The configuration
|
|
68
74
|
may be incomplete requiring additional classes like "Time" and "Date".
|
69
75
|
(credits to Martin Sch�ttler).
|
70
76
|
|
71
|
-
Example
|
72
|
-
=======
|
77
|
+
## Example
|
73
78
|
|
74
79
|
In model:
|
75
80
|
|
@@ -103,9 +108,13 @@ In controller:
|
|
103
108
|
params = Order.merge(@order.bag, self.params) # only if type :date is being used
|
104
109
|
@order.update_attributes(params[:order])
|
105
110
|
|
106
|
-
Test
|
107
|
-
|
111
|
+
## Test
|
112
|
+
|
113
|
+
bundle exec rake
|
114
|
+
|
115
|
+
## Miscellaneous
|
108
116
|
|
109
|
-
|
117
|
+
Copyright (c) 2009-2023 Dittmar Krall (www.matiq.com),
|
118
|
+
released under the MIT license:
|
110
119
|
|
111
|
-
|
120
|
+
* https://opensource.org/licenses/MIT
|
data/lib/act_with_bag/version.rb
CHANGED
data/lib/act_with_bag.rb
CHANGED
@@ -6,10 +6,12 @@ class << ActiveRecord::Base
|
|
6
6
|
serialize :bag, Hash
|
7
7
|
|
8
8
|
class_eval %{
|
9
|
-
|
10
|
-
|
9
|
+
unless method_defined?(:bag=)
|
10
|
+
def bag=(x)
|
11
|
+
#bag changes disabled as it must be handled by Bag himself
|
12
|
+
end
|
11
13
|
end
|
12
|
-
}, __FILE__, __LINE__ -
|
14
|
+
}, __FILE__, __LINE__ - 6
|
13
15
|
|
14
16
|
@baggies_date ||= {}
|
15
17
|
baglets.each { |b|
|
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.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -105,7 +105,6 @@ files:
|
|
105
105
|
- ".gitignore"
|
106
106
|
- ".ruby-gemset"
|
107
107
|
- ".ruby-version"
|
108
|
-
- ".watchr"
|
109
108
|
- Appraisals
|
110
109
|
- Gemfile
|
111
110
|
- MIT-LICENSE
|
@@ -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.
|
152
|
+
rubygems_version: 3.4.10
|
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
|