tableless 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +37 -0
- data/README.md +1 -1
- data/lib/tableless/callbacks.rb +2 -0
- data/lib/tableless/connection.rb +6 -0
- data/lib/tableless/connection_adapters/dummy_adapter.rb +10 -0
- data/lib/tableless/connection_adapters/schema_cache.rb +6 -4
- data/lib/tableless/persistence.rb +3 -1
- data/lib/tableless/querying.rb +6 -0
- data/lib/tableless/version.rb +3 -1
- data/lib/tableless.rb +2 -0
- metadata +18 -19
- data/Gemfile +0 -4
- data/Rakefile +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 937915dbf96679728039af2a45f82cca5efa9ba35fa2414c9f8123d1b55143ce
|
4
|
+
data.tar.gz: a2459459d1b3da8a472e64cb6d5512a828c528bac3af65e26440285b110ebab7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd45db20682c3b8ab71732bed6db6f1bdcffbad471a35a9d8037d79dfe9cf6f484c2282bc9252fdd262a758e1dc1f2f7cd4310fe683dba9a72a8946b6dc7644e
|
7
|
+
data.tar.gz: d4784cae1e108a3c2852495ecbfd5c01bb4342587a5264e9c6a4a49369e5fbfce3569a7e08d57f9e439d5bc6c1e8165256638a43f21f9bfbc1d77d34fdbbefcb
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Code of Conduct
|
2
|
+
|
3
|
+
All participants of this project are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with this project.
|
4
|
+
|
5
|
+
## The Pledge
|
6
|
+
|
7
|
+
In the interest of fostering an open and welcoming environment, we pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
8
|
+
|
9
|
+
## The Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to creating a positive environment include:
|
12
|
+
|
13
|
+
* Using welcoming and inclusive language
|
14
|
+
* Being respectful of differing viewpoints and experiences
|
15
|
+
* Referring to people by their preferred pronouns and using gender-neutral pronouns when uncertain
|
16
|
+
* Gracefully accepting constructive criticism
|
17
|
+
* Focusing on what is best for the community
|
18
|
+
* Showing empathy towards other community members
|
19
|
+
|
20
|
+
Examples of unacceptable behavior by participants include:
|
21
|
+
|
22
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
23
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
26
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
27
|
+
* Dismissing or attacking inclusion-oriented requests
|
28
|
+
|
29
|
+
## Enforcement
|
30
|
+
|
31
|
+
Violations of the Code of Conduct may be reported by sending an email to info@hardpixel.eu. All reports will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Further details of specific enforcement policies may be posted separately.
|
32
|
+
|
33
|
+
We hold the right and responsibility to remove comments or other contributions that are not aligned to this Code of Conduct, or to suspend temporarily or permanently any members for other behaviors that are inappropriate, threatening, offensive, or harmful.
|
34
|
+
|
35
|
+
## Attribution
|
36
|
+
|
37
|
+
This Code of Conduct is adapted from [dev.to](https://dev.to/code-of-conduct).
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Create models that are not bound to the database and take advantage of the ActiveRecord features, such as validation, relationships, etc.
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/tableless.svg)](https://badge.fury.io/rb/tableless)
|
6
|
-
[![Build
|
6
|
+
[![Build](https://github.com/hardpixel/tableless/actions/workflows/build.yml/badge.svg)](https://github.com/hardpixel/tableless/actions/workflows/build.yml)
|
7
7
|
[![Maintainability](https://api.codeclimate.com/v1/badges/853a6013a50339b2baea/maintainability)](https://codeclimate.com/github/hardpixel/tableless/maintainability)
|
8
8
|
|
9
9
|
## Installation
|
data/lib/tableless/callbacks.rb
CHANGED
data/lib/tableless/connection.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'tableless/connection_adapters/schema_cache'
|
2
4
|
require 'tableless/connection_adapters/dummy_adapter'
|
3
5
|
|
@@ -13,6 +15,10 @@ module Tableless
|
|
13
15
|
def attribute_names
|
14
16
|
@attribute_names ||= attribute_types.keys
|
15
17
|
end
|
18
|
+
|
19
|
+
def connection_pool(*)
|
20
|
+
@connection_pool ||= Tableless::DummyAdapter.new(nil)
|
21
|
+
end
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tableless
|
2
4
|
class DummyAdapter < ActiveRecord::ConnectionAdapters::AbstractAdapter
|
3
5
|
def initialize(*)
|
@@ -8,5 +10,13 @@ module Tableless
|
|
8
10
|
def schema_cache
|
9
11
|
@schema_cache
|
10
12
|
end
|
13
|
+
|
14
|
+
def get_schema_cache(*)
|
15
|
+
@schema_cache
|
16
|
+
end
|
17
|
+
|
18
|
+
def db_config(*)
|
19
|
+
@db_config ||= OpenStruct.new(adapter: :dummy)
|
20
|
+
end
|
11
21
|
end
|
12
22
|
end
|
@@ -1,18 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tableless
|
2
4
|
class SchemaCache
|
3
|
-
def columns_hash(
|
5
|
+
def columns_hash(_table_name)
|
4
6
|
{}
|
5
7
|
end
|
6
8
|
|
7
|
-
def columns_hash?(
|
9
|
+
def columns_hash?(_table_name)
|
8
10
|
true
|
9
11
|
end
|
10
12
|
|
11
|
-
def data_source_exists?(
|
13
|
+
def data_source_exists?(_table_name)
|
12
14
|
false
|
13
15
|
end
|
14
16
|
|
15
|
-
def clear_data_source_cache!(
|
17
|
+
def clear_data_source_cache!(_table_name)
|
16
18
|
true
|
17
19
|
end
|
18
20
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tableless
|
2
4
|
module Persistence
|
3
5
|
extend ActiveSupport::Concern
|
@@ -13,7 +15,7 @@ module Tableless
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def reload(*)
|
16
|
-
@attributes = self.class.new.instance_variable_get(
|
18
|
+
@attributes = self.class.new.instance_variable_get(:@attributes)
|
17
19
|
@new_record = false
|
18
20
|
self
|
19
21
|
end
|
data/lib/tableless/querying.rb
CHANGED
data/lib/tableless/version.rb
CHANGED
data/lib/tableless.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tableless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonian Guveli
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '6.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,33 +45,33 @@ dependencies:
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '2.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: minitest
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '5.0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '5.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '13.0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '13.0'
|
75
75
|
description: Create models that are not bound to the database and take advantage of
|
76
76
|
the ActiveRecord features, such as validation, relationships, etc.
|
77
77
|
email:
|
@@ -80,10 +80,9 @@ executables: []
|
|
80
80
|
extensions: []
|
81
81
|
extra_rdoc_files: []
|
82
82
|
files:
|
83
|
-
-
|
83
|
+
- CODE_OF_CONDUCT.md
|
84
84
|
- LICENSE.txt
|
85
85
|
- README.md
|
86
|
-
- Rakefile
|
87
86
|
- lib/tableless.rb
|
88
87
|
- lib/tableless/callbacks.rb
|
89
88
|
- lib/tableless/connection.rb
|
@@ -96,7 +95,7 @@ homepage: https://github.com/hardpixel/tableless
|
|
96
95
|
licenses:
|
97
96
|
- MIT
|
98
97
|
metadata: {}
|
99
|
-
post_install_message:
|
98
|
+
post_install_message:
|
100
99
|
rdoc_options: []
|
101
100
|
require_paths:
|
102
101
|
- lib
|
@@ -104,15 +103,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
103
|
requirements:
|
105
104
|
- - ">="
|
106
105
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
106
|
+
version: '2.6'
|
108
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
108
|
requirements:
|
110
109
|
- - ">="
|
111
110
|
- !ruby/object:Gem::Version
|
112
111
|
version: '0'
|
113
112
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
113
|
+
rubygems_version: 3.3.7
|
114
|
+
signing_key:
|
116
115
|
specification_version: 4
|
117
116
|
summary: ActiveRecord models without database tables
|
118
117
|
test_files: []
|
data/Gemfile
DELETED