quandl_cassandra 1.2.1 → 1.2.2

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: c1156756870d067c7a45b0adac3aeb28bb178341
4
- data.tar.gz: 6694abc885d6f47089e18dd9835bce4376504b5c
3
+ metadata.gz: d4744fb9893f0e36cee159fd74aa56cbec516f02
4
+ data.tar.gz: d4b1418f776e9b7d204565b0f69e131512ddce1e
5
5
  SHA512:
6
- metadata.gz: 9c0e26bb8a9312686564243b4191d785034a8e14c60aa41ec3b85e365ea20c4e649e1bf5dce16f89b2709945d4b2c22c4e7b9d3f64dc1571b255c3a769ab5492
7
- data.tar.gz: 36620d39a8e99e4996c1aabd84d2c11ebfd06eba5e7bb39eb0aba2ccb9d41b9752447750ad249f2352c0e50422cc5475b6ae00a405df2ef8a9ac1b59a91ab7d7
6
+ metadata.gz: 16fcd2b40109453cc2c6fa80060935fee5a34416cfae174ed6af74ec668e9c74f8e4ee602bee3cc93bec6a8b4b01d1284dcc29949a32d295365dd785028e1f1c
7
+ data.tar.gz: 1ef7657f417a9bad67fc4cf29a551ac2ddac319fbf9ba728fe755629793c671ab82e7ba758113256787dce4484e37bb152d40556b3e59d48883b368dcf0d2fbd
data/Guardfile ADDED
@@ -0,0 +1,8 @@
1
+ group :specs do
2
+ guard :rspec, cmd: 'bundle exec rspec --fail-fast -f doc --color' do
3
+ watch(%r{^spec/.+_spec\.rb$})
4
+ watch(%r{^(lib/.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
5
+ watch('spec/spec_helper.rb') { 'spec' }
6
+ end
7
+ end
8
+
data/UPGRADE.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.2.2
2
+
3
+ * add Cassandra::Logger, use Cassandra::Logger
4
+ * add colored log output
5
+
6
+
1
7
  ## 1.2.1
2
8
 
3
9
  * revise Cql::QueryError exception catching and reraise
@@ -0,0 +1,17 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
2
+
3
+ QUANDL_LOGGER = true
4
+
5
+ require 'pry'
6
+ require "quandl/cassandra"
7
+ require "quandl/fabricate"
8
+
9
+ Quandl::Logger.use Quandl::Logger::Outputs
10
+
11
+ Quandl::Cassandra.configure do |c|
12
+ c.hosts = ['localhost','192.168.33.10']
13
+ c.consistency = :one
14
+ c.keyspace = 'wikiposit'
15
+ end
16
+
17
+ binding.pry
@@ -1,4 +1,9 @@
1
- module Quandl::Cassandra::Base::Logging
1
+ require 'colorize'
2
+
3
+ module Quandl
4
+ module Cassandra
5
+ class Base
6
+ module Logging
2
7
 
3
8
  extend ActiveSupport::Concern
4
9
 
@@ -7,7 +12,7 @@ module Quandl::Cassandra::Base::Logging
7
12
  def prepare(*args, &block)
8
13
  statement = args.first.to_s
9
14
  statement = "#{statement[0..200]} ... #{statement.length} chars" if statement.length > 200
10
- Quandl::Logger.debug(statement)
15
+ Logger.debug(statement)
11
16
  super if defined?(super)
12
17
  end
13
18
 
@@ -18,7 +23,7 @@ module Quandl::Cassandra::Base::Logging
18
23
  begin
19
24
  r = super if defined?(super)
20
25
  ensure
21
- Quandl::Logger.debug("(#{t1.elapsed_ms}) #{statement}")
26
+ Logger.debug("(#{t1.elapsed_ms}) ".blue + " #{statement}")
22
27
  end
23
28
  r
24
29
  end
@@ -26,3 +31,6 @@ module Quandl::Cassandra::Base::Logging
26
31
  end
27
32
 
28
33
  end
34
+ end
35
+ end
36
+ end
@@ -12,11 +12,11 @@ module Logging
12
12
  # call method
13
13
  r = super if defined?(super)
14
14
  # log write
15
- Quandl::Logger.debug("(#{t1.elapsed_ms}) [#{rows.count} rows] BATCH #{statement}")
15
+ Quandl::Logger.debug("(#{t1.elapsed_ms}) ".blue + " [#{rows.count} rows] BATCH #{statement}")
16
16
  r
17
17
  end
18
18
 
19
- end
19
+ end
20
20
 
21
21
  end
22
22
  end
@@ -0,0 +1,14 @@
1
+ module Quandl
2
+ module Cassandra
3
+ class Logger
4
+ class << self
5
+
6
+ def method_missing(method_sym, *args, &block)
7
+ args[0] = "CASSANDRA ".blue + args[0].to_s
8
+ Quandl::Logger.send(method_sym, *args)
9
+ end
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
2
  module Cassandra
3
- VERSION = '1.2.1'
3
+ VERSION = '1.2.2'
4
4
  end
5
5
  end
@@ -13,6 +13,7 @@ require 'quandl/logger'
13
13
  require "quandl/data"
14
14
  require 'quandl/strategy'
15
15
 
16
+ require 'quandl/cassandra/logger'
16
17
  require 'quandl/cassandra/error'
17
18
  require 'quandl/cassandra/types'
18
19
  require 'quandl/cassandra/base'
@@ -22,13 +22,15 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "factory_girl_rails"
23
23
  s.add_development_dependency "fivemat", "~> 1.2"
24
24
  s.add_development_dependency "pry"
25
+ s.add_development_dependency "guard"
26
+ s.add_development_dependency "guard-rspec"
25
27
 
26
28
  s.add_runtime_dependency "activesupport", ">= 3.0.0"
27
29
  s.add_runtime_dependency "activemodel", ">= 3.0.0"
28
30
 
31
+ s.add_runtime_dependency "colorize", '~> 0.5'
29
32
  s.add_runtime_dependency "facter", "~> 1.7.3"
30
33
  s.add_runtime_dependency "scope_composer", "~> 0.4"
31
34
  s.add_runtime_dependency "quandl_data", "~> 1.2"
32
35
  s.add_runtime_dependency 'cql-rb', '~> 1.1'
33
-
34
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_cassandra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-28 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,6 +80,34 @@ dependencies:
80
80
  - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: activesupport
85
113
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +136,20 @@ dependencies:
108
136
  - - '>='
109
137
  - !ruby/object:Gem::Version
110
138
  version: 3.0.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: colorize
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: '0.5'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: '0.5'
111
153
  - !ruby/object:Gem::Dependency
112
154
  name: facter
113
155
  requirement: !ruby/object:Gem::Requirement
@@ -173,10 +215,12 @@ extra_rdoc_files: []
173
215
  files:
174
216
  - .gitignore
175
217
  - Gemfile
218
+ - Guardfile
176
219
  - LICENSE
177
220
  - README.md
178
221
  - Rakefile
179
222
  - UPGRADE.md
223
+ - examples/connect.rb
180
224
  - lib/quandl/cassandra.rb
181
225
  - lib/quandl/cassandra/base.rb
182
226
  - lib/quandl/cassandra/base/attributes.rb
@@ -193,6 +237,7 @@ files:
193
237
  - lib/quandl/cassandra/batch/logging.rb
194
238
  - lib/quandl/cassandra/configuration.rb
195
239
  - lib/quandl/cassandra/error.rb
240
+ - lib/quandl/cassandra/logger.rb
196
241
  - lib/quandl/cassandra/types.rb
197
242
  - lib/quandl/cassandra/types/abstract_type.rb
198
243
  - lib/quandl/cassandra/types/boolean_type.rb