union_station_hooks_core 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmJiODdmYzU4ZGE4NDZmZjYyMDRiNGI4NmE4ZjE1Njk0MzE0OGVhNw==
4
+ ZGU3MGNhZGUwZjEzYzZkMzM1OTk1ZmExZTg0MjQ3MzlmZTNjZDdkZQ==
5
5
  data.tar.gz: !binary |-
6
- YzA4NDM4NGQzMWM5MWU0NzE4OTIyNDQ1MGMyMGNmZDFkYjQ4YjM1Mg==
6
+ ZjY4NzI5MTJjZDIxOWJhZTQ2OWZiNTk2ZWYzYWUyODEyYzlkYTNhZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzZkYjIwYjI0MmJmYjRiMjU5Zjc4OTFlOTVmNWUwMzhiMzVhZDJkZjhmNGQ1
10
- NGExMDI2ZDVjYmEwMDM1NDY0N2I5MDM0YjQ2YWUwNWFmNDk0ZmZlMjA3NmE1
11
- MzZkNGYyMTUyYmU1NjI3YTA0YzVhNDIzZTI3NDYyOWIxYzg3MGU=
9
+ ODk1YzBlZTM4ZmI4MjllMGZjODkxZTkzY2NkOTI2MTJhZjc5YjM4YjUxYjcy
10
+ MmVlZTI0MDBmZGZjOGFjNzgzN2NhMjRmNWZkMWI4NWNhZmY4YjhlNWRhZjcy
11
+ N2JlZDYzNGE2NGFhN2YwOTQ4NmJhZDc2ZWVlODcyODRlNWExMzI=
12
12
  data.tar.gz: !binary |-
13
- MTkyNzY1OWYwYjJlNDA5Y2NjZWE1ZGM3YWU1YzVlMzU1MGQwODZjNGJkODhm
14
- NWZhMGE2NmJkOGU0YjJjMzE0Mzk5MjJiZTQ1ZTJlZjYzNmQ4ZDQ0M2Y4ODI5
15
- ZGUwYWUyNDVjMzliNDViMDcwNTZmMTQ1Mzc1YWE0MGMzMTg5N2Y=
13
+ ODQ1MDQ4MGRjNjhjMjBjMWUxMzliMTA5ODZjNDM5ODIxMzA0N2JmYTcxOTc0
14
+ ZjFmODdjMjcyYjZjZjQ5NzNiYWQ5YjMyNTc2OTg4Y2UzOGZhOGQ1NjgyMjRh
15
+ YTNhMGI1OTFmOGM0NDFhNTQ5YTc1ZDM4NjE3ZTg4YjVmZGI0MmY=
@@ -235,9 +235,9 @@ module UnionStationHooks
235
235
  private
236
236
 
237
237
  RANDOM_CHARS = %w(
238
- abcdefghijklmnopqrstuvwxyz
239
- ABCDEFGHIJKLMNOPQRSTUVWXYZ
240
- 0123456789
238
+ a b c d e f g h i j k l m n o p q r s t u v w x y z
239
+ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
240
+ 0 1 2 3 4 5 6 7 8 9
241
241
  )
242
242
 
243
243
  def connect
@@ -56,12 +56,8 @@ module UnionStationHooks
56
56
  def find_passenger_config
57
57
  passenger_config = ENV['PASSENGER_CONFIG']
58
58
  if passenger_config.nil? || passenger_config.empty?
59
- ENV['PATH'].split(':').each do |path|
60
- if File.exist?("#{path}/passenger-config")
61
- passenger_config = "#{path}/passenger-config"
62
- break
63
- end
64
- end
59
+ passenger_config = find_passenger_config_vendor ||
60
+ find_passenger_config_in_path
65
61
  end
66
62
  if passenger_config.nil? || passenger_config.empty?
67
63
  abort 'ERROR: The unit tests are to be run against a specific ' \
@@ -73,6 +69,28 @@ module UnionStationHooks
73
69
  passenger_config
74
70
  end
75
71
 
72
+ # Looks for the passenger-config command in PATH, returning nil
73
+ # if not found.
74
+ def find_passenger_config_in_path
75
+ ENV['PATH'].split(':').each do |path|
76
+ if File.exist?("#{path}/passenger-config")
77
+ return "#{path}/passenger-config"
78
+ end
79
+ end
80
+ end
81
+
82
+ # Checks whether this union_station_hooks installation is a copy that
83
+ # is vendored into Passenger, and if so, returns the full path to the
84
+ # containing Passenger's passenger-config command.
85
+ def find_passenger_config_vendor
86
+ path = "#{UnionStationHooks::ROOT}/../../../../../bin/passenger-config"
87
+ if File.exist?(path)
88
+ File.expand_path(path)
89
+ else
90
+ nil
91
+ end
92
+ end
93
+
76
94
  # Uses `find_passenger_config` to lookup a Passenger installation, and
77
95
  # loads the Passenger Ruby support library associated with that
78
96
  # installation. All the constants defined in the Passenger Ruby support
@@ -39,6 +39,6 @@
39
39
  {
40
40
  :major => 1,
41
41
  :minor => 0,
42
- :tiny => 1,
43
- :string => '1.0.1'
42
+ :tiny => 2,
43
+ :string => '1.0.2'
44
44
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: union_station_hooks_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hongli Lai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Union Station Ruby hooks core code.
14
14
  email: info@phusion.nl