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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8450c2eb44270d1607075b7788e77737a668d7665de6d4030ed703db71ab5759
4
- data.tar.gz: b1f8c46679f6bb45872321879a2baea28474dacea63dea9b54ab7c3f0a73e9b5
3
+ metadata.gz: 937915dbf96679728039af2a45f82cca5efa9ba35fa2414c9f8123d1b55143ce
4
+ data.tar.gz: a2459459d1b3da8a472e64cb6d5512a828c528bac3af65e26440285b110ebab7
5
5
  SHA512:
6
- metadata.gz: ab98abd01f72e1e1f95d29a466a039866c920493610ee7f1c604ad917cf13fdf4de94816fea88c5905d852c460a7e9ab92852bb96da3a341e04899bd567b7d4c
7
- data.tar.gz: '089662f365a10a76c2d88d85f6f44a9bbbf3de1a026e3108ab76348641fffa0f8b97dc5b0889ce70122209d582b42260a2a801aeeb3f5dd97d748ba38a855bef'
6
+ metadata.gz: bd45db20682c3b8ab71732bed6db6f1bdcffbad471a35a9d8037d79dfe9cf6f484c2282bc9252fdd262a758e1dc1f2f7cd4310fe683dba9a72a8946b6dc7644e
7
+ data.tar.gz: d4784cae1e108a3c2852495ecbfd5c01bb4342587a5264e9c6a4a49369e5fbfce3569a7e08d57f9e439d5bc6c1e8165256638a43f21f9bfbc1d77d34fdbbefcb
@@ -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 Status](https://travis-ci.org/hardpixel/tableless.svg?branch=master)](https://travis-ci.org/hardpixel/tableless)
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tableless
2
4
  module Callbacks
3
5
  extend ActiveSupport::Concern
@@ -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(table_name)
5
+ def columns_hash(_table_name)
4
6
  {}
5
7
  end
6
8
 
7
- def columns_hash?(table_name)
9
+ def columns_hash?(_table_name)
8
10
  true
9
11
  end
10
12
 
11
- def data_source_exists?(table_name)
13
+ def data_source_exists?(_table_name)
12
14
  false
13
15
  end
14
16
 
15
- def clear_data_source_cache!(table_name)
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('@attributes')
18
+ @attributes = self.class.new.instance_variable_get(:@attributes)
17
19
  @new_record = false
18
20
  self
19
21
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tableless
2
4
  module Querying
3
5
  extend ActiveSupport::Concern
@@ -6,6 +8,10 @@ module Tableless
6
8
  def find_by_sql(*)
7
9
  []
8
10
  end
11
+
12
+ def _query_by_sql(*)
13
+ []
14
+ end
9
15
  end
10
16
  end
11
17
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tableless
2
- VERSION = '0.1.4'
4
+ VERSION = '0.2.0'
3
5
  end
data/lib/tableless.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_record'
2
4
  require 'tableless/version'
3
5
 
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.1.4
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: 2019-12-16 00:00:00.000000000 Z
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: '5.0'
19
+ version: '6.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.0'
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: '5.0'
29
+ version: '6.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.0'
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: rake
48
+ name: minitest
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '10.0'
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: '10.0'
60
+ version: '5.0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: minitest
62
+ name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '5.0'
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: '5.0'
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
- - Gemfile
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: '0'
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.0.6
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
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in tableless.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << 'test'
6
- t.libs << 'lib'
7
- t.test_files = FileList['test/**/*_test.rb']
8
- end
9
-
10
- task :default => :test