nostalgic 0.5.2 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4418d5ac68107e4235b127b04376c9102fdf9bd667b4c6aff7fdc9932ea685f
4
- data.tar.gz: 40e667462f9bb333254b04df8383affff622e7ae8d9e3821f3ad989c78adf22c
3
+ metadata.gz: b1c913b6a9c20163ea1909c231cc1d79e41835bbd508f5f0da14e04fed37c3b5
4
+ data.tar.gz: 420b51558070d3ee4e6b0cd2f36604be960c413ac08a2a86bd8a8a5de859a17d
5
5
  SHA512:
6
- metadata.gz: 3480f68ac795d8ed81cb8dfd6f5b9db21f3c289f835a428ebcec45a1163be670244f7fe9f5d5434bd4c7f7b36fc04450c5b83f8065187d86261628d6ca400fe8
7
- data.tar.gz: bc2c3809fc452b87adfa1ac4ad54244f90b9549f93fc3e55c3a240c606b3cb8b617c302e143ae45e3f394bdd7087ae264dde1680be3f538a2fe71888ba2a463e
6
+ metadata.gz: b99e202af9dfb5346a95da64b144e366dc3a2726b42d1fb52fcad2e4f646c16193d6f044a9633cbbc425fbd4857adef7c8ee1d82e07b074f2130e7ad9b22c320
7
+ data.tar.gz: 3df24780e47be0477a2c46e353188a6812392ed771584269c64d93fa8e6ddb58b89a30ccae70337345c96ba498d0b5b12c336780786235ac21bc20c03c80a827
data/Rakefile CHANGED
@@ -1,32 +1,12 @@
1
- begin
2
- require 'bundler/setup'
3
- rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- end
6
-
7
- require 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'Nostalgic'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.md')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
15
- end
16
-
17
- APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
18
- load 'rails/tasks/engine.rake'
19
-
20
- load 'rails/tasks/statistics.rake'
21
-
22
- require 'bundler/gem_tasks'
1
+ require "bundler/gem_tasks"
23
2
 
24
3
  require 'rake/testtask'
25
4
 
26
5
  Rake::TestTask.new(:test) do |t|
6
+ t.libs << 'lib'
27
7
  t.libs << 'test'
28
8
  t.pattern = 'test/**/*_test.rb'
29
9
  t.verbose = false
30
10
  end
31
11
 
32
- task default: :test
12
+ task :default => :test
@@ -68,46 +68,25 @@ module Nostalgic
68
68
  end
69
69
  end
70
70
 
71
- if Rails::VERSION::MAJOR == 5 and Rails::VERSION::MINOR >= 2
72
- def belongs_to(name, scope = nil, **options)
73
- super(name, scope, options.except(:nostalgic))
74
-
75
- if options.fetch(:nostalgic, false)
76
- foreign_key = options.fetch(:foreign_key, "#{name}_id")
77
- nostalgic_attr foreign_key
78
-
79
- class_eval <<-METHODS, __FILE__, __LINE__ + 1
80
- def #{name}_on(date)
81
- return self.#{name} unless date.present?
82
-
83
- '#{name}'.classify.constantize.find_by_id(#{foreign_key}_on(date))
84
- end
85
-
86
- alias_method :#{name}_at, :#{name}_on
87
- METHODS
88
- end
89
- end
90
- else
91
- def belongs_to(name, scope = nil, options = {})
92
- scope ||= {}
93
- super(name, scope.except(:nostalgic), options)
94
-
95
- if scope.fetch(:nostalgic, false)
96
- foreign_key = options.fetch(:foreign_key, "#{name}_id")
97
- nostalgic_attr foreign_key
98
-
99
- class_eval <<-METHODS, __FILE__, __LINE__ + 1
100
- def #{name}_on(date)
101
- return self.#{name} unless date.present?
102
-
103
- '#{name}'.classify.constantize.find_by_id(#{foreign_key}_on(date))
104
- end
105
-
106
- alias_method :#{name}_at, :#{name}_on
107
- METHODS
108
- end
71
+ def belongs_to(name, scope = nil, **options)
72
+ super(name, scope, **options.except(:nostalgic))
73
+
74
+ if options.fetch(:nostalgic, false)
75
+ foreign_key = options.fetch(:foreign_key, "#{name}_id")
76
+ nostalgic_attr foreign_key
77
+
78
+ class_eval <<-METHODS, __FILE__, __LINE__ + 1
79
+ def #{name}_on(date)
80
+ return self.#{name} unless date.present?
81
+
82
+ '#{name}'.classify.constantize.find_by_id(#{foreign_key}_on(date))
83
+ end
84
+
85
+ alias_method :#{name}_at, :#{name}_on
86
+ METHODS
109
87
  end
110
88
  end
89
+
111
90
  end
112
91
  end
113
92
  end
@@ -1,3 +1,3 @@
1
1
  module Nostalgic
2
- VERSION = '0.5.2'
2
+ VERSION = '0.6.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nostalgic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-18 00:00:00.000000000 Z
11
+ date: 2024-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,76 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '6'
19
+ version: '5.2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '4.2'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '6'
26
+ version: '5.2'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: bundler
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - ">="
31
+ - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '0'
33
+ version: '2.0'
40
34
  type: :development
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - ">="
38
+ - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '0'
40
+ version: '2.0'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: minitest
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - ">="
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: '5.25'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
- - - ">="
52
+ - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '0'
54
+ version: '5.25'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: rake
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - ">="
59
+ - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: '0'
61
+ version: '12.0'
68
62
  type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '0'
75
- - !ruby/object:Gem::Dependency
76
- name: sqlite3
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: '0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
66
+ - - "~>"
87
67
  - !ruby/object:Gem::Version
88
- version: '0'
68
+ version: '12.0'
89
69
  description: column versioning utility
90
70
  email:
91
71
  - ichylinux@gmail.com
@@ -135,14 +115,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
115
  requirements:
136
116
  - - ">="
137
117
  - !ruby/object:Gem::Version
138
- version: 2.5.0
118
+ version: 2.7.0
139
119
  required_rubygems_version: !ruby/object:Gem::Requirement
140
120
  requirements:
141
121
  - - ">="
142
122
  - !ruby/object:Gem::Version
143
123
  version: '0'
144
124
  requirements: []
145
- rubygems_version: 3.0.3
125
+ rubygems_version: 3.4.22
146
126
  signing_key:
147
127
  specification_version: 4
148
128
  summary: column versioning utility