sandra-rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,9 @@ module Rails
8
8
  module Sandra
9
9
 
10
10
  class Railtie < Rails::Railtie
11
+ rake_tasks do
12
+ Dir[File.join(File.dirname(__FILE__),'tasks/*.rake')].each { |f| load f }
13
+ end
11
14
  config.app_generators.orm = :sandra
12
15
  end
13
16
  end
@@ -0,0 +1,14 @@
1
+ namespace :sandra do
2
+ task :migrate => :environment do
3
+ sandra_config = YAML::load_file("#{::Rails.root.to_s}/config/sandra.yml")[::Rails.env]
4
+ keyspace = sandra_config[:keyspace]
5
+ store = Cassandra.new(keyspace)
6
+ cfs = sandra_config[:column_families]
7
+ cfs.each do |name, options|
8
+ options = Hash(options)
9
+ cf_def = CassandraThrift::CfDef.new({:keyspace => keyspace, :name => name}.merge(options))
10
+ store.add_column_family(cf_def)
11
+ store.update_column_family(cf_def)
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  module Sandra
2
2
  module Rails
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sandra-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-28 00:00:00.000000000 Z
12
+ date: 2012-03-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sandra
16
- requirement: &70304555194300 !ruby/object:Gem::Requirement
16
+ requirement: &70324487139080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70304555194300
24
+ version_requirements: *70324487139080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: actionpack
27
- requirement: &70304555193780 !ruby/object:Gem::Requirement
27
+ requirement: &70324487138540 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.2.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70304555193780
35
+ version_requirements: *70324487138540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: railties
38
- requirement: &70304555193240 !ruby/object:Gem::Requirement
38
+ requirement: &70324487137980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 3.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70304555193240
46
+ version_requirements: *70324487137980
47
47
  description: Connect Sandra with Rails
48
48
  email:
49
49
  - chuck@teachmetocode.com
@@ -59,6 +59,7 @@ files:
59
59
  - lib/generators/sandra/model/templates/model.rb
60
60
  - lib/sandra-rails.rb
61
61
  - lib/sandra-rails/railtie.rb
62
+ - lib/sandra-rails/tasks/sandra.rake
62
63
  - lib/sandra-rails/version.rb
63
64
  - sandra-rails.gemspec
64
65
  homepage: ''