pupcap 0.3.1 → 0.3.2
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.
- data/lib/pupcap/cli.rb +1 -1
- data/lib/pupcap/version.rb +1 -1
- metadata +2 -6
- data/lib/pupcap/action/apply.rb +0 -13
- data/lib/pupcap/action/init.rb +0 -37
- data/lib/pupcap/action/prepare.rb +0 -40
- data/lib/pupcap/action/ssh.rb +0 -13
data/lib/pupcap/cli.rb
CHANGED
@@ -68,7 +68,7 @@ class Pupcap::CLI < Thor
|
|
68
68
|
|
69
69
|
def self.revert_argv_and_start(argv = ARGV)
|
70
70
|
need_to_revert = %w{ noop apply init prepare ssh }
|
71
|
-
if need_to_revert.include?(argv.last)
|
71
|
+
if need_to_revert.include?(argv.last) && argv.size > 1
|
72
72
|
last = argv.pop
|
73
73
|
argv = [last] + argv
|
74
74
|
end
|
data/lib/pupcap/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pupcap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -89,9 +89,7 @@ files:
|
|
89
89
|
- Rakefile
|
90
90
|
- bin/pupcap
|
91
91
|
- lib/pupcap.rb
|
92
|
-
- lib/pupcap/action/apply.rb
|
93
92
|
- lib/pupcap/action/apply/Capfile
|
94
|
-
- lib/pupcap/action/init.rb
|
95
93
|
- lib/pupcap/action/init/Capfile.tt
|
96
94
|
- lib/pupcap/action/init/Vagrantfile.tt
|
97
95
|
- lib/pupcap/action/init/hiera.yaml
|
@@ -101,9 +99,7 @@ files:
|
|
101
99
|
- lib/pupcap/action/init/modules/.empty_directory
|
102
100
|
- lib/pupcap/action/init/prepare.sh.erb
|
103
101
|
- lib/pupcap/action/init/site-modules/.empty_directory
|
104
|
-
- lib/pupcap/action/prepare.rb
|
105
102
|
- lib/pupcap/action/prepare/Capfile
|
106
|
-
- lib/pupcap/action/ssh.rb
|
107
103
|
- lib/pupcap/action/ssh/Capfile
|
108
104
|
- lib/pupcap/capistrano.rb
|
109
105
|
- lib/pupcap/cli.rb
|
data/lib/pupcap/action/apply.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'pupcap/action'
|
2
|
-
require 'pupcap/command'
|
3
|
-
|
4
|
-
class Pupcap::Action::Apply < Pupcap::Action::Base
|
5
|
-
def initialize
|
6
|
-
check_puppetfile!
|
7
|
-
end
|
8
|
-
|
9
|
-
def start
|
10
|
-
cap = create_cap_for(parsed_options[:file])
|
11
|
-
cap_load_and_run_task(cap, "apply")
|
12
|
-
end
|
13
|
-
end
|
data/lib/pupcap/action/init.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'thor'
|
2
|
-
require 'thor/actions'
|
3
|
-
require 'thor/group'
|
4
|
-
|
5
|
-
require 'pupcap/action'
|
6
|
-
|
7
|
-
class Pupcap::Action::Init < Thor::Group
|
8
|
-
|
9
|
-
include Thor::Actions
|
10
|
-
|
11
|
-
argument :dir, :type => :string, :desc => "The directory"
|
12
|
-
desc "Initializes in the DIR"
|
13
|
-
class_option :ip, :type => :string, :default => "192.168.44.10"
|
14
|
-
|
15
|
-
def create_pupcap_directories
|
16
|
-
directory("action/init", dir)
|
17
|
-
end
|
18
|
-
|
19
|
-
def initialize_librarian_puppet
|
20
|
-
inside(dir) do
|
21
|
-
run("librarian-puppet init")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def inject_into_giignore
|
26
|
-
inside(dir) do
|
27
|
-
append_to_file(".gitignore", ".vagrant\n", :verbose => false)
|
28
|
-
append_to_file(".gitignore", "*.swp\n", :verbose => false)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
def ip
|
34
|
-
options["ip"]
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'thor'
|
2
|
-
require 'thor/actions'
|
3
|
-
require 'thor/group'
|
4
|
-
|
5
|
-
require 'pupcap/action'
|
6
|
-
|
7
|
-
class Pupcap::Action::Prepare < Thor::Group
|
8
|
-
|
9
|
-
include Thor::Actions
|
10
|
-
|
11
|
-
desc "Prepare host"
|
12
|
-
class_option :pupcapfile, :type => :string, :default => -> { File.expand_path("Capfile") }, :aliases => "-f"
|
13
|
-
|
14
|
-
def create_pupcap_directories
|
15
|
-
directory("init", dir)
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize_librarian_puppet
|
19
|
-
inside(dir) do
|
20
|
-
run("librarian-puppet init")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def inject_into_giignore
|
25
|
-
inside(dir) do
|
26
|
-
append_to_file(".gitignore", ".vagrant\n", :verbose => false)
|
27
|
-
append_to_file(".gitignore", "*.swp\n", :verbose => false)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.source_root
|
32
|
-
File.dirname(__FILE__)
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
def ip
|
37
|
-
options["ip"]
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
data/lib/pupcap/action/ssh.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'pupcap/action'
|
2
|
-
require 'pupcap/command'
|
3
|
-
|
4
|
-
class Pupcap::Action::Ssh < Pupcap::Action::Base
|
5
|
-
def initialize
|
6
|
-
check_puppetfile!
|
7
|
-
end
|
8
|
-
|
9
|
-
def start
|
10
|
-
cap = create_cap_for(parsed_options[:file])
|
11
|
-
cap_load_and_run_task(cap, "ssh")
|
12
|
-
end
|
13
|
-
end
|