file_db 1.1.0 → 1.1.1

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
  SHA1:
3
- metadata.gz: cc4e8dd718db7789387f56d6284c765a7998676f
4
- data.tar.gz: 4ca6334901b89f66146b8fcbaa9ca88b45d8d1bc
3
+ metadata.gz: 63c376f0b241335a0e0ffc757164d93ea98904a8
4
+ data.tar.gz: 889dccfdc8a73c55816ab6b6ddcdb549836e16d5
5
5
  SHA512:
6
- metadata.gz: 6b27f62a9ba6677a138ceb7952301af59341023e1b41e7aeda81b69ecbebe6069835edc0d639aaf91327d7abee790c315457afdbe7dd15e0df56d55f79e51eb1
7
- data.tar.gz: f4d2aff276e4d3300a246d4a9e293f4bb6e795f858bf2b4948781a17867a3b2d9dc5385b0c1cc858eb235904022511baef9adf4da6dbc07cce5d396821c453c3
6
+ metadata.gz: 69e50f3a771e1d9a3f9d8419cb135c2fa9f5026ea902a4dfb04a3e27bb3188e5a1b4193b99708c0565a40ea86292c0a936b62f8e7dae5041a5897e79be925c5b
7
+ data.tar.gz: 63a38fe8b677f8e0e62cac40d0a2c59f4e32479628128666297837b8cf73c7f128195b1e46b2eb8aecf0c835993513b866f388bb9f28f9df721d3acad9acadb3
data/README.md CHANGED
@@ -21,59 +21,42 @@ Or install it yourself as:
21
21
 
22
22
  Huh, ready to use!
23
23
 
24
- ## Differences to Version 0.7.0
25
-
26
- Fieldnames are now in the first line of the table file.
27
-
28
- And:
29
-
30
24
  ### Performance
31
25
 
32
- #### 0.7.0 with 1000 Entries
33
-
34
- | Action | Time in Milliseconds |
35
- |---|---|
36
- |getting the first|29.194|
37
- |update record|39.226|
38
- |create record|74.994|
39
- |using where with 1 parameter|8.700|
40
- |using where with 2 parameter|9.775|
41
- |find |9.507|
42
-
43
- #### 1.0.0 with 1000 Entries
26
+ #### with 1.000 Entries
44
27
 
45
28
  | Action | Time in Milliseconds |
46
29
  |---|---|
47
30
  |getting the first|0.031|
48
- |update record|4.629|
49
- |create record|3.673|
31
+ |update record|3.262|
32
+ |create record|2.712|
50
33
  |using where with 1 parameter|0.535|
51
34
  |using where with 2 parameter|0.337|
52
35
  |find |0.030|
53
36
 
54
- #### 0.7.0 with 5000 Entries
55
-
56
- | Action | Time in Milliseconds |
57
- |---|---|
58
- |getting the first|88.852|
59
- |update record|122.662|
60
- |create record|284.086|
61
- |using where with 1 parameter|35.795|
62
- |using where with 2 parameter|35.125|
63
- |find |35.881|
64
-
65
- #### 1.0.0 with 5000 Entries
37
+ #### with 5.000 Entries
66
38
 
67
39
  | Action | Time in Milliseconds |
68
40
  |---|---|
69
41
  |getting the first|0.037|
70
- |update record|14.405|
71
- |create record|9.705|
42
+ |update record|10.814|
43
+ |create record|12.683|
72
44
  |using where with 1 parameter|1.846|
73
45
  |using where with 2 parameter|2.027|
74
46
  |find |0.019|
75
47
 
48
+ #### with 10.000 Entries
76
49
 
50
+ | Action | Time in Milliseconds |
51
+ |---|---|
52
+ |getting the first|0.045|
53
+ |update record|34.187|
54
+ |create record|21.203|
55
+ |using where with 1 parameter|4.264|
56
+ |using where with 2 parameter|5.076|
57
+ |find |0.053|
58
+
59
+ Please look at the [wiki](https://github.com/robst/file_db/wiki)
77
60
 
78
61
  ## Usage
79
62
 
@@ -6,14 +6,16 @@ module FileDb
6
6
  names.delete(:id)
7
7
  @columns = [:id] + names
8
8
 
9
+ @columns_hash = {}
9
10
  @columns.each do |name|
11
+ @columns_hash[name] = true
10
12
  define_method name do
11
13
  instance_variable_get "@#{name}"
12
- end
14
+ end
13
15
  define_method "#{name}=" do |new_val|
14
16
  instance_variable_set "@#{name}", new_val
15
17
  end
16
- end
18
+ end
17
19
 
18
20
  end
19
21
 
@@ -21,5 +23,8 @@ module FileDb
21
23
  @columns.index column
22
24
  end
23
25
 
26
+ def columns_hash
27
+ @columns_hash
28
+ end
24
29
  end
25
30
  end
data/lib/file_db/data.rb CHANGED
@@ -24,7 +24,7 @@ private
24
24
 
25
25
  def load_params_into_model params
26
26
  params.each do |key, value|
27
- next unless self.class.columns.include?(key)
27
+ next unless self.class.columns_hash[key.to_sym]
28
28
  send("#{key}=", value)
29
29
  end
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module FileDb
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Starke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-02 00:00:00.000000000 Z
11
+ date: 2016-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler