pauper 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/pauper.rb +19 -3
  2. metadata +25 -35
  3. checksums.yaml +0 -7
@@ -29,11 +29,10 @@ class Pauper
29
29
 
30
30
  def bootstrap
31
31
  raise "Base already exists!" if vm_exists?("base")
32
- username = ENV['USER']
33
- key = @pauper_config.config[:bootstrap_ssh_key] || "/home/#{username}/.ssh/id_rsa"
32
+
34
33
  lxc_pauper_template
35
34
  system("sudo touch /var/lib/lxc/lxc.conf")
36
- system("sudo lxc-create -n base -t pauper -f /var/lib/lxc/lxc.conf -- -a amd64 --auth-key #{key + '.pub'} -r lucid")
35
+ system("sudo lxc-create -n base -t pauper -f /var/lib/lxc/lxc.conf -- -a amd64 --auth-key #{public_ssh_key + '.pub'} -r lucid")
37
36
  mac = generate_mac
38
37
  ip = "#{@pauper_config.config[:subnet]}.2"
39
38
 
@@ -57,6 +56,23 @@ class Pauper
57
56
 
58
57
  stop_node('base')
59
58
  end
59
+
60
+ def username
61
+ ENV['USER']
62
+ end
63
+
64
+ def ssh_key
65
+ @ssh_key ||= begin
66
+ key = @pauper_config.config[:bootstrap_ssh_key] || "/home/#{username}/.ssh/id_rsa"
67
+ raise "The private SSH key set in your Pauperfile does not exist." unless File.exist?(key)
68
+ raise "The public SSH key set in your Pauperfile does not exist." unless File.exist?("#{key}.pub")
69
+ key
70
+ end
71
+ end
72
+
73
+ def public_ssh_key
74
+ ssh_key + ".pub"
75
+ end
60
76
 
61
77
  def prepare_fstab(node_name)
62
78
  File.open('.tmp.fstab','w') do |f|
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pauper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Tyler McMullen
@@ -9,64 +10,52 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-08-22 00:00:00.000000000 Z
13
+ date: 2013-10-20 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: thor
16
- requirement: !ruby/object:Gem::Requirement
17
+ requirement: &11417720 !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - '>='
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: '0'
21
23
  type: :runtime
22
24
  prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - '>='
26
- - !ruby/object:Gem::Version
27
- version: '0'
25
+ version_requirements: *11417720
28
26
  - !ruby/object:Gem::Dependency
29
27
  name: net-ssh
30
- requirement: !ruby/object:Gem::Requirement
28
+ requirement: &11417020 !ruby/object:Gem::Requirement
29
+ none: false
31
30
  requirements:
32
- - - '>='
31
+ - - ! '>='
33
32
  - !ruby/object:Gem::Version
34
33
  version: '0'
35
34
  type: :runtime
36
35
  prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - '>='
40
- - !ruby/object:Gem::Version
41
- version: '0'
36
+ version_requirements: *11417020
42
37
  - !ruby/object:Gem::Dependency
43
38
  name: net-scp
44
- requirement: !ruby/object:Gem::Requirement
39
+ requirement: &11416020 !ruby/object:Gem::Requirement
40
+ none: false
45
41
  requirements:
46
- - - '>='
42
+ - - ! '>='
47
43
  - !ruby/object:Gem::Version
48
44
  version: '0'
49
45
  type: :runtime
50
46
  prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
47
+ version_requirements: *11416020
56
48
  - !ruby/object:Gem::Dependency
57
49
  name: json
58
- requirement: !ruby/object:Gem::Requirement
50
+ requirement: &11415420 !ruby/object:Gem::Requirement
51
+ none: false
59
52
  requirements:
60
- - - '>='
53
+ - - ! '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  type: :runtime
64
57
  prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
58
+ version_requirements: *11415420
70
59
  description: Inspired by Vagrant but much much simpler. Also uses LXC, instead of
71
60
  Virtualbox.
72
61
  email:
@@ -86,25 +75,26 @@ files:
86
75
  - README
87
76
  homepage: http://github.com/fastly/Pauper
88
77
  licenses: []
89
- metadata: {}
90
78
  post_install_message:
91
79
  rdoc_options: []
92
80
  require_paths:
93
81
  - lib
94
82
  required_ruby_version: !ruby/object:Gem::Requirement
83
+ none: false
95
84
  requirements:
96
- - - '>='
85
+ - - ! '>='
97
86
  - !ruby/object:Gem::Version
98
87
  version: '0'
99
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
+ none: false
100
90
  requirements:
101
- - - '>='
91
+ - - ! '>='
102
92
  - !ruby/object:Gem::Version
103
93
  version: '0'
104
94
  requirements: []
105
95
  rubyforge_project:
106
- rubygems_version: 2.0.3
96
+ rubygems_version: 1.8.11
107
97
  signing_key:
108
- specification_version: 4
98
+ specification_version: 3
109
99
  summary: A semi-sane way to manage a multi-vm dev environment
110
100
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: f8356da072ef8d6d157997db71e4c91d012240c7
4
- data.tar.gz: 3920086c83052bcaa4514ccd6efeee4d16fcd780
5
- SHA512:
6
- metadata.gz: 7ef13a7d884712dcbc220f91503fa952b970c36806c81976efc149f2c28712595be00aa02327b9dc536ffd101d7f9e1649e1e34baa7e77627f921382ff145ddd
7
- data.tar.gz: e848f1e9fe8ff39ac22bde190a85c0c6fc79b45b3760e64f5bb0dd4ac8303367f033eb213f9ffaa66d44693e33a8a13389bd8f7cac9b8dbd673427bccee5d606