data_store 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ##0.0.8
2
+
3
+ * Connect to database in case of a DATABASE_URL environment variable (used with Heroku)
4
+
1
5
  ##0.0.7
2
6
 
3
7
  * Partial rollback: sequel and celluloid again part of the gemspec
@@ -38,6 +38,8 @@ module DataStore
38
38
  @database ||= begin
39
39
  if RUBY_PLATFORM == 'java'
40
40
  Sequel.connect(jdbc_settings)
41
+ elsif ENV['DATABASE_URL']
42
+ Sequel.connect(ENV['DATABASE_URL'])
41
43
  else
42
44
  Sequel.connect(database_settings)
43
45
  end
@@ -1,3 +1,3 @@
1
1
  module DataStore
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
@@ -29,4 +29,16 @@ class ConnectorTest < Test::Unit::TestCase
29
29
 
30
30
  end
31
31
 
32
+ context 'Database on Heroku' do
33
+
34
+ should 'connect on the base of the DATABASE_URL environment variable in exist' do
35
+ ENV['DATABASE_URL'] = 'postgres://postgres@localhost/data_store_test'
36
+ DataStore.configuration.stubs(:database_config_file).returns('')
37
+ connector = DataStore::Connector.new
38
+ assert connector.database.inspect.match(ENV['DATABASE_URL'])
39
+ connector.database.disconnect
40
+ end
41
+
42
+ end
43
+
32
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-23 00:00:00.000000000 Z
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sequel
@@ -92,12 +92,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  - - ! '>='
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
+ segments:
96
+ - 0
97
+ hash: 210819487432911081
95
98
  required_rubygems_version: !ruby/object:Gem::Requirement
96
99
  none: false
97
100
  requirements:
98
101
  - - ! '>='
99
102
  - !ruby/object:Gem::Version
100
103
  version: '0'
104
+ segments:
105
+ - 0
106
+ hash: 210819487432911081
101
107
  requirements: []
102
108
  rubyforge_project:
103
109
  rubygems_version: 1.8.24