priam 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -9,7 +9,7 @@ module Priam::Command
9
9
  super_column = params[:super_column]
10
10
  raise_exception_flag = params[:raise_exception_flag]
11
11
  unit_size = params[:unit_size]
12
- value_column = params[:value_column]
12
+ value_column = params[:value_column] || "d"
13
13
  weight_second = params[:weight_second]
14
14
  retry_max_count = params[:retry_max_count]
15
15
  count_log_path = params[:count_log_path]
@@ -5,7 +5,6 @@ module Priam::Core
5
5
  port = 9160
6
6
  raise_exception_flag = false
7
7
 
8
- value_column = "d"
9
8
  unit_size = 10000
10
9
  retry_max_count = 0
11
10
 
data/priam.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "priam"
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kenji Hara"]
@@ -66,25 +66,36 @@ describe "bin/priam" do
66
66
  end
67
67
 
68
68
  context "when command = get" do
69
- context "when key&value exists" do
70
- it "should output value" do
71
- result = `echo key1 | #{Priam::RUBY_CMD} -I #{Priam::LIB_DIR} #{Priam::BIN_DIR}/priam get --keyspace PriamTest --column-family PriamCF -h #{@hostname} -p 9160 --name d --verbose #{@stderr_dst}`
72
- result.chomp!
73
- result.should == "val1"
69
+ context "without value-column option" do
70
+ context "when key&value exists" do
71
+ it "should output json" do
72
+ result = `echo key1 | #{Priam::RUBY_CMD} -I #{Priam::LIB_DIR} #{Priam::BIN_DIR}/priam get --keyspace PriamTest --column-family PriamCF -h #{@hostname} -p 9160 --verbose #{@stderr_dst}`
73
+ result.chomp!
74
+ result.should == '{"d":"val1"}'
75
+ end
74
76
  end
75
77
  end
76
- context "when key&value does not exist" do
77
- it "should not output value" do
78
- result = `echo nokey | #{Priam::RUBY_CMD} -I #{Priam::LIB_DIR} #{Priam::BIN_DIR}/priam get --keyspace PriamTest --column-family PriamCF -h #{@hostname} -p 9160 --name d --verbose #{@stderr_dst}`
79
- result.chomp!
80
- result.should == ""
78
+ context "with value-column option" do
79
+ context "when key&value exists" do
80
+ it "should output value" do
81
+ result = `echo key1 | #{Priam::RUBY_CMD} -I #{Priam::LIB_DIR} #{Priam::BIN_DIR}/priam get --keyspace PriamTest --column-family PriamCF -h #{@hostname} -p 9160 --name d --verbose #{@stderr_dst}`
82
+ result.chomp!
83
+ result.should == "val1"
84
+ end
81
85
  end
82
- end
83
- context "when retry option is enabled" do
84
- it "should output value" do
85
- result = `echo key1 | #{Priam::RUBY_CMD} -I #{Priam::LIB_DIR} #{Priam::BIN_DIR}/priam get --keyspace PriamTest --column-family PriamCF -h #{@hostname} -p 9160 --name d --retry 5 --weight 1000 --verbose #{@stderr_dst}`
86
- result.chomp!
87
- result.should == "val1"
86
+ context "when key&value does not exist" do
87
+ it "should not output value" do
88
+ result = `echo nokey | #{Priam::RUBY_CMD} -I #{Priam::LIB_DIR} #{Priam::BIN_DIR}/priam get --keyspace PriamTest --column-family PriamCF -h #{@hostname} -p 9160 --name d --verbose #{@stderr_dst}`
89
+ result.chomp!
90
+ result.should == ""
91
+ end
92
+ end
93
+ context "when retry option is enabled" do
94
+ it "should output value" do
95
+ result = `echo key1 | #{Priam::RUBY_CMD} -I #{Priam::LIB_DIR} #{Priam::BIN_DIR}/priam get --keyspace PriamTest --column-family PriamCF -h #{@hostname} -p 9160 --name d --retry 5 --weight 1000 --verbose #{@stderr_dst}`
96
+ result.chomp!
97
+ result.should == "val1"
98
+ end
88
99
  end
89
100
  end
90
101
  end
@@ -8,7 +8,7 @@ describe Priam::Core::Common do
8
8
  result[:host].should == "localhost"
9
9
  result[:port].should == 9160
10
10
  result[:raise_exception_flag].should == false
11
- result[:value_column].should == "d"
11
+ result[:value_column].should == nil
12
12
  result[:retry_max_count].should == 0
13
13
  result[:check_exist_flag].should == false
14
14
  result[:output_keys_flag].should == false
data/spec/spec_helper.rb CHANGED
@@ -45,7 +45,7 @@ create column family PriamCF
45
45
  tmpfile.puts cql
46
46
  tmpfile.close
47
47
  hostname = `hostname`.chomp
48
- `/usr/lib/cassandra/bin/cassandra-cli -h #{hostname} -p 9160 -f #{tmpfile.path}`
48
+ `/usr/lib/cassandra/bin/cassandra-cli -h #{hostname} -p 9160 -f #{tmpfile.path} 2>/dev/null`
49
49
  tmpfile.unlink
50
50
  end
51
51
 
@@ -55,7 +55,7 @@ create column family PriamCF
55
55
  tmpfile.puts cql
56
56
  tmpfile.close
57
57
  hostname = `hostname`.chomp
58
- `/usr/lib/cassandra/bin/cassandra-cli -h #{hostname} -p 9160 -f #{tmpfile.path}`
58
+ `/usr/lib/cassandra/bin/cassandra-cli -h #{hostname} -p 9160 -f #{tmpfile.path} 2>/dev/null`
59
59
  tmpfile.unlink
60
60
  end
61
61
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: priam
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kenji Hara