stagery 1.0.0 → 1.1.0

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
  SHA256:
3
- metadata.gz: 7c7561d3c9f2d3267214993a89b8fbd0b26edb96ba68d086c01b2e3b977eb3f7
4
- data.tar.gz: 49b32cfad64f3ccb4b3f46d50475e70be0cdd34a9bb6cd8e422592244388ca7d
3
+ metadata.gz: 6454bcc50b2856f4d8d8e69bfa4b32b8f5c6cdba672466319eca71cdacc0acd8
4
+ data.tar.gz: 75cebae60d7963a011e30d22eccb98bca88b1b5ca0015527da63ca57f6fd7970
5
5
  SHA512:
6
- metadata.gz: fe75ae774583cb2ace54d0d9390fbe6a4c2c6f0750293e14cb86349938947a93775bfc4300c252e2373715b9ecf1fdbd27cd4540f1bb2c0d9088fd4b7d70530d
7
- data.tar.gz: 419b2f94220dd0a4b2d41ffc459a5c7af8fd8adf7f0063859f790058c34656a6641e565410bbbf192134424d6bb1992d685cbe64ff4ab8fb119b71189f1a70a4
6
+ metadata.gz: 03b0537235f3e8177408e76adfbfc890e2da05a04ad0c9489913ffdee3ec21734d4637bed2cc11c2d31152806f41448975c8aecdd09847d0f547b479e60513b9
7
+ data.tar.gz: f6910ced7d65cdfdc4f2358cf586cdea74bfed0b7ca338aea769060248466fba5b0ba84affb706c48e98bfb3f71b11155e902b498ba360d9357f33f29c44a162
data/lib/stagery.rb CHANGED
@@ -2,9 +2,14 @@
2
2
 
3
3
  require 'active_support/string_inquirer'
4
4
  require_relative 'stagery/version'
5
+ require_relative 'stagery/test_helper'
5
6
 
6
7
  module Stagery
7
8
  def self.stage
8
9
  @_stage ||= ActiveSupport::StringInquirer.new(ENV["STAGERY_STAGE"] || "development")
9
10
  end
11
+
12
+ def self.stage=(stage)
13
+ @_stage = ActiveSupport::StringInquirer.new(stage)
14
+ end
10
15
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stagery
4
+ module TestHelper
5
+ def with_stagery_stage(stage)
6
+ previous_stagery_stage = Stagery.stage
7
+ Stagery.stage = stage
8
+ yield
9
+ ensure
10
+ Stagery.stage = previous_stagery_stage
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Stagery
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stagery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florent Beaurain
@@ -33,6 +33,7 @@ files:
33
33
  - LICENSE
34
34
  - README.md
35
35
  - lib/stagery.rb
36
+ - lib/stagery/test_helper.rb
36
37
  - lib/stagery/version.rb
37
38
  homepage: https://github.com/beauraF/stagery
38
39
  licenses: