platform_sh_rails 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c7c7e2206229bac02cfa664ff26cf690bd75138
4
- data.tar.gz: bae1669f7d2ae0316673f8d6d37300312d45f6ca
3
+ metadata.gz: a08d7fbbad6ecb31111fc0275a112c069967c634
4
+ data.tar.gz: 522c96b9842afc5247a4537450ce2e46895db070
5
5
  SHA512:
6
- metadata.gz: 5b62c9cd61adb09d89dcc98981eb5f5549b6e9579ece3598515e60832c99046b9dabb668a83b4ad0c0441885c9dc870068c77c98ce930122455e854001bc0f53
7
- data.tar.gz: 3ba20dab51a220a7faad83acd1bdbdd7e7686762035b20083d3079facccdaca589be6c21fb3f6324377097b74ed6436eaa6a98a4b40aeccc1b9ec200206e4d40
6
+ metadata.gz: c48f43d0b41e0ef5e7ddb77658302ba673038f6c822bde4ccce68e6589c5e185b5cb087cd94b7c9c40a49cebccd357ef4b81ef7eb4d4a9e561d53355012aefdc
7
+ data.tar.gz: 3ce1b9ce33c721bc345bd6564468963ab9e9bd24fe3e9fa08a0de64832feb735d06ea01e254dbf51d6c5450f40bb5e2580b4c9f2e8f42b452f9f7460cac64881
@@ -1,7 +1,20 @@
1
1
  require "platform_sh_rails/version"
2
2
  require "platform_sh"
3
3
 
4
- class PlatformSHRails
5
- 'use strict'
6
- #Does nothing for the moment
7
- end
4
+ class PlatformSHRailtie < Rails::Railtie
5
+ config.before_configuration do
6
+ if ENV['TMPDIR'].nil?
7
+ ENV['TMPDIR']="/tmp"
8
+ end
9
+ if PlatformSH::on_platform? && !PlatformSH::is_build_environment?
10
+ ENV['DATABASE_URL']=PlatformSH::guess_database_url
11
+ end
12
+ if PlatformSH::on_platform? && PlatformSH::is_build_environment?
13
+ ENV['DB_ADAPTER']="nulldb"
14
+ ENV['DATABASE_URL']="nulldb://localhost/nulldb?pool=5"
15
+ end
16
+ ENV['RAILS_SERVE_STATIC_FILES']="true"
17
+ ENV['RAILS_LOG_TO_STDOUT']="true"
18
+ ENV['SECRET_KEY_BASE']=ENV['PLATFORM_PROJECT_ENTROPY']
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  class PlatformSHRails
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platform_sh_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ori Pekelman
@@ -83,8 +83,7 @@ dependencies:
83
83
  description: Platform.sh rails helper gem to ease interacting with the environment
84
84
  email:
85
85
  - ori@platform.sh
86
- executables:
87
- - platform_rails_env
86
+ executables: []
88
87
  extensions: []
89
88
  extra_rdoc_files: []
90
89
  files:
@@ -96,7 +95,6 @@ files:
96
95
  - README.md
97
96
  - Rakefile
98
97
  - bin/console
99
- - bin/platform_rails_env
100
98
  - bin/setup
101
99
  - lib/platform_sh_rails.rb
102
100
  - lib/platform_sh_rails/version.rb
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require "platform_sh"
3
- if ENV['TMPDIR']
4
- puts "export TMPDIR=/tmp"
5
- end
6
- if PlatformSH::on_platform? && !PlatformSH::is_build_environment?
7
- puts "export DATABASE_URL=\"#{PlatformSH::guess_database_url}\""
8
- end
9
- if PlatformSH::on_platform? && PlatformSH::is_build_environment?
10
- puts "export DB_ADAPTER=nulldb"
11
- puts "DATABASE_URL=nulldb://localhost/nulldb?pool=5"
12
- end
13
- puts '
14
- RAILS_SERVE_STATIC_FILES=true
15
- RAILS_LOG_TO_STDOUT=true
16
- SECRET_KEY_BASE=$PLATFORM_PROJECT_ENTROPY
17
- '