alki-console 0.7.0 → 0.7.1
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 +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +4 -0
- data/Gemfile +3 -0
- data/README.adoc +2 -0
- data/Rakefile +3 -1
- data/alki-console.gemspec +3 -2
- data/config/assembly.rb +14 -2
- data/lib/alki/console/version.rb +1 -1
- data/test/feature/mounted_test.rb +17 -0
- data/test/feature/standalone_test.rb +17 -0
- data/test/feature/wrapper_test.rb +20 -0
- data/test/feature_test_helper.rb +15 -0
- data/test/fixtures/mounted.rb +11 -0
- data/test/fixtures/standalone.rb +10 -0
- data/test/fixtures/wrapper/config/assembly.rb +3 -0
- data/test/fixtures/wrapper/lib/wrapper.rb +2 -0
- metadata +24 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e163e9e5fa64b3a7f81d49199b530b4ca8ac1c2
|
4
|
+
data.tar.gz: 178461f9fa0de6f226c50af371bab401c20dcf52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff4dac5cf634f4dc7d40587fe4bfa9c4105316aa007ac6e2717f9815eea9ad756949cdcfbe75d334a4c820352231d0cbca6915ce48a5e2ac819046cfdb1a2eb6
|
7
|
+
data.tar.gz: d37fad95ae11085e367581c7edfc59dc2e1f694e89b9e7bbdf4f2edeff8a752c7d72f5301454f34fb6389b72a261ee9add97a5fbde4c5cfc384928c52409adf0
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.adoc
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
= Alki::Console
|
2
2
|
|
3
|
+
image:https://travis-ci.org/alki-project/alki-console.svg?branch=master["Build Status", link="https://travis-ci.org/alki-project/alki-console"]
|
4
|
+
|
3
5
|
Provides a console to work with https://github.com/alki-project/alki[Alki] assemblies.
|
4
6
|
Built on https://github.com/pry/pry[Pry].
|
5
7
|
|
data/Rakefile
CHANGED
data/alki-console.gemspec
CHANGED
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Matt Edlefsen"]
|
10
10
|
spec.email = ["matt.edlefsen@gmail.com"]
|
11
11
|
spec.summary = %q{Developer console for Alki applications}
|
12
|
-
spec.homepage = "
|
12
|
+
spec.homepage = "http://alki.io/projects/alki-console"
|
13
13
|
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = '>= 2.1.0'
|
14
15
|
|
15
16
|
spec.files = `git ls-files -z`.split("\x0")
|
16
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -18,6 +19,6 @@ Gem::Specification.new do |spec|
|
|
18
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
20
|
spec.require_paths = ["lib"]
|
20
21
|
|
21
|
-
spec.add_dependency "alki", "~> 0.
|
22
|
+
spec.add_dependency "alki", "~> 0.14.0"
|
22
23
|
spec.add_dependency "pry", "~> 0.11"
|
23
24
|
end
|
data/config/assembly.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
Alki do
|
2
|
+
set :mounted? do
|
3
|
+
respond_to? :parent
|
4
|
+
end
|
5
|
+
|
2
6
|
set :prompt do
|
3
|
-
|
7
|
+
if mounted? && parent.assembly_name
|
8
|
+
parent.assembly_name.gsub('/','-')
|
9
|
+
else
|
10
|
+
'app'
|
11
|
+
end
|
4
12
|
end
|
5
13
|
|
6
14
|
func :run do
|
@@ -8,7 +16,11 @@ Alki do
|
|
8
16
|
end
|
9
17
|
|
10
18
|
set :context do
|
11
|
-
|
19
|
+
if mounted?
|
20
|
+
parent
|
21
|
+
else
|
22
|
+
nil
|
23
|
+
end
|
12
24
|
end
|
13
25
|
|
14
26
|
tag :main_loop
|
data/lib/alki/console/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'alki/feature_test'
|
2
|
+
|
3
|
+
describe 'Mounted' do
|
4
|
+
before do
|
5
|
+
start_console fixture_path 'mounted.rb'
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should set prompt to parent assembly name' do
|
9
|
+
@read.expect(/mounted>/,1).wont_be_nil
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should forward methods to parent assembly' do
|
13
|
+
@write.puts('foo')
|
14
|
+
@read.expect(/:foo/,1).wont_be_nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'alki/feature_test'
|
2
|
+
|
3
|
+
describe 'Standalone' do
|
4
|
+
before do
|
5
|
+
start_console fixture_path 'standalone.rb'
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should set prompt to app by default' do
|
9
|
+
@read.expect(/app>/,1).wont_be_nil
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should forward methods to context' do
|
13
|
+
@write.puts('foo')
|
14
|
+
@read.expect(/:foo/,1).wont_be_nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'alki/feature_test'
|
2
|
+
|
3
|
+
$LOAD_PATH << Alki::Test.fixture_path('wrapper','lib')
|
4
|
+
|
5
|
+
describe 'Wrapper' do
|
6
|
+
before do
|
7
|
+
Dir.chdir fixture_path('wrapper')
|
8
|
+
start_console File.expand_path('../../../exe/alki-console',__FILE__)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should set prompt to wrapped assembly name' do
|
12
|
+
@read.expect(/wrapper>/,1).wont_be_nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should forward methods to wrapped assembly' do
|
16
|
+
@write.puts('foo')
|
17
|
+
@read.expect(/:foo/,1).wont_be_nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'alki/console'
|
2
|
+
require 'pty'
|
3
|
+
require 'expect'
|
4
|
+
|
5
|
+
Alki::Test.feature_exec do
|
6
|
+
def start_console(cmd)
|
7
|
+
@read, @write, @pid = PTY.spawn "ruby #{cmd}"
|
8
|
+
end
|
9
|
+
|
10
|
+
after do
|
11
|
+
@read.close
|
12
|
+
@write.close
|
13
|
+
Process.kill('TERM',@pid)
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alki-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Edlefsen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alki
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.14.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.14.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,6 +47,7 @@ extensions: []
|
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
49
|
- ".gitignore"
|
50
|
+
- ".travis.yml"
|
50
51
|
- Gemfile
|
51
52
|
- README.adoc
|
52
53
|
- Rakefile
|
@@ -57,7 +58,15 @@ files:
|
|
57
58
|
- lib/alki/console/pry_console.rb
|
58
59
|
- lib/alki/console/version.rb
|
59
60
|
- lib/alki/console/wrapper.rb
|
60
|
-
|
61
|
+
- test/feature/mounted_test.rb
|
62
|
+
- test/feature/standalone_test.rb
|
63
|
+
- test/feature/wrapper_test.rb
|
64
|
+
- test/feature_test_helper.rb
|
65
|
+
- test/fixtures/mounted.rb
|
66
|
+
- test/fixtures/standalone.rb
|
67
|
+
- test/fixtures/wrapper/config/assembly.rb
|
68
|
+
- test/fixtures/wrapper/lib/wrapper.rb
|
69
|
+
homepage: http://alki.io/projects/alki-console
|
61
70
|
licenses:
|
62
71
|
- MIT
|
63
72
|
metadata: {}
|
@@ -69,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
78
|
requirements:
|
70
79
|
- - ">="
|
71
80
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
81
|
+
version: 2.1.0
|
73
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
83
|
requirements:
|
75
84
|
- - ">="
|
@@ -81,4 +90,12 @@ rubygems_version: 2.6.12
|
|
81
90
|
signing_key:
|
82
91
|
specification_version: 4
|
83
92
|
summary: Developer console for Alki applications
|
84
|
-
test_files:
|
93
|
+
test_files:
|
94
|
+
- test/feature/mounted_test.rb
|
95
|
+
- test/feature/standalone_test.rb
|
96
|
+
- test/feature/wrapper_test.rb
|
97
|
+
- test/feature_test_helper.rb
|
98
|
+
- test/fixtures/mounted.rb
|
99
|
+
- test/fixtures/standalone.rb
|
100
|
+
- test/fixtures/wrapper/config/assembly.rb
|
101
|
+
- test/fixtures/wrapper/lib/wrapper.rb
|