origen 0.7.38 → 0.7.39

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: 698f640c1821d9c64393653ea14b0477706608d0
4
- data.tar.gz: b59403ab2bfe3bd50f351a734320a1f36535d1cc
3
+ metadata.gz: 82536f91ee909daf412bfaba465244b1f8f68597
4
+ data.tar.gz: 19414aa9e55e89e81edecefcd282c60a0e91d13a
5
5
  SHA512:
6
- metadata.gz: 3193f6f86078929b6935d6c7f911c09687eed2c84e6516ef7f71256d9ac150c8033dc0443664d4a4660a60b4e7c93cc157f3866c1e5ca870524c6f87c75e58cb
7
- data.tar.gz: d0e909f1061520ccaab14b1bc7722bb03613e3a75977ec035694c3cdb01aa22506ae7105963b81cb1d6c8d6aaf8a6d2380286b3cb8a74be62d3d9bbfa0cc46a0
6
+ metadata.gz: eca2a5082693bc54ec4ae68c61118b6a8c22301883726fe823220789b45a4d9e813dd74b72753893f3b4d1c6b9f5e2d7b3f249bcc9f21ac178108cd258d989dc
7
+ data.tar.gz: 10ca5f3d0d27976c0bff50987b31f9b8adb5055da40f0ff5d67721e9c08659b9993e7c23fa72c697eff37223202ca136b69d969d6139afa48892619f815d083d
File without changes
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 7
4
- BUGFIX = 38
4
+ BUGFIX = 39
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -56,6 +56,8 @@ unless defined? RGen::ORIGENTRANSITION
56
56
  autoload :Models, 'origen/models'
57
57
  autoload :Errata, 'origen/errata'
58
58
 
59
+ attr_reader :switch_user
60
+
59
61
  APP_CONFIG = File.join('config', 'application.rb')
60
62
 
61
63
  class OrigenError < StandardError
@@ -313,6 +315,15 @@ unless defined? RGen::ORIGENTRANSITION
313
315
  @root_fudge_active = false
314
316
  end
315
317
 
318
+ # This is similar to the command line of 'sudo <user_name>'. The main
319
+ # use case is when someone is running with a Service Account and needs
320
+ # to change to an actually user instead of the service account
321
+ def with_user(user_obj, &block)
322
+ @switch_user = user_obj
323
+ block.call
324
+ @switch_user = nil
325
+ end
326
+
316
327
  # Turns off bundler and all plugins if the app is loaded within this block
317
328
  # @api private
318
329
  def with_boot_environment
@@ -566,6 +577,7 @@ unless defined? RGen::ORIGENTRANSITION
566
577
  # @api private
567
578
  def current_user
568
579
  if app_loaded? || in_app_workspace?
580
+ return @switch_user unless @switch_user.nil?
569
581
  application.current_user
570
582
  else
571
583
  User.new(User.current_user_id)
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.38
4
+ version: 0.7.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport