fry-cook 0.2.0 → 0.3.0

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/README.md CHANGED
@@ -133,3 +133,25 @@ you can add it to your Vagrantfile as follows:
133
133
  This really needs more testing infrastructure (or any at all). It also needs
134
134
  a command to rebuild the repo without restarting the server, which is not
135
135
  terribly difficult.
136
+
137
+ ### Contributing
138
+
139
+ To audition changes made within your fork:
140
+
141
+ 1. Update lib/fry-cook/version.rb
142
+ 2. `gem build fry-cook.gemspec` then `vagrant plugin install fry-cook-NN.NN.gem`
143
+ 3. `vagrant provision`
144
+
145
+ ### Debugging and Troubleshooting
146
+
147
+ If you're having issues provisioning using Vagrant you may be inclined to help troubleshoot.
148
+
149
+ First, consider using `VAGRANT_LOG=debug` to get more detailed output from Vagrant itself.
150
+
151
+ If you've identified a particular chef-zero (the underlying http-based app)
152
+ request, you can save yourself having to reprovision every time you do a debug
153
+ cycle. Run fry-cook (via the Vagrant plugin) directly with:
154
+
155
+ bundle exec fry-cook --host <host-ip-address> --path <path-to-chef-repository> --storage-path <path-to-chef-repository>/.vagrant/fry-cook/default
156
+
157
+ You can then hit <host-ip-address> with `curl` to issue http requests.
@@ -9,12 +9,21 @@ module FryCook
9
9
  def self.config_attrs
10
10
  @config_attrs || {}
11
11
  end
12
+ def self.host_ip_address
13
+ # This gets the first ip address in a private range. With virtualbox,
14
+ # at least, things seem to be routed so that the vm can connect to this
15
+ # IP even if it has nothing to do with vagrant or virtualbox. This may not
16
+ # be an entirely safe assumption, but vagrant doesn't provide any kind of
17
+ # better way to obtain a canonical reachable address as far as I can tell.
18
+ Socket.ip_address_list.detect{|intf| intf.ipv4_private?}.ip_address
19
+ end
12
20
 
13
21
  config_attr :repo_path
14
22
  config_attr :repo_git_remote
15
23
  config_attr :repo_git_track, "master"
16
24
  config_attr :prefix, "default"
17
25
  config_attr :server_port, 18998
26
+ config_attr :server_host, host_ip_address
18
27
 
19
28
  def initialize()
20
29
  self.class.config_attrs.each do |config_attr, default|
@@ -33,6 +42,7 @@ module FryCook
33
42
  end
34
43
  {}
35
44
  end
45
+
36
46
  end
37
47
  end
38
48
  end
@@ -22,15 +22,6 @@ module FryCook::VagrantPlugin::Hooks
22
22
  client_config.any? && config.repo_path || config.repo_git_remote
23
23
  end
24
24
 
25
- def host_ip_address
26
- # This gets the first ip address in a private range. With virtualbox,
27
- # at least, things seem to be routed so that the vm can connect to this
28
- # IP even if it has nothing to do with vagrant or virtualbox. This may not
29
- # be an entirely safe assumption, but vagrant doesn't provide any kind of
30
- # better way to obtain a canonical reachable address as far as I can tell.
31
- Socket.ip_address_list.detect{|intf| intf.ipv4_private?}.ip_address
32
- end
33
-
34
25
  def call(env)
35
26
  @env = env
36
27
  if active?
@@ -59,7 +50,7 @@ module FryCook::VagrantPlugin::Hooks
59
50
  fake_key = get_fake_key_path
60
51
 
61
52
  if !client.config.instance_variable_get(:"@chef_server_url")
62
- client.config.instance_variable_set(:"@chef_server_url", "http://#{host_ip_address}:#{config.server_port}/")
53
+ client.config.instance_variable_set(:"@chef_server_url", "http://#{config.server_host}:#{config.server_port}/")
63
54
  end
64
55
  if !client.config.instance_variable_get(:@validation_key_path)
65
56
  client.config.instance_variable_set(:@validation_key_path, fake_key)
@@ -75,9 +66,8 @@ module FryCook::VagrantPlugin::Hooks
75
66
  # parallel at the moment at any rate.
76
67
  if !defined? @@running
77
68
  server_options = {
78
- host: host_ip_address,
69
+ host: config.server_host,
79
70
  port: config.server_port,
80
- daemon: false,
81
71
  }
82
72
  fry_options = {
83
73
  storage_path: ".vagrant/fry-cook/#{config.prefix}",
@@ -1,3 +1,3 @@
1
1
  module FryCook
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,168 +1,151 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: fry-cook
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Graham Batty
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2014-03-20 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2014-05-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: chef
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 21
29
- segments:
30
- - 11
31
- version: "11"
20
+ - !ruby/object:Gem::Version
21
+ version: '11'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: chef-zero
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '11'
30
+ - !ruby/object:Gem::Dependency
31
+ name: chef-zero
32
+ requirement: !ruby/object:Gem::Requirement
38
33
  none: false
39
- requirements:
34
+ requirements:
40
35
  - - ~>
41
- - !ruby/object:Gem::Version
42
- hash: 1
43
- segments:
44
- - 1
45
- - 7
46
- version: "1.7"
36
+ - !ruby/object:Gem::Version
37
+ version: '2.0'
47
38
  type: :runtime
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: berkshelf
51
39
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2.0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: berkshelf
48
+ requirement: !ruby/object:Gem::Requirement
53
49
  none: false
54
- requirements:
55
- - - "="
56
- - !ruby/object:Gem::Version
57
- hash: -2129392858
58
- segments:
59
- - 3
60
- - 0
61
- - 0
62
- - beta
63
- - 7
64
- version: 3.0.0.beta7
50
+ requirements:
51
+ - - '='
52
+ - !ruby/object:Gem::Version
53
+ version: 3.0.1
65
54
  type: :runtime
66
- version_requirements: *id003
67
- - !ruby/object:Gem::Dependency
68
- name: rspec-core
69
55
  prerelease: false
70
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.1
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec-core
64
+ requirement: !ruby/object:Gem::Requirement
71
65
  none: false
72
- requirements:
66
+ requirements:
73
67
  - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 59
76
- segments:
77
- - 2
78
- - 13
79
- - 0
68
+ - !ruby/object:Gem::Version
80
69
  version: 2.13.0
81
70
  type: :development
82
- version_requirements: *id004
83
- - !ruby/object:Gem::Dependency
84
- name: rspec-expectations
85
71
  prerelease: false
86
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 2.13.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec-expectations
80
+ requirement: !ruby/object:Gem::Requirement
87
81
  none: false
88
- requirements:
82
+ requirements:
89
83
  - - ~>
90
- - !ruby/object:Gem::Version
91
- hash: 59
92
- segments:
93
- - 2
94
- - 13
95
- - 0
84
+ - !ruby/object:Gem::Version
96
85
  version: 2.13.0
97
86
  type: :development
98
- version_requirements: *id005
99
- - !ruby/object:Gem::Dependency
100
- name: rspec-mocks
101
87
  prerelease: false
102
- requirement: &id006 !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.13.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: rspec-mocks
96
+ requirement: !ruby/object:Gem::Requirement
103
97
  none: false
104
- requirements:
98
+ requirements:
105
99
  - - ~>
106
- - !ruby/object:Gem::Version
107
- hash: 59
108
- segments:
109
- - 2
110
- - 13
111
- - 0
100
+ - !ruby/object:Gem::Version
112
101
  version: 2.13.0
113
102
  type: :development
114
- version_requirements: *id006
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 2.13.0
115
110
  description: Not quite a chef yet, the fry cook knows only one menu.
116
111
  email: graham@stormbrew.ca
117
- executables:
112
+ executables:
118
113
  - fry-cook
119
114
  extensions: []
120
-
121
115
  extra_rdoc_files: []
122
-
123
- files:
116
+ files:
124
117
  - bin/fry-cook
125
- - lib/fry_cook/version.rb
126
- - lib/fry_cook/vagrant_plugin/hooks.rb
118
+ - lib/fry-cook.rb
127
119
  - lib/fry_cook/vagrant_plugin/config.rb
120
+ - lib/fry_cook/vagrant_plugin/hooks.rb
128
121
  - lib/fry_cook/work_tree.rb
129
122
  - lib/fry_cook/server.rb
123
+ - lib/fry_cook/version.rb
130
124
  - lib/fry_cook/vagrant_plugin.rb
131
- - lib/fry-cook.rb
132
125
  - LICENSE
133
126
  - README.md
134
127
  homepage: https://www.github.com/stormbrew/fry-cook
135
128
  licenses: []
136
-
137
129
  post_install_message:
138
130
  rdoc_options: []
139
-
140
- require_paths:
131
+ require_paths:
141
132
  - lib
142
- required_ruby_version: !ruby/object:Gem::Requirement
133
+ required_ruby_version: !ruby/object:Gem::Requirement
143
134
  none: false
144
- requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- hash: 3
148
- segments:
149
- - 0
150
- version: "0"
151
- required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
140
  none: false
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- hash: 3
157
- segments:
158
- - 0
159
- version: "0"
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
160
145
  requirements: []
161
-
162
146
  rubyforge_project:
163
- rubygems_version: 1.8.24
147
+ rubygems_version: 1.8.23
164
148
  signing_key:
165
149
  specification_version: 3
166
150
  summary: Not quite a chef yet, the fry cook knows only one menu.
167
151
  test_files: []
168
-