adhearsion 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/bin/ahn +1 -2
- data/lib/adhearsion/cli.rb +6 -0
- data/lib/adhearsion/cli_commands/ahn_command.rb +15 -10
- data/lib/adhearsion/script_ahn_loader.rb +13 -16
- data/lib/adhearsion/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f016136353daef3f5147c6aaf41345af3b9c82ca
|
4
|
+
data.tar.gz: 24e4268df718960405ab9475c9bd4864763d78ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 809fe06dee2ee0873ace49874c852e10d2cc40b057ac2978336a826852500424a589eec77377ee2ef20060759dbf4e8864bda0b556345112e658e5c6ee22f594
|
7
|
+
data.tar.gz: 4c7ab3f38feb787c356637aadda684a45d95c038be18b8396077a3823d63a2f0a0424940414d89d9bd24dfcc53016255142f9103807a03c7bbe93034fa1f3b69
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# [develop](https://github.com/adhearsion/adhearsion)
|
2
2
|
|
3
|
+
# [2.6.2](https://github.com/adhearsion/adhearsion/compare/v2.6.1...v2.6.2) - [2015-06-16](https://rubygems.org/gems/adhearsion/versions/2.6.2)
|
4
|
+
* Bugfix: Properly load application bundle. This requires the spawning removed in [#534](https://github.com/adhearsion/adhearsion/pull/534).
|
5
|
+
|
3
6
|
# [2.6.1](https://github.com/adhearsion/adhearsion/compare/v2.6.0...v2.6.1) - [2015-06-15](https://rubygems.org/gems/adhearsion/versions/2.6.1)
|
4
7
|
* Bugfix: Improve Call initialization performance. Use an ActorProxy (subclass) instead of a method_missing definition on every Call.new. This considerably improves Call.new performance; benchmarks show approximately a 30-40% improvement: https://gist.github.com/kares/3576e272250204eb66d1
|
5
8
|
* Bugfix: Executing ahn commands (such as start) won't spawn any sub-rubies underneath
|
data/bin/ahn
CHANGED
data/lib/adhearsion/cli.rb
CHANGED
@@ -1,4 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require 'adhearsion/script_ahn_loader'
|
4
|
+
|
5
|
+
# If we are inside an Adhearsion application this method performs an exec and thus
|
6
|
+
# the rest of this script is not run.
|
7
|
+
Adhearsion::ScriptAhnLoader.exec_script_ahn!
|
8
|
+
|
3
9
|
require 'adhearsion'
|
4
10
|
require 'adhearsion/cli_commands'
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require 'adhearsion/script_ahn_loader'
|
4
|
-
|
5
3
|
module Adhearsion
|
6
4
|
module CLI
|
7
5
|
class AhnCommand < Thor
|
@@ -102,25 +100,32 @@ module Adhearsion
|
|
102
100
|
|
103
101
|
def start_app(path, mode, pid_file = nil)
|
104
102
|
path = execute_from_app_dir! path
|
105
|
-
say "Starting Adhearsion server at #{
|
103
|
+
say "Starting Adhearsion server at #{Dir.pwd}"
|
106
104
|
Adhearsion::Initializer.start :mode => mode, :pid_file => pid_file
|
107
105
|
end
|
108
106
|
|
109
107
|
def execute_from_app_dir!(path)
|
110
|
-
|
108
|
+
if in_app? and running_script_ahn?
|
109
|
+
return Dir.pwd
|
110
|
+
end
|
111
111
|
|
112
|
-
path = nil if path && path.empty?
|
113
112
|
path ||= Dir.pwd if in_app?
|
114
113
|
|
115
|
-
raise PathRequired, ARGV[0] if path.nil?
|
116
|
-
raise PathInvalid, path unless File.directory?(path)
|
114
|
+
raise PathRequired, ARGV[0] if path.nil? or path.empty?
|
117
115
|
|
118
|
-
|
119
|
-
|
120
|
-
|
116
|
+
Dir.chdir path do
|
117
|
+
raise PathInvalid, path unless ScriptAhnLoader.in_ahn_application?
|
118
|
+
args = ARGV.dup
|
119
|
+
args[1] = '.'
|
120
|
+
ScriptAhnLoader.exec_script_ahn! args
|
121
|
+
end
|
121
122
|
path
|
122
123
|
end
|
123
124
|
|
125
|
+
def running_script_ahn?
|
126
|
+
$0.to_s == "script/ahn"
|
127
|
+
end
|
128
|
+
|
124
129
|
def in_app?
|
125
130
|
ScriptAhnLoader.in_ahn_application? or ScriptAhnLoader.in_ahn_application_subdirectory?
|
126
131
|
end
|
@@ -8,28 +8,25 @@ module Adhearsion
|
|
8
8
|
RUBY = File.join(*RbConfig::CONFIG.values_at("bindir", "ruby_install_name")) + RbConfig::CONFIG["EXEEXT"]
|
9
9
|
SCRIPT_AHN = File.join('script', 'ahn')
|
10
10
|
|
11
|
-
def self.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
path = path.parent
|
11
|
+
def self.exec_script_ahn!(args = ARGV)
|
12
|
+
cwd = Dir.pwd
|
13
|
+
return unless in_ahn_application? || in_ahn_application_subdirectory?
|
14
|
+
exec RUBY, SCRIPT_AHN, *args if in_ahn_application?
|
15
|
+
Dir.chdir("..") do
|
16
|
+
# Recurse in a chdir block: if the search fails we want to be sure
|
17
|
+
# the application is generated in the original working directory.
|
18
|
+
exec_script_ahn! unless cwd == Dir.pwd
|
20
19
|
end
|
21
|
-
|
20
|
+
rescue SystemCallError
|
21
|
+
# could not chdir, no problem just return
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.in_ahn_application?(path =
|
25
|
-
return File.exists? SCRIPT_AHN unless path
|
24
|
+
def self.in_ahn_application?(path = '.')
|
26
25
|
Dir.chdir(path) { File.exists? SCRIPT_AHN }
|
27
26
|
end
|
28
27
|
|
29
|
-
def self.in_ahn_application_subdirectory?(path =
|
30
|
-
path
|
31
|
-
File.exists?(File.join(path, SCRIPT_AHN)) ||
|
32
|
-
! path.root? && in_ahn_application_subdirectory?(path.parent)
|
28
|
+
def self.in_ahn_application_subdirectory?(path = Pathname.new(Dir.pwd))
|
29
|
+
File.exists?(File.join(path, SCRIPT_AHN)) || !path.root? && in_ahn_application_subdirectory?(path.parent)
|
33
30
|
end
|
34
31
|
end
|
35
32
|
end
|
data/lib/adhearsion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adhearsion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Phillips
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-06-
|
14
|
+
date: 2015-06-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|