freighthop 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Vagrantfile CHANGED
@@ -32,16 +32,20 @@ Vagrant.configure('2') do |config|
32
32
  end
33
33
 
34
34
  node_config.vm.synced_folder(
35
- Freighthop.host_rails_root,
36
- Freighthop.guest_rails_root,
35
+ Freighthop.host_root,
36
+ Freighthop.guest_root,
37
37
  nfs: true
38
38
  )
39
39
 
40
+ Freighthop.mounts.each do |host, guest|
41
+ node_config.vm.synced_folder(host, guest, nfs: true)
42
+ end
43
+
40
44
  node_config.vm.provision :shell, path: 'init/bootstrap_puppet_omnibus.sh'
41
45
 
42
46
  node_config.vm.provision :shell do |s|
43
47
  s.path = 'init/symlinks_for_hiera.sh'
44
- s.args = Freighthop.guest_rails_root
48
+ s.args = Freighthop.guest_root.to_s
45
49
  end
46
50
 
47
51
  puppet_options = [].tap do |options|
data/freighthop.gemspec CHANGED
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency 'puppet'
26
26
  spec.add_development_dependency 'librarian-puppet'
27
+ spec.add_development_dependency 'json'
27
28
  end
@@ -0,0 +1,13 @@
1
+ class Freighthop::Config
2
+ def self.file
3
+ Freighthop.root.join('.freighthop.json')
4
+ end
5
+
6
+ def self.config
7
+ @config = JSON.parse(file.read)
8
+ end
9
+
10
+ def self.fetch(key)
11
+ config[key]
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Freighthop
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/freighthop.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'pathname'
2
2
  require_relative 'freighthop/version'
3
+ require_relative 'freighthop/config'
3
4
 
4
5
  unless defined? Vagrant
5
6
  raise "i expect to be required from a Vagrantfile"
@@ -11,18 +12,12 @@ module Freighthop
11
12
  !!(defined? HashiCorp)
12
13
  end
13
14
 
14
- def host_rails_root
15
- @rails_root ||= begin
16
- Pathname.pwd.tap do |pwd|
17
- unless pwd.join('config', 'boot.rb').file?
18
- raise 'run me with a rails app as PWD, using VAGRANT_CWD to refer to my directory'
19
- end
20
- end
21
- end
15
+ def host_root
16
+ Pathname.pwd
22
17
  end
23
18
 
24
- def guest_rails_root
25
- "/srv/#{app_name}"
19
+ def guest_root
20
+ Pathname("/srv/#{app_name}")
26
21
  end
27
22
 
28
23
  def app_name
@@ -44,6 +39,15 @@ module Freighthop
44
39
  'http://files.vagrantup.com/precise64.box'
45
40
  end
46
41
  end
42
+
43
+ def mounts
44
+ Freighthop::Config.fetch("freighthop::mounts").map do |host, guest|
45
+ [
46
+ File.expand_path(host_rails_root.join(host)),
47
+ File.expand_path(guest_rails_root.join(guest)),
48
+ ]
49
+ end
50
+ end
47
51
  end
48
52
  end
49
53
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freighthop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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: 2013-09-23 00:00:00.000000000 Z
12
+ date: 2013-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -91,6 +91,22 @@ dependencies:
91
91
  - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: json
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
94
110
  description: ! 'Vagrant on Rails: quickly spin up a Vagrant VM to serve your rack-compatible
95
111
  app.'
96
112
  email:
@@ -116,6 +132,7 @@ files:
116
132
  - init/bootstrap_puppet_omnibus.sh
117
133
  - init/symlinks_for_hiera.sh
118
134
  - lib/freighthop.rb
135
+ - lib/freighthop/config.rb
119
136
  - lib/freighthop/version.rb
120
137
  - local_modules/freighthop/files/bundler/freighthop.gemfile
121
138
  - local_modules/freighthop/manifests/bundler.pp
@@ -639,7 +656,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
639
656
  version: '0'
640
657
  segments:
641
658
  - 0
642
- hash: 4257660574366765380
659
+ hash: 3310240632279879997
643
660
  required_rubygems_version: !ruby/object:Gem::Requirement
644
661
  none: false
645
662
  requirements:
@@ -648,7 +665,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
648
665
  version: '0'
649
666
  segments:
650
667
  - 0
651
- hash: 4257660574366765380
668
+ hash: 3310240632279879997
652
669
  requirements: []
653
670
  rubyforge_project:
654
671
  rubygems_version: 1.8.23