Skip to content

Commit 45b7a22

Browse files
committed
update to set ENV variables with figaro gem
1 parent e68b93f commit 45b7a22

File tree

5 files changed

+63
-27
lines changed

5 files changed

+63
-27
lines changed

Gemfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ group :assets do
66
gem 'uglifier', '>= 1.0.3'
77
end
88
gem 'jquery-rails'
9-
gem "mongoid", ">= 3.0.16"
10-
gem "rspec-rails", ">= 2.12.1", :group => [:development, :test]
9+
gem "mongoid", ">= 3.0.18"
10+
gem "rspec-rails", ">= 2.12.2", :group => [:development, :test]
1111
gem "database_cleaner", ">= 0.9.1", :group => :test
12-
gem "mongoid-rspec", ">= 1.5.5", :group => :test
12+
gem "mongoid-rspec", ">= 1.5.6", :group => :test
1313
gem "email_spec", ">= 1.4.0", :group => :test
1414
gem "cucumber-rails", ">= 1.3.0", :group => :test, :require => false
1515
gem "launchy", ">= 2.1.2", :group => :test
1616
gem "capybara", ">= 2.0.2", :group => :test
1717
gem "factory_girl_rails", ">= 4.1.0", :group => [:development, :test]
18-
gem "devise", ">= 2.2.0"
18+
gem "devise", ">= 2.2.2"
1919
gem "quiet_assets", ">= 1.0.1", :group => :development
20+
gem "figaro", ">= 0.5.3"
21+
gem "better_errors", ">= 0.3.2", :group => :development
22+
gem "binding_of_caller", ">= 0.6.8", :group => :development

Gemfile.lock

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ GEM
3131
addressable (2.3.2)
3232
arel (3.0.2)
3333
bcrypt-ruby (3.0.1)
34+
better_errors (0.3.2)
35+
coderay (>= 1.0.0)
36+
erubis (>= 2.7.0)
37+
binding_of_caller (0.6.8)
3438
builder (3.0.4)
3539
capybara (2.0.2)
3640
mime-types (>= 1.16)
@@ -41,6 +45,7 @@ GEM
4145
xpath (~> 1.0.0)
4246
childprocess (0.3.6)
4347
ffi (~> 1.0, >= 1.0.6)
48+
coderay (1.0.8)
4449
coffee-rails (3.2.2)
4550
coffee-script (>= 2.2.0)
4651
railties (~> 3.2.0)
@@ -58,7 +63,7 @@ GEM
5863
cucumber (>= 1.1.8)
5964
nokogiri (>= 1.5.0)
6065
database_cleaner (0.9.1)
61-
devise (2.2.0)
66+
devise (2.2.2)
6267
bcrypt-ruby (~> 3.0)
6368
orm_adapter (~> 0.1)
6469
railties (~> 3.1)
@@ -75,32 +80,31 @@ GEM
7580
factory_girl_rails (4.1.0)
7681
factory_girl (~> 4.1.0)
7782
railties (>= 3.0.0)
78-
ffi (1.3.0)
83+
ffi (1.3.1)
84+
figaro (0.5.3)
85+
rails (~> 3.0)
7986
gherkin (2.11.5)
8087
json (>= 1.4.6)
8188
hike (1.2.1)
8289
i18n (0.6.1)
8390
journey (1.0.4)
84-
jquery-rails (2.1.4)
91+
jquery-rails (2.2.0)
8592
railties (>= 3.0, < 5.0)
8693
thor (>= 0.14, < 2.0)
8794
json (1.7.6)
8895
launchy (2.1.2)
8996
addressable (~> 2.3)
90-
libwebsocket (0.1.7.1)
91-
addressable
92-
websocket
9397
mail (2.4.4)
9498
i18n (>= 0.4.0)
9599
mime-types (~> 1.16)
96100
treetop (~> 1.4.8)
97101
mime-types (1.19)
98-
mongoid (3.0.16)
102+
mongoid (3.0.18)
99103
activemodel (~> 3.1)
100-
moped (~> 1.1)
104+
moped (~> 1.2)
101105
origin (~> 1.0)
102106
tzinfo (~> 0.3.22)
103-
mongoid-rspec (1.5.5)
107+
mongoid-rspec (1.5.6)
104108
mongoid (>= 3.0.1)
105109
rake
106110
rspec (>= 2.9)
@@ -112,7 +116,7 @@ GEM
112116
polyglot (0.3.3)
113117
quiet_assets (1.0.1)
114118
railties (~> 3.1)
115-
rack (1.4.3)
119+
rack (1.4.4)
116120
rack-cache (1.2)
117121
rack (>= 0.4)
118122
rack-ssl (1.3.2)
@@ -145,7 +149,7 @@ GEM
145149
rspec-expectations (2.12.1)
146150
diff-lcs (~> 1.1.3)
147151
rspec-mocks (2.12.1)
148-
rspec-rails (2.12.1)
152+
rspec-rails (2.12.2)
149153
actionpack (>= 3.0)
150154
activesupport (>= 3.0)
151155
railties (>= 3.0)
@@ -154,15 +158,15 @@ GEM
154158
rspec-mocks (~> 2.12.0)
155159
rubyzip (0.9.9)
156160
sass (3.2.5)
157-
sass-rails (3.2.5)
161+
sass-rails (3.2.6)
158162
railties (~> 3.2.0)
159163
sass (>= 3.1.10)
160164
tilt (~> 1.3)
161-
selenium-webdriver (2.27.2)
165+
selenium-webdriver (2.29.0)
162166
childprocess (>= 0.2.5)
163-
libwebsocket (~> 0.1.3)
164167
multi_json (~> 1.0)
165168
rubyzip
169+
websocket (~> 1.0.4)
166170
sprockets (2.2.2)
167171
hike (~> 1.2)
168172
multi_json (~> 1.0)
@@ -187,19 +191,22 @@ PLATFORMS
187191
ruby
188192

189193
DEPENDENCIES
194+
better_errors (>= 0.3.2)
195+
binding_of_caller (>= 0.6.8)
190196
capybara (>= 2.0.2)
191197
coffee-rails (~> 3.2.1)
192198
cucumber-rails (>= 1.3.0)
193199
database_cleaner (>= 0.9.1)
194-
devise (>= 2.2.0)
200+
devise (>= 2.2.2)
195201
email_spec (>= 1.4.0)
196202
factory_girl_rails (>= 4.1.0)
203+
figaro (>= 0.5.3)
197204
jquery-rails
198205
launchy (>= 2.1.2)
199-
mongoid (>= 3.0.16)
200-
mongoid-rspec (>= 1.5.5)
206+
mongoid (>= 3.0.18)
207+
mongoid-rspec (>= 1.5.6)
201208
quiet_assets (>= 1.0.1)
202209
rails (= 3.2.11)
203-
rspec-rails (>= 2.12.1)
210+
rspec-rails (>= 2.12.2)
204211
sass-rails (~> 3.2.3)
205212
uglifier (>= 1.0.3)

config/application.example.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Add account credentials and API keys here.
2+
# See http://railsapps.github.com/rails-environment-variables.html
3+
# This file should be listed in .gitignore to keep your settings secret!
4+
# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
5+
# For example, setting:
6+
# GMAIL_USERNAME: Your_Gmail_Username
7+
# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
8+
# Add application configuration variables here, as shown below.
9+
#
10+
GMAIL_USERNAME: Your_Username
11+
GMAIL_PASSWORD: Your_Password
12+
ADMIN_NAME: First User
13+
ADMIN_EMAIL: user@example.com
14+
ADMIN_PASSWORD: changeme

config/application.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Add account credentials and API keys here.
2+
# See http://railsapps.github.com/rails-environment-variables.html
3+
# This file should be listed in .gitignore to keep your settings secret!
4+
# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
5+
# For example, setting:
6+
# GMAIL_USERNAME: Your_Gmail_Username
7+
# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
8+
# Add application configuration variables here, as shown below.
9+
#
10+
GMAIL_USERNAME: Your_Username
11+
GMAIL_PASSWORD: Your_Password
12+
ADMIN_NAME: user1
13+
ADMIN_EMAIL: user@example.com
14+
ADMIN_PASSWORD: changeme

db/seeds.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#
66
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
77
# Mayor.create(name: 'Emanuel', city: cities.first)
8-
puts 'SETTING UP DEFAULT USER LOGIN'
9-
user = User.create! :name => 'user1', :email => 'user@example.com', :password => 'please', :password_confirmation => 'please'
10-
puts 'New user created: ' << user.name
11-
user2 = User.create! :name => 'user2', :email => 'user2@example.com', :password => 'please', :password_confirmation => 'please'
12-
puts 'New user created: ' << user2.name
8+
puts 'DEFAULT USERS'
9+
user = User.create! :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
10+
puts 'user: ' << user.name

0 commit comments

Comments
 (0)