nymphia 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d02e3f927f6d4e7cdf4505b72a1fbaa1760342a
4
- data.tar.gz: db1ae7d917cf15c3800a2ba3be7d7720faf076ce
3
+ metadata.gz: 3e63af421a0ea05d92b9373afb3ec820b48926c1
4
+ data.tar.gz: e78bc17a8c1f2ea1783408968d8c3630adaafcc0
5
5
  SHA512:
6
- metadata.gz: 45a19907f3dac299fb5ff4e926c061867232c86a2d34c426b3e7b363a2492f51d485c56ccf9141add987bd39ecf5a9dff6b2edab2f5480f52411e6ae2c7fc65c
7
- data.tar.gz: 777918ccfd4faa833c96a556aef1d624852ca652b98db4a48e6ea0cfe1c6ac4b56b79d2d8d81712c76b5d05e3e856b5cb0c85486157e04110004d1ceda96ff1f
6
+ metadata.gz: 45cc06ed31ce52ebba9f4b1ea366943f4fc208528bec9f7c146d4ec32213081f0f0f737965be47dfc12b7e352d550c5a31524c44cf82907e81e1d462dafa03e0
7
+ data.tar.gz: 1ed0a913d24959116dde40454f96adf2ee3dfa97e150b11bbff5830ae6759bf9b2ab236e2de320e1bdde8afbfb5c6ea415bec681be8d6076c4d9aabc3f0130b4
data/README.md CHANGED
@@ -35,19 +35,20 @@ identity_file :private, '~/.ssh/id_rsa.1'
35
35
 
36
36
  my_server_port = 4321
37
37
 
38
- host 'alice', 'my server on VPS' do
38
+ host('alice', 'my server on VPS') {
39
39
  hostname 'alice.example.com'
40
40
  user 'alice'
41
41
  port my_server_port
42
42
  use_identify_file :private
43
- end
43
+ }
44
44
  ```
45
45
 
46
46
  Following ssh config file is generated after the code is compiled.
47
47
 
48
48
  ```
49
49
  #
50
- # This config is generated by Nymphia 0.1.1
50
+ # This config is generated by Nymphia 0.1.2
51
+ # @ 2017-12-08T16:34:15+09:00
51
52
  #
52
53
 
53
54
  # my server on VPS
@@ -64,19 +65,21 @@ Method `host` generate `Host` directive. First argument is name of host, Second
64
65
 
65
66
  ### Splitting files
66
67
 
67
- You can use `load` method to load other Nymphia file like following example. Absolute path and relative path are acceptable as the file path.
68
+ You can use `include_file` method to include other Nymphia file like following example. Absolute path and relative path are acceptable as the file path.
69
+
70
+ We could use `load` in previous version, but `load` is obsoleted now.
68
71
 
69
72
  ```ruby
70
73
  identity_file :private, '~/.ssh/id_rsa.1'
71
74
 
72
- host 'alice', 'my server on VPS' do
75
+ host('alice', 'my server on VPS') {
73
76
  hostname 'alice.example.com'
74
77
  user 'alice'
75
78
  port 4321
76
79
  use_identify_file :private
77
- end
80
+ }
78
81
 
79
- load 'other_nymphia_file.rb'
82
+ include_file 'other_nymphia_file.rb'
80
83
  ```
81
84
 
82
85
  ### Proxy method
@@ -86,7 +89,7 @@ Method `proxy` is almost same to `host`, but `local_forward` method can be used
86
89
  ```ruby
87
90
  identity_file :company_gateway, '~/.ssh/id_rsa.company.gw'
88
91
 
89
- proxy 'awsproxy.company.apne1' do
92
+ proxy('awsproxy.company.apne1') {
90
93
  hostname 'gw.apne1.example.com'
91
94
  user 'alice'
92
95
  port 19822
@@ -105,14 +108,15 @@ proxy 'awsproxy.company.apne1' do
105
108
  'localhost' => 10389,
106
109
  'ldap.apne.aws.example.com' => 398,
107
110
  }
108
- end
111
+ }
109
112
  ```
110
113
 
111
114
  Following ssh config file is generated after the code is compiled.
112
115
 
113
116
  ```
114
117
  #
115
- # This config is generated by Nymphia 0.1.1
118
+ # This config is generated by Nymphia 0.1.2
119
+ # @ 2017-12-08T16:34:15+09:00
116
120
  #
117
121
 
118
122
  Host awsproxy.company.apne1
@@ -133,31 +137,31 @@ Nymphia has `group` and `gateway` method to make ssh config more structurally. F
133
137
  identity_file :company, '~/.ssh/id_rsa.company'
134
138
  identity_file :company_gateway, '~/.ssh/id_rsa.company.gw'
135
139
 
136
- gateway 'company.gateway' do
140
+ gateway('company.gateway') {
137
141
  hostname 'gw.example.com'
138
142
  user 'alice'
139
143
  port 19822
140
- end
144
+ }
141
145
 
142
- group 'company.ap-northeast-1' do
146
+ group('company.ap-northeast-1') {
143
147
  use_gateway 'company.gateway'
144
148
 
145
- default_params do
149
+ default_params {
146
150
  check_host_ip 'no'
147
151
  strict_host_key_checking 'no'
148
152
  user 'alice'
149
153
  port 9822
150
154
  use_identify_file :company, :company_gateway
151
- end
155
+ }
152
156
 
153
- host '*.apne.aws.example.com'
157
+ host('*.apne.aws.example.com')
154
158
 
155
- host 'alice.apne.aws.example.com' do
159
+ host('alice.apne.aws.example.com') {
156
160
  hostname '10.16.16.16'
157
161
  user 'white_rabbit'
158
162
  port 7777
159
- end
160
- end
163
+ }
164
+ }
161
165
  ```
162
166
 
163
167
  Following ssh config file is generated after the code is compiled.
@@ -165,7 +169,8 @@ Following ssh config file is generated after the code is compiled.
165
169
  ```
166
170
 
167
171
  #
168
- # This config is generated by Nymphia 0.1.1
172
+ # This config is generated by Nymphia 0.1.2
173
+ # @ 2017-12-08T16:34:15+09:00
169
174
  #
170
175
 
171
176
  Host company.gateway
@@ -2,18 +2,18 @@ identity_file :private, '~/.ssh/id_rsa.1'
2
2
 
3
3
  my_server_port = 4321
4
4
 
5
- host 'alice', 'my server on VPS' do
5
+ host('alice', 'my server on VPS') {
6
6
  hostname 'alice.example.com'
7
7
  user 'alice'
8
8
  port my_server_port
9
9
  use_identify_file :private
10
- end
10
+ }
11
11
 
12
- host 'queen', 'NAS in my home network' do
12
+ host('queen', 'NAS in my home network') {
13
13
  hostname '172.16.16.3'
14
14
  user 'alice'
15
15
  port my_server_port
16
16
  use_identify_file :private
17
- end
17
+ }
18
18
 
19
- load 'company.rb'
19
+ include_file 'company.rb'
@@ -2,33 +2,33 @@ identity_file :company, '~/.ssh/id_rsa.company'
2
2
  identity_file :company_gateway, '~/.ssh/id_rsa.company.gw'
3
3
  identity_file :company_internal, '~/.ssh/id_rsa.company.in'
4
4
 
5
- gateway 'company.gateway', 'Gateway saerver of my company' do
5
+ gateway('company.gateway', 'Gateway saerver of my company') {
6
6
  hostname 'gw.example.com'
7
7
  user 'alice'
8
8
  port 19822
9
- end
9
+ }
10
10
 
11
- group 'company.ap-northeast-1' do
11
+ group('company.ap-northeast-1') {
12
12
  use_gateway 'company.gateway'
13
13
 
14
- default_params do
14
+ default_params {
15
15
  check_host_ip 'no'
16
16
  strict_host_key_checking 'no'
17
17
  user 'alice'
18
18
  port 9822
19
19
  use_identify_file :company, :company_gateway
20
- end
20
+ }
21
21
 
22
- host '*.apne.aws.example.com'
22
+ host('*.apne.aws.example.com')
23
23
 
24
- host 'alice.apne.aws.example.com' do
24
+ host('alice.apne.aws.example.com') {
25
25
  hostname '10.16.16.16'
26
26
  user 'white_rabbit'
27
27
  port 7777
28
- end
29
- end
28
+ }
29
+ }
30
30
 
31
- proxy 'awsproxy.company.apne1' do
31
+ proxy('awsproxy.company.apne1') {
32
32
  hostname 'gw.apne1.example.com'
33
33
  user 'alice'
34
34
  port 19822
@@ -47,8 +47,8 @@ proxy 'awsproxy.company.apne1' do
47
47
  'localhost' => 10389,
48
48
  'ldap.apne.aws.example.com' => 398,
49
49
  }
50
- end
50
+ }
51
51
 
52
- host 'ghe.company.example.com' do
52
+ host('ghe.company.example.com') {
53
53
  use_identify_file :company_internal
54
- end
54
+ }
@@ -1,5 +1,6 @@
1
1
  #
2
- # This config is generated by Nymphia 0.1.1
2
+ # This config is generated by Nymphia 0.1.2
3
+ # @ 2017-12-08T16:34:15+09:00
3
4
  #
4
5
 
5
6
  # my server on VPS
@@ -37,6 +37,11 @@ class Nymphia::DSL::Context
37
37
  end
38
38
 
39
39
  def load(load_file_path)
40
+ warn "#{caller[0]}: #load method is obsolated. Use #include_file"
41
+ include_file(load_file_path)
42
+ end
43
+
44
+ def include_file(load_file_path)
40
45
  absolute_load_file_path = Pathname.new(@path).dirname.join(load_file_path)
41
46
  dsl_code = File.read(absolute_load_file_path)
42
47
 
@@ -1,3 +1,3 @@
1
1
  module Nymphia
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nymphia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mozamimy (Moza USANE)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-03 00:00:00.000000000 Z
11
+ date: 2018-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler