file_db 0.3.1 → 0.4.0
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/2 +23 -0
- data/README.md +19 -1
- data/file_db.gemspec +1 -0
- data/lib/file_db/query.rb +12 -0
- data/lib/file_db/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fb2a37f42eb60fdd2a57b7997cac9e0c55a45bd
|
4
|
+
data.tar.gz: 9238653b18bc14f02d6871967b0f01a51712598a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c0baa029b66c032c38a334ca582fc06d48f611408a058c1d9cbdd3c75360feed6b4950be8f820fe59a3a63f5b04573c2cb2cf617c819f23c538a3bcc4dafefa
|
7
|
+
data.tar.gz: 9ee6c86bbb9b70e18c0ea1eca3b627d76c759766f83c545497ef59c4c1030053fe186343540700c51539bc973364f232707fce56d4e4fe72fd8921d021bbdabb
|
data/2
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
require 'file_db'
|
3
|
+
|
4
|
+
RSpec.configure do |config|
|
5
|
+
config.before(:suite) do
|
6
|
+
class User < FileDb::Model
|
7
|
+
columns :name, :test
|
8
|
+
end
|
9
|
+
FileDb::Configuration.configure data_directory: 'data'
|
10
|
+
FileDb::Database.database_check!
|
11
|
+
new_time = Time.local(2013, 12, 11, 11, 28, 0)
|
12
|
+
Timecop.freeze(new_time)
|
13
|
+
User.create name: 'max', test: 'test'
|
14
|
+
end
|
15
|
+
|
16
|
+
config.after(:suite) do
|
17
|
+
File.delete File.join(
|
18
|
+
FileDb::Configuration.configured(:data_directory),
|
19
|
+
"#{User.table_name}.csv"
|
20
|
+
)
|
21
|
+
Dir.delete(FileDb::Configuration.configured :data_directory)
|
22
|
+
end
|
23
|
+
end
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ You need to store data into a small type of database, like CSV and want a better
|
|
7
7
|
hm, yeah. just add this to your Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'file_db', '~> 0.
|
10
|
+
gem 'file_db', '~> 0.4.0'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -92,6 +92,24 @@ User.where(name: 'rob')
|
|
92
92
|
-> [#<User:0x00000004651798 @name="rob", @id="1466311874", @email=nil>]
|
93
93
|
```
|
94
94
|
|
95
|
+
You can also use `first` and `last` to get the first and last user
|
96
|
+
```ruby
|
97
|
+
User.first
|
98
|
+
-> #<User:0x00000004651798 @name="rob", @id="1466311874", @email=nil>
|
99
|
+
```
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
User.last
|
103
|
+
-> #<User:0x00000004651798 @name="rob", @id="1466311874", @email=nil>
|
104
|
+
```
|
105
|
+
|
106
|
+
Or you use `all` to get really all users.
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
User.all
|
110
|
+
-> [#<User:0x00000004651798 @name="rob", @id="1466311874", @email=nil>]
|
111
|
+
```
|
112
|
+
|
95
113
|
rename the user:
|
96
114
|
|
97
115
|
```ruby
|
data/file_db.gemspec
CHANGED
data/lib/file_db/query.rb
CHANGED
data/lib/file_db/version.rb
CHANGED
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: 0.
|
4
|
+
version: 0.4.0
|
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-06-
|
11
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: timecop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.8'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.8'
|
55
69
|
description: You need to store informationen in a CSV File, because there is no need
|
56
70
|
for a database? You can use FileDb to store all informationen in a CSV File and
|
57
71
|
search in it like ActiveRecord (User.find(1212). See detailed Information at the
|
@@ -65,6 +79,7 @@ files:
|
|
65
79
|
- ".gitignore"
|
66
80
|
- ".rspec"
|
67
81
|
- ".travis.yml"
|
82
|
+
- '2'
|
68
83
|
- Gemfile
|
69
84
|
- LICENSE.txt
|
70
85
|
- README.md
|