redis_wmrs 0.0.2 → 0.0.3

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: 76e1f273d1d631503e1de3a09497e46004b8bdd7
4
- data.tar.gz: d51182ba33ffe55c2e5a123438d0e58ec547febc
3
+ metadata.gz: 1c9905335eeab11720ca6c1e83b668a482730222
4
+ data.tar.gz: ad959a4626ad5f4ba803912962b9b71a71bc1f69
5
5
  SHA512:
6
- metadata.gz: 6668327353d591deda295a132a3ce86f3f33deb610d5d0200f5fb26c2aceb48668c1e6a12a2c694aeea3c617923c3a25b27e06a5c4b1a162de7aecb588977e40
7
- data.tar.gz: 4c69eb81b46ff7c78700a60ea84028986bb6320ea291cf1b1b0a3f97099fffd31c8efbeb7df7f5989b08fade10f6889567b1825356442bef013bb92e8d94505d
6
+ metadata.gz: b638235033460f03a7352d83f1974e971f9331dd43bea8f3cae201f92440fc345acc7b6c4ac9058dd3f019ca6ccbb34c28432ae8bf072adf0abaeea9174f0506
7
+ data.tar.gz: aee245f94c214cb27e68412da13f5de893b56dccaf2ca038f47ed78c40d3a63fe6d8ca0e12035ef395bea7f40014f87cc538387e1cf8d5e03fa517dc17435974
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ action, filepath, generated_mark = *ARGV
5
+
6
+ generated_mark ||= "# Generated by CONFIG REWRITE"
7
+ idx = `grep -n "#{generated_mark}" #{filepath} | cut -d : -f1`.strip
8
+ exit(0) if idx.nil? or idx.empty?
9
+
10
+ case action
11
+ when 'show' then
12
+ n = File.read(filepath).lines.length - idx.to_i + 1
13
+ cmd = "tail -n #{n} #{filepath}"
14
+ $stdout.puts `#{cmd}`
15
+ when 'remove' then
16
+ content = `head -n #{idx.to_i - 1} #{filepath}`
17
+ open(filepath, "w"){|f| f.puts(content)}
18
+ else
19
+ raise "invalid action: #{action}"
20
+ end
@@ -1,3 +1,3 @@
1
1
  module RedisWmrs
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_wmrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - akima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -125,7 +125,8 @@ dependencies:
125
125
  description: redis client to write to master node and read from slave node
126
126
  email:
127
127
  - akima@groovenauts.jp
128
- executables: []
128
+ executables:
129
+ - redis_generated_conf
129
130
  extensions: []
130
131
  extra_rdoc_files: []
131
132
  files:
@@ -136,6 +137,7 @@ files:
136
137
  - LICENSE.txt
137
138
  - README.md
138
139
  - Rakefile
140
+ - bin/redis_generated_conf
139
141
  - examples/test.rb
140
142
  - lib/redis_wmrs.rb
141
143
  - lib/redis_wmrs/dispatcher.rb