poet 0.7.1 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  master
2
2
 
3
+ 0.8
4
+
5
+ - opt-in bash completion (beware: a little sluggish on 1.9.3)
6
+
3
7
  0.7
4
8
 
5
9
  - list config files with `poet ls` or `poet ls --tree`
data/README.md CHANGED
@@ -21,6 +21,16 @@ Poet won't touch your existing ssh_config.
21
21
  If you want to play with it, pass a different filename to the "-o" option.
22
22
  Or move your existing config out of the way.
23
23
 
24
+ ### Bash completion
25
+
26
+ A Bash-compatible completion script is available for all commands and some of their arguments, most
27
+ notably for `poet edit`.
28
+
29
+ Run `poet completeme` to copy the script to `$HOME/.bash_completion.d/`.
30
+ The command outputs instructions how to properly source the file.
31
+
32
+ ### Un-ignoring files
33
+
24
34
  Stanzas under `~/.ssh/config.d/` with an extension of .disabled are ignored by default.
25
35
  Every now and then, when you do need it, run `poet --with CONFIG` to explicitly include
26
36
  `CONFIG.disabled` in your generated ssh_config. You can even include several by running several
@@ -0,0 +1,34 @@
1
+ _poet()
2
+ {
3
+ local cur prev opts base
4
+ COMPREPLY=()
5
+ cur="${COMP_WORDS[COMP_CWORD]}"
6
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
7
+
8
+ #
9
+ # The basic commands we'll complete.
10
+ #
11
+ commands="bootstrap edit help ls completeme"
12
+
13
+ #
14
+ # Complete the arguments to some of the basic commands.
15
+ #
16
+ case "${prev}" in
17
+ edit)
18
+ local files=$(poet ls)
19
+ COMPREPLY=( $(compgen -W "${files}" -- ${cur}) )
20
+ return 0
21
+ ;;
22
+ ls)
23
+ local flags="-t --tree"
24
+ COMPREPLY=( $(compgen -W "${flags}" -- ${cur}) )
25
+ return 0
26
+ ;;
27
+ *)
28
+ ;;
29
+ esac
30
+
31
+ COMPREPLY=($(compgen -W "${commands}" -- ${cur}))
32
+ return 0
33
+ }
34
+ complete -F _poet poet
@@ -50,6 +50,16 @@ class PoetCLI < Thor
50
50
  create
51
51
  end
52
52
 
53
+ desc "completeme", "Install completion for Bash into ~/.bash_completion.d/"
54
+ def completeme
55
+ completion_dir = File.expand_path("~/.bash_completion.d/")
56
+ FileUtils.mkdir_p(completion_dir)
57
+ say "Copying completion file to #{completion_dir}"
58
+ FileUtils.cp(File.expand_path('../../completion/poet.bash', __FILE__), completion_dir)
59
+ say %Q(To use the completion, execute this command:\n
60
+ echo 'source #{File.join(completion_dir, 'poet.bash')}' >> ~/.bashrc)
61
+ end
62
+
53
63
  desc "", "Concatenate all host stanzas under ~/.ssh/config.d/ into a single ~/.ssh/config"
54
64
  def create
55
65
  if !File.directory?(options[:dir])
@@ -77,7 +87,7 @@ class PoetCLI < Thor
77
87
  files.sort.each do |file|
78
88
  entries << "\n# Located in " + file.to_s
79
89
  entries << File.read(file)
80
- $stdout.puts "Using #{file.gsub(/^\.\//, '')}" if options[:verbose]
90
+ $stdout.puts "Using #{file.gsub(/^\.\//, '')}" if options.verbose?
81
91
  end
82
92
 
83
93
  File.open(options[:output], 'w', 0600) do |ssh_config|
@@ -104,7 +114,7 @@ class PoetCLI < Thor
104
114
  desc "ls", "List all configuration files"
105
115
  option :tree, aliases: '-t', type: :boolean, desc: 'Print tree of config dir'
106
116
  def ls
107
- if options[:tree]
117
+ if options.tree?
108
118
  print_tree(options[:dir])
109
119
  else
110
120
  files = Dir["#{options[:dir]}/**/*"].sort.reject { |file| File.directory?(file) }
@@ -1,3 +1,3 @@
1
1
  module Poet
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8"
3
3
  end
metadata CHANGED
@@ -1,69 +1,78 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: '0.8'
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - André Wendt
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-08-23 00:00:00.000000000 Z
12
+ date: 2013-08-28 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: cucumber
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: aruba
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rake
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: thor
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  description: Split your longish ~/.ssh/config into files in ~/.ssh/config.d/ and let
@@ -83,6 +92,7 @@ files:
83
92
  - README.md
84
93
  - Rakefile
85
94
  - bin/poet
95
+ - completion/poet.bash
86
96
  - editors/double_space.rb
87
97
  - features/bootstrapping.feature
88
98
  - features/editing_files.feature
@@ -100,26 +110,33 @@ files:
100
110
  homepage: https://github.com/awendt/poet
101
111
  licenses:
102
112
  - MIT
103
- metadata: {}
104
113
  post_install_message:
105
114
  rdoc_options: []
106
115
  require_paths:
107
116
  - lib
108
117
  required_ruby_version: !ruby/object:Gem::Requirement
118
+ none: false
109
119
  requirements:
110
- - - '>='
120
+ - - ! '>='
111
121
  - !ruby/object:Gem::Version
112
122
  version: '0'
123
+ segments:
124
+ - 0
125
+ hash: -110110406908147421
113
126
  required_rubygems_version: !ruby/object:Gem::Requirement
127
+ none: false
114
128
  requirements:
115
- - - '>='
129
+ - - ! '>='
116
130
  - !ruby/object:Gem::Version
117
131
  version: '0'
132
+ segments:
133
+ - 0
134
+ hash: -110110406908147421
118
135
  requirements: []
119
136
  rubyforge_project: poet
120
- rubygems_version: 2.0.0
137
+ rubygems_version: 1.8.23
121
138
  signing_key:
122
- specification_version: 4
139
+ specification_version: 3
123
140
  summary: Poet concatenates stanzas
124
141
  test_files:
125
142
  - editors/double_space.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 3e9c7d6033cc5a5e76f1515765103d29c2a9d2dc
4
- data.tar.gz: ee8dfc72f709de180e6ac844b18fa76a2a3a6a1c
5
- SHA512:
6
- metadata.gz: bffba7795d49333412d993c24a669d1578702752ef35753f5d9c618ae2154ae35c4a2a477c534a245a0aef9226c9424c92a8963e90408234b478f354885852c2
7
- data.tar.gz: c924a9035b865f369f4842dc23f2348b9e712e95f03923ad3c7ed8fba5b838fd5855d39847d7ad92b1768cad6d1af9353e3f2e2a792b89b188e611ca24308cee