active_record_to_simpledb 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,16 +1,49 @@
1
1
  = active_record_to_simpledb
2
2
 
3
- Description goes here.
3
+ Imagine you have an Active Record model like:
4
+
5
+ class TicketSale < ActiveRecord::Base
6
+ end
7
+
8
+ You can just include each of the callbacks depending on your needs:
9
+
10
+
11
+ class TicketSale < ActiveRecord::Base
12
+ include ActiveRecordToSimpledb::Callbacks::Create
13
+ end
14
+
15
+
16
+ === not yet done, but it'll in the future
17
+
18
+ class TicketSale < ActiveRecord::Base
19
+ include ActiveRecordToSimpledb::Callbacks::Update
20
+ include ActiveRecordToSimpledb::Callbacks::Delete
21
+ end
22
+
23
+
24
+
25
+ == AWS Configuration:
26
+
27
+ We assume you have a file in /config/aws.yml that looks like:
28
+
29
+ test:
30
+ access_key_id: ''
31
+ secret_access_key: ''
32
+
33
+ production:
34
+ access_key_id: ''
35
+ secret_access_key: ''
36
+
37
+ development:
38
+ access_key_id: ''
39
+ secret_access_key: ''
40
+
41
+
4
42
 
5
43
  == Contributing to active_record_to_simpledb
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
- * Fork the project
10
- * Start a feature/bugfix branch
11
- * Commit and push until you are happy with your contribution
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
44
+
45
+ * Fork, Test, Pull Request
46
+
14
47
 
15
48
  == Copyright
16
49
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{active_record_to_simpledb}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ivan Acosta-Rubio"]
@@ -1,3 +1,24 @@
1
+ require 'right_aws'
2
+ require 'sdb/active_sdb'
3
+ require 'json'
4
+
5
+ class AWS
6
+ def self.root
7
+ rails_root = (Rails.version < "2.1.2") ? RAILS_ROOT : Rails.root
8
+ YAML::load(IO.read(File.join(rails_root, 'config', 'aws.yml')))
9
+ end
10
+
11
+ def self.key
12
+ AWS.root[RAILS_ENV]['access_key_id']
13
+ end
14
+
15
+ def self.secret
16
+ AWS.root[RAILS_ENV]['secret_access_key']
17
+ end
18
+ end
19
+
20
+
21
+
1
22
  class ActiveRecordToSimpledb
2
23
 
3
24
  # Public: It connect to aws
@@ -1,12 +1,7 @@
1
- require 'json'
2
- require 'right_aws'
3
- require 'sdb/active_sdb'
4
1
  require 'activerecord'
5
2
  require 'active_record_setup'
6
3
  require 'active_record_to_simpledb'
7
4
 
8
- require 'aws'
9
-
10
5
  class TicketSale < ActiveRecord::Base
11
6
  include ActiveRecordToSimpledb::Callbacks::Create
12
7
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
7
+ - 2
8
8
  - 0
9
- version: 0.1.0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ivan Acosta-Rubio