diff --git a/.rvmrc b/.rvmrc index 4e54973..03e4180 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1,7 +1 @@ - -if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ - && -s "${rvm_path:-$HOME/.rvm}/environments/ruby-1.9.2-p0@active_column" ]] ; then - \. "${rvm_path:-$HOME/.rvm}/environments/ruby-1.9.2-p0@active_column" -else - rvm --create "ruby-1.9.2-p0@active_column" -fi +rvm --create 1.9.2@active_column diff --git a/Gemfile.lock b/Gemfile.lock index 0b1dc15..505e2f8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,7 +56,7 @@ GEM file-tail (1.0.5) spruz (>= 0.1.0) i18n (0.5.0) - json (1.4.6) + json (1.5.0) mail (2.2.12) activesupport (>= 2.3.6) i18n (>= 0.4.0) @@ -105,7 +105,7 @@ GEM ruby_parser (2.0.5) sexp_processor (~> 3.0) sexp_processor (3.0.5) - simple_uuid (0.1.1) + simple_uuid (0.1.2) sourcify (0.4.0) ruby2ruby (>= 1.2.5) sexp_processor (>= 3.0.5) @@ -133,12 +133,9 @@ PLATFORMS DEPENDENCIES active_column! - activesupport bluecloth - cassandra (>= 0.9) mocha rails (>= 3.0) - rake rspec-rails wrong yard diff --git a/lib/active_column/migrator.rb b/lib/active_column/migrator.rb index 7ad5661..ff3287a 100644 --- a/lib/active_column/migrator.rb +++ b/lib/active_column/migrator.rb @@ -98,11 +98,13 @@ def self.move(direction, migrations_path, steps) public def initialize(direction, migrations_path, target_version = nil) - cf = ActiveColumn.column_family_tasks + cf_tasks = ActiveColumn.column_family_tasks sm_cf = self.class.schema_migrations_column_family - unless cf.exists?(sm_cf) - cf.create(sm_cf, :comparator_type => 'LongType') + unless cf_tasks.exists?(sm_cf) + cf_tasks.create(sm_cf) do |cf| + cf.comparator_type = 'LongType' + end end @direction, @migrations_path, @target_version = direction, migrations_path, target_version diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0071907..f39085f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,17 +12,18 @@ $cassandra = ActiveColumn.connection = Cassandra.new('active_column', '127.0.0.1:9160') +keyspace = 'active_column' ks_tasks = ActiveColumn.keyspace_tasks -unless ks_tasks.exists?('active_column') - ks_tasks.create('active_column') +unless ks_tasks.exists?(keyspace) + ks_tasks.create keyspace - cf_tasks = ActiveColumn.column_family_tasks + cf_tasks = ActiveColumn.column_family_tasks keyspace [:tweets, :tweet_dms].each do |cf| - cf_tasks.create(cf, :keyspace => 'active_column') + cf_tasks.create cf end end -ks_tasks.set 'active_column' +ks_tasks.set keyspace ks_tasks.clear RSpec.configure do |config|