active_orm 1.0.0 → 2.0.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
  SHA1:
3
- metadata.gz: 6402a41fe830352f983fdd97911a64b778798e0c
4
- data.tar.gz: f17b468669665f7e5c2d7ab190ffee73bc90738b
3
+ metadata.gz: 61a1841c3376b651ff527c0907bb00d6ac74c74e
4
+ data.tar.gz: 7b1ae76647410041ff6b62aaade16e9ba15c925f
5
5
  SHA512:
6
- metadata.gz: fc1f5179861cd2e8fc31292d7b5bdf306b09b295c0cccf8606c6dc24b5ce5316ba8c373f930bb9e43632aaa6b5264569c380c8f569319e811dcda5cd972d210f
7
- data.tar.gz: 408e73240083dbe63bd83a265c7624a70668b0d0d842303dbb8b05bfe35cdf7c8a3965cc14b98cf93f1fdc778b41de2f61f8325a51a25f4517137e9245c57698
6
+ metadata.gz: a77fd77eef239ab02efc8d5f92756248d3b681bd87374c896933027a69a87819413f603181a4d33b48b40e8490f3e7b18180cd13f51cb24f65924a490fd44e91
7
+ data.tar.gz: 300fe78254e083637db4c7482bf8d3245ebe705eaf80abdf09e936e52dc618c778690fec2ce9212f2774aad2fcd70b3c202538a672244c76055863359c7dc42a
data/README.md CHANGED
@@ -73,6 +73,14 @@ ActiveOrm::Redis::List.find(:user_1) #=> { id: "32123", name: "James Dean", user
73
73
  ActiveOrm::Redis::List.evaluate.find(:user_1) #=> { id: 32123, name: "James Dean", username: "alpha123" }
74
74
  ```
75
75
 
76
+ **Rake:**
77
+
78
+ **Options:**
79
+ * reset: reset current database
80
+ * reset_all: reset all databases
81
+
82
+ `rake redis:reset` and `rake redis:reset_all`
83
+
76
84
  ## Contributing
77
85
 
78
86
  1. Fork it ( https://github.com/[my-github-username]/active_orm/fork )
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- task default: :spec
3
+ task default: :spec
4
+
5
+ import "./lib/tasks/redis.rake"
@@ -1,3 +1,3 @@
1
1
  module ActiveOrm
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -0,0 +1,27 @@
1
+ namespace :redis do
2
+
3
+ desc "Reset active Redis databases"
4
+ task reset: :environment do
5
+ puts "== Reset: reseting active ".ljust(80, "=")
6
+ total_task_start_time = Time.current
7
+
8
+ ActiveOrm::Redis::Connection.flush
9
+
10
+ total_task_elapsed_time = (Time.current - total_task_start_time).round(5)
11
+ puts "== Reset: reset active (#{total_task_elapsed_time}s) ".ljust(80, "=")
12
+ puts ""
13
+ end
14
+
15
+ desc "Reset all Redis databases"
16
+ task reset_all: :environment do
17
+ puts "== Reset: reseting all ".ljust(80, "=")
18
+ total_task_start_time = Time.current
19
+
20
+ ActiveOrm::Redis::Connection.flush_all
21
+
22
+ total_task_elapsed_time = (Time.current - total_task_start_time).round(5)
23
+ puts "== Reset: reset all (#{total_task_elapsed_time}s) ".ljust(80, "=")
24
+ puts ""
25
+ end
26
+
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_orm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-14 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,6 +103,7 @@ files:
103
103
  - lib/active_orm/redis/string.rb
104
104
  - lib/active_orm/redis/transaction.rb
105
105
  - lib/active_orm/version.rb
106
+ - lib/tasks/redis.rake
106
107
  homepage: https://github.com/drexed/active_orm
107
108
  licenses:
108
109
  - MIT