taketo 0.1.3 → 0.2.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +8 -0
- data/README.md +16 -1
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/taketo +17 -89
- data/lib/taketo/actions/base_action.rb +29 -0
- data/lib/taketo/actions/generate_ssh_config.rb +22 -0
- data/lib/taketo/actions/group_action.rb +15 -0
- data/lib/taketo/actions/list.rb +22 -0
- data/lib/taketo/actions/login.rb +40 -0
- data/lib/taketo/actions/matches.rb +28 -0
- data/lib/taketo/actions/node_action.rb +15 -0
- data/lib/taketo/actions/server_action.rb +14 -0
- data/lib/taketo/actions/view.rb +24 -0
- data/lib/taketo/actions.rb +21 -0
- data/lib/taketo/associated_nodes.rb +4 -0
- data/lib/taketo/commands.rb +2 -1
- data/lib/taketo/config_validator.rb +4 -0
- data/lib/taketo/config_visitor.rb +3 -1
- data/lib/taketo/constructs/config.rb +2 -1
- data/lib/taketo/constructs/environment.rb +9 -0
- data/lib/taketo/constructs/group.rb +20 -0
- data/lib/taketo/constructs/project.rb +2 -1
- data/lib/taketo/constructs/server.rb +1 -1
- data/lib/taketo/constructs.rb +1 -0
- data/lib/taketo/constructs_factory.rb +4 -0
- data/lib/taketo/destination_matcher.rb +4 -4
- data/lib/taketo/dsl.rb +18 -17
- data/lib/taketo/group_list_visitor.rb +11 -0
- data/lib/taketo/group_resolver.rb +12 -0
- data/lib/taketo/{destination_resolver.rb → node_resolver.rb} +5 -27
- data/lib/taketo/server_resolver.rb +29 -0
- data/spec/acceptance/command_spec.rb +2 -1
- data/spec/acceptance/completion_spec.rb +26 -9
- data/spec/acceptance/config_dsl_spec.rb +74 -13
- data/spec/acceptance/config_validation_spec.rb +20 -5
- data/spec/acceptance/connect_to_server_spec.rb +6 -3
- data/spec/acceptance/error_handling_spec.rb +2 -2
- data/spec/acceptance/generate_ssh_config_spec.rb +1 -1
- data/spec/acceptance/help_spec.rb +4 -2
- data/spec/acceptance/location_spec.rb +2 -1
- data/spec/acceptance_spec_helper.rb +1 -1
- data/spec/lib/taketo/actions_spec.rb +17 -0
- data/spec/lib/taketo/associated_nodes_spec.rb +34 -0
- data/spec/lib/taketo/config_validator_spec.rb +1 -1
- data/spec/lib/taketo/constructs/config_spec.rb +4 -1
- data/spec/lib/taketo/constructs/environment_spec.rb +6 -1
- data/spec/lib/taketo/constructs/group_spec.rb +30 -0
- data/spec/lib/taketo/constructs/project_spec.rb +2 -0
- data/spec/lib/taketo/constructs/server_spec.rb +6 -2
- data/spec/lib/taketo/constructs_factory_spec.rb +5 -0
- data/spec/lib/taketo/dsl_spec.rb +86 -74
- data/spec/lib/taketo/group_list_visitor_spec.rb +20 -0
- data/spec/lib/taketo/group_resolver_spec.rb +59 -0
- data/spec/lib/taketo/{destination_resolver_spec.rb → server_resolver_spec.rb} +3 -29
- data/spec/support/helpers/construct_spec_helper.rb +9 -0
- data/spec/support/helpers/dsl_spec_helper.rb +31 -9
- data/spec/support/matchers/enclose_scope_matcher.rb +15 -7
- metadata +41 -20
@@ -1,18 +1,26 @@
|
|
1
1
|
RSpec::Matchers.define :enclose_scope do |expected_scope|
|
2
|
-
chain(:under) do |
|
3
|
-
@
|
2
|
+
chain(:under) do |scope_variants|
|
3
|
+
@external_scope_variants = scope_variants
|
4
4
|
end
|
5
5
|
|
6
6
|
match do |actual|
|
7
7
|
@result = true
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
@external_scope_variants.each do |external_scope_variant|
|
9
|
+
dsl(external_scope_variant || scopes[:config]) do |c|
|
10
|
+
@result &= !c.send(:current_scope?, expected_scope)
|
11
|
+
c.send(expected_scope, :foo) do
|
12
|
+
@result &= c.send(:current_scope?, expected_scope)
|
13
|
+
end
|
14
|
+
@result &= !c.send(:current_scope?, expected_scope)
|
12
15
|
end
|
13
|
-
@result &= !c.send(:current_scope?, expected_scope)
|
14
16
|
end
|
15
17
|
@result
|
16
18
|
end
|
19
|
+
|
20
|
+
description do
|
21
|
+
msg = "enclose scope #{expected_scope}"
|
22
|
+
msg += " under #{@external_scope_variants.inspect}" if @external_scope_variants
|
23
|
+
msg
|
24
|
+
end
|
17
25
|
end
|
18
26
|
|
metadata
CHANGED
@@ -1,80 +1,80 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taketo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
prerelease: 6
|
5
|
+
version: 0.2.0.alpha
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Vladimir Yarotsky
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
prerelease: false
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '2.11'
|
22
|
-
none: false
|
23
22
|
type: :development
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '2.11'
|
29
|
-
|
29
|
+
prerelease: false
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rake
|
32
|
-
prerelease: false
|
33
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0.9'
|
38
|
-
none: false
|
39
38
|
type: :development
|
40
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0.9'
|
45
|
-
|
45
|
+
prerelease: false
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: simplecov
|
48
|
-
prerelease: false
|
49
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0.6'
|
54
|
-
none: false
|
55
54
|
type: :development
|
56
55
|
version_requirements: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
57
|
requirements:
|
58
58
|
- - ~>
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0.6'
|
61
|
-
|
61
|
+
prerelease: false
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: open4
|
64
|
-
prerelease: false
|
65
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '1.3'
|
70
|
-
none: false
|
71
70
|
type: :development
|
72
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '1.3'
|
77
|
-
|
77
|
+
prerelease: false
|
78
78
|
description: ! " Taketo is an utility to aid quick access to often used servers
|
79
79
|
for web-developers.\n Taketo uses a config written in ruby using light DSL.\n
|
80
80
|
\ See http://github.com/v-yarotsky/taketo for additional instructions\n"
|
@@ -85,6 +85,16 @@ extensions: []
|
|
85
85
|
extra_rdoc_files: []
|
86
86
|
files:
|
87
87
|
- bin/taketo
|
88
|
+
- lib/taketo/actions/base_action.rb
|
89
|
+
- lib/taketo/actions/generate_ssh_config.rb
|
90
|
+
- lib/taketo/actions/group_action.rb
|
91
|
+
- lib/taketo/actions/list.rb
|
92
|
+
- lib/taketo/actions/login.rb
|
93
|
+
- lib/taketo/actions/matches.rb
|
94
|
+
- lib/taketo/actions/node_action.rb
|
95
|
+
- lib/taketo/actions/server_action.rb
|
96
|
+
- lib/taketo/actions/view.rb
|
97
|
+
- lib/taketo/actions.rb
|
88
98
|
- lib/taketo/associated_nodes.rb
|
89
99
|
- lib/taketo/commands/ssh_command.rb
|
90
100
|
- lib/taketo/commands.rb
|
@@ -96,14 +106,18 @@ files:
|
|
96
106
|
- lib/taketo/constructs/command.rb
|
97
107
|
- lib/taketo/constructs/config.rb
|
98
108
|
- lib/taketo/constructs/environment.rb
|
109
|
+
- lib/taketo/constructs/group.rb
|
99
110
|
- lib/taketo/constructs/project.rb
|
100
111
|
- lib/taketo/constructs/server.rb
|
101
112
|
- lib/taketo/constructs.rb
|
102
113
|
- lib/taketo/constructs_factory.rb
|
103
114
|
- lib/taketo/destination_matcher.rb
|
104
|
-
- lib/taketo/destination_resolver.rb
|
105
115
|
- lib/taketo/dsl.rb
|
116
|
+
- lib/taketo/group_list_visitor.rb
|
117
|
+
- lib/taketo/group_resolver.rb
|
118
|
+
- lib/taketo/node_resolver.rb
|
106
119
|
- lib/taketo/printer.rb
|
120
|
+
- lib/taketo/server_resolver.rb
|
107
121
|
- lib/taketo/ssh_config_generator_visitor.rb
|
108
122
|
- lib/taketo/support/key_error.rb
|
109
123
|
- lib/taketo/support/named_nodes_collection.rb
|
@@ -120,6 +134,7 @@ files:
|
|
120
134
|
- spec/acceptance/location_spec.rb
|
121
135
|
- spec/acceptance_spec_helper.rb
|
122
136
|
- spec/integration/dsl_integration_spec.rb
|
137
|
+
- spec/lib/taketo/actions_spec.rb
|
123
138
|
- spec/lib/taketo/associated_nodes_spec.rb
|
124
139
|
- spec/lib/taketo/commands/ssh_command_spec.rb
|
125
140
|
- spec/lib/taketo/config_printer_visitor_spec.rb
|
@@ -130,12 +145,15 @@ files:
|
|
130
145
|
- spec/lib/taketo/constructs/command_spec.rb
|
131
146
|
- spec/lib/taketo/constructs/config_spec.rb
|
132
147
|
- spec/lib/taketo/constructs/environment_spec.rb
|
148
|
+
- spec/lib/taketo/constructs/group_spec.rb
|
133
149
|
- spec/lib/taketo/constructs/project_spec.rb
|
134
150
|
- spec/lib/taketo/constructs/server_spec.rb
|
135
151
|
- spec/lib/taketo/constructs_factory_spec.rb
|
136
152
|
- spec/lib/taketo/destination_matcher_spec.rb
|
137
|
-
- spec/lib/taketo/destination_resolver_spec.rb
|
138
153
|
- spec/lib/taketo/dsl_spec.rb
|
154
|
+
- spec/lib/taketo/group_list_visitor_spec.rb
|
155
|
+
- spec/lib/taketo/group_resolver_spec.rb
|
156
|
+
- spec/lib/taketo/server_resolver_spec.rb
|
139
157
|
- spec/lib/taketo/ssh_config_generator_visitor_spec.rb
|
140
158
|
- spec/lib/taketo/support/named_nodes_collection_spec.rb
|
141
159
|
- spec/spec_helper.rb
|
@@ -158,20 +176,23 @@ rdoc_options: []
|
|
158
176
|
require_paths:
|
159
177
|
- lib
|
160
178
|
required_ruby_version: !ruby/object:Gem::Requirement
|
179
|
+
none: false
|
161
180
|
requirements:
|
162
181
|
- - ! '>='
|
163
182
|
- !ruby/object:Gem::Version
|
183
|
+
segments:
|
184
|
+
- 0
|
185
|
+
hash: -2702655235104001250
|
164
186
|
version: '0'
|
165
|
-
none: false
|
166
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
|
+
none: false
|
167
189
|
requirements:
|
168
190
|
- - ! '>='
|
169
191
|
- !ruby/object:Gem::Version
|
170
192
|
version: 1.3.6
|
171
|
-
none: false
|
172
193
|
requirements: []
|
173
194
|
rubyforge_project:
|
174
|
-
rubygems_version: 1.8.
|
195
|
+
rubygems_version: 1.8.25
|
175
196
|
signing_key:
|
176
197
|
specification_version: 3
|
177
198
|
summary: A tiny helper utility to make access to servers eaiser for different projects
|