sandboxy 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3af3fd5a81896b5f9480bf645add749cbd57d009
4
- data.tar.gz: 6ebb750a5ec79e5a91d71446b0f60987da39f72a
3
+ metadata.gz: c0900175ab295d91c3afe0ae5dcb2de0b1d82612
4
+ data.tar.gz: 2777176852c4b7abbf7d5ec92c2ef427bc94ae4a
5
5
  SHA512:
6
- metadata.gz: 6029e39f313ae946fb6fdfa413dfbc88e0437c080873d6c073a01490c02c71b6dd3ee7d9de3cff54b61e24b7285bb5aaf1bcbae8e1d488bd5a0deb724c6c71b7
7
- data.tar.gz: 9f8bb2178a429068a9389b1df16dd49f1a614269a18479fffadd9503c9e75d0b67585d1c882512adf792f55dcbee670b40ef72f0b8fbd1370f4e20757b2bde1c
6
+ metadata.gz: 1f65c09ea2e4982e6013cf1cbbc8672a1d236187052c2580418fb7cfe6c72c2d52dfa859e1d26ede4828be0cb50d746eb507f83e5c6c6825c640ac1b57b347e7
7
+ data.tar.gz: 152653d0560fc783bf4f0b7d56dc01cc955b37fb8674f2bfe03818bca506c22fdf45dcd785769bc08974dc401ded0a750d97a6d30cd03d19b73ca28dab9ca272
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 1.1.1 - 2017-08-27
8
+
9
+ * bugfixes
10
+ * fix undefined method `key` for `false`:Class
11
+
7
12
  ### 1.1.0 - 2017-08-27
8
13
 
9
14
  * features
data/README.md CHANGED
@@ -19,6 +19,7 @@ Sandboxy allows you to use virtual data-oriented environments inside a Rails app
19
19
  * [To Do](#to-do)
20
20
  * [Contributing](#contributing)
21
21
  * [Contributors](#contributors)
22
+ * [Semantic Versioning](#semantic-versioning)
22
23
  * [License](#license)
23
24
 
24
25
  ---
@@ -178,6 +179,10 @@ Give the people some :heart: who are working on this project. See them all at:
178
179
 
179
180
  https://github.com/slooob/sandboxy/graphs/contributors
180
181
 
182
+ ### Semantic Versioning
183
+
184
+ Sandboxy follows Semantic Versioning 2.0 as defined at http://semver.org.
185
+
181
186
  ## License
182
187
 
183
188
  MIT License
@@ -1,5 +1,7 @@
1
1
  Rails.application.routes.draw do
2
2
  resources :bars
3
3
  resources :foos
4
+
5
+ root 'foos#index'
4
6
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
5
7
  end
@@ -10,7 +10,17 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20170826222427) do
13
+ ActiveRecord::Schema.define(version: 20170827105828) do
14
+
15
+ create_table "bars", force: :cascade do |t|
16
+ t.datetime "created_at", null: false
17
+ t.datetime "updated_at", null: false
18
+ end
19
+
20
+ create_table "foos", force: :cascade do |t|
21
+ t.datetime "created_at", null: false
22
+ t.datetime "updated_at", null: false
23
+ end
14
24
 
15
25
  create_table "sandboxy", force: :cascade do |t|
16
26
  t.string "sandboxed_type", null: false
@@ -2,7 +2,7 @@ module Sandboxy
2
2
 
3
3
  def self.environment
4
4
  config = get_config
5
- if config&.key :environment
5
+ if config&.key(:environment)
6
6
  config[:environment]
7
7
  else
8
8
  'live'
@@ -19,7 +19,7 @@ module Sandboxy
19
19
 
20
20
  def self.retain_environment
21
21
  config = get_config
22
- if config&.key :retain_environment
22
+ if config&.key(:retain_environment)
23
23
  config[:retain_environment]
24
24
  else
25
25
  false
@@ -34,9 +34,11 @@ module Sandboxy
34
34
  require 'yaml'
35
35
 
36
36
  begin
37
- YAML.load_file 'config/sandboxy.yml'
37
+ config = YAML.load_file 'config/sandboxy.yml'
38
38
  rescue Exception
39
39
  end
40
+
41
+ return config if config
40
42
  end
41
43
 
42
44
  end
@@ -6,9 +6,12 @@ module Sandboxy
6
6
  end
7
7
 
8
8
  def call env
9
+ require 'sandboxy'
10
+
9
11
  previous_sandbox = $sandbox
10
12
  $sandbox = Sandboxy.environment == 'sandbox' ? true : false
11
- puts 'Sandbox: Moved to ' + Sandboxy.environment + ' environment' if $sandbox != previous_sandbox
13
+
14
+ puts 'Sandbox: Moved to ' + Sandboxy.environment.to_s + ' environment' if $sandbox != previous_sandbox
12
15
  end
13
16
 
14
17
  end
@@ -11,7 +11,9 @@ module Sandboxy
11
11
  end
12
12
 
13
13
  initializer 'sandboxy.configure_rails_initialization' do |app|
14
- puts 'Sandboxy: Using ' + Sandboxy.environment + ' environment'
14
+ require 'sandboxy'
15
+ puts 'Sandboxy: Using ' + Sandboxy.environment.to_s + ' environment'
16
+
15
17
  $sandbox = Sandboxy.environment == 'sandbox' ? true : false
16
18
  app.middleware.use(Sandboxy::Middleware) unless Sandboxy.retain_environment
17
19
  end
@@ -1,5 +1,5 @@
1
1
  module Sandboxy
2
2
 
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sandboxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slooob
@@ -208,9 +208,9 @@ files:
208
208
  - examples/rails_example/config/routes.rb
209
209
  - examples/rails_example/config/sandboxy.yml
210
210
  - examples/rails_example/config/secrets.yml
211
- - examples/rails_example/db/migrate/20170826222427_sandboxy_migration.rb
212
211
  - examples/rails_example/db/migrate/20170826223227_create_foos.rb
213
212
  - examples/rails_example/db/migrate/20170826223243_create_bars.rb
213
+ - examples/rails_example/db/migrate/20170827105828_sandboxy_migration.rb
214
214
  - examples/rails_example/db/schema.rb
215
215
  - examples/rails_example/db/seeds.rb
216
216
  - examples/rails_example/lib/assets/.keep