furnish-ip 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ae2b7f6a9a956d835025a4511039237a3146583
4
- data.tar.gz: 81a04a106c02e6c9cdab500831618d6eb5e9ef50
3
+ metadata.gz: 4f9205647f3d85f7ef4718f39f0e66453ae98aa4
4
+ data.tar.gz: dc5a33d6fc3248b7f7ca1c5f25c85a4316e97372
5
5
  SHA512:
6
- metadata.gz: d01f9db27c11ba7b63d9cb98e0ced564ffd8efb4ffd9ee04aa2ba97e4d661d9dac3da068b0a92c63c741a7347a29c4caa87c93a016c905291de8d8feefbb4e2b
7
- data.tar.gz: 82d29e0d7311b3e9890e6c127e77d7ad2afda8f9f619df264127a174cf8f46e8664b4a7959cda57cbb66aa5ce602d8b3bc168333010b420a196c68d7481c3c3f
6
+ metadata.gz: a22862406aa005d8199ff07319d00a930c84e3410bd94470805120ecbbaed64f9d9b665ee462349118bddb6ac2b6b7a03f2493947ec841d876f47659a9539bed
7
+ data.tar.gz: 8b8bbd22d07e64b2620b1559557b9bf84b03369aa1578815c35501a03ffa4a01c789c7f2b9cbcd3bb79b72c6ff766da0426541514a47f067316794f573982bdb
data/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
- * 0.2.0 (05/1/2013)
1
+ # 0.2.1 (07/6/2013)
2
+ * Move to Minitest 5
3
+ * Convenince functions to find the gateway and network for most ranges, and
4
+ to allocate those addresses.
5
+ # 0.2.0 (05/1/2013)
2
6
  * Most of Furnish::IP was moved to Furnish::RangeSet, which is basically the
3
7
  same thing only without the IP limitation.
4
8
  * Furnish::Port was created, which is quite literally Furnish::RangeSet.
5
9
  * This release is pretty experimental and likely shouldn't be used.
6
- * 0.1.0 (04/10/2013)
10
+
11
+ # 0.1.0 (04/10/2013)
7
12
  * Now supports Furnish 0.1.0, include protocol and property definitions and
8
13
  all Provisioners inherit from Furnish::Provisioner::API. Recovery is still
9
14
  unsupported at this time.
@@ -31,14 +36,17 @@
31
36
  same IPs, resulting in a number of allocated IPs that were less than
32
37
  requested. Testing indicates this problem is resolved, but issues may still
33
38
  arise.
34
- * 0.0.3 (03/25/2013)
39
+
40
+ # 0.0.3 (03/25/2013)
35
41
  * Several fixes around the encoding of IP addresses -- fixes Ruby 2.0.0-p0
36
42
  issues.
37
43
  * Furnish::IP#allocate and Furnish::IP#allocated? exist to assist with direct
38
44
  allocations.
39
45
  * Documentation is generated with RDoc 4
40
46
  * Depend on Furnish 0.0.4
41
- * 0.0.2 (03/20/2013)
47
+
48
+ # 0.0.2 (03/20/2013)
42
49
  * Migration to and exploitation of furnish 0.0.2
43
- * 0.0.1 (03/20/2013)
50
+
51
+ # 0.0.1 (03/20/2013)
44
52
  * Initial release.
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in furnish-ip.gemspec
4
4
  gemspec
5
+
6
+ gem 'furnish', :path => '~/repos/f/furnish'
data/furnish-ip.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["erik+github@hollensbe.org"]
11
11
  gem.description = %q{Generic IP allocator for the Furnish provisioning system}
12
12
  gem.summary = %q{Generic IP allocator for the Furnish provisioning system}
13
- gem.homepage = ""
13
+ gem.homepage = "https://github.com/chef-workflow/furnish-ip"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
  gem.add_dependency 'palsy', '~> 0.0.4'
22
22
 
23
23
  gem.add_development_dependency 'rake'
24
- gem.add_development_dependency 'minitest', '~> 4.7'
24
+ gem.add_development_dependency 'minitest', '~> 5.0'
25
25
  gem.add_development_dependency 'guard-minitest'
26
26
  gem.add_development_dependency 'guard-rake', '~> 0.0.8'
27
27
  gem.add_development_dependency 'rdoc', '~> 4'
data/lib/furnish/ip.rb CHANGED
@@ -49,5 +49,20 @@ module Furnish # :nodoc:
49
49
 
50
50
  unused(name)
51
51
  end
52
+
53
+ def netmask
54
+ # FIXME this is pretty hacky but this is the only way to do it with IPAddr.
55
+ subnet.send(:_to_string, subnet.instance_variable_get(:@mask_addr))
56
+ end
57
+
58
+ def gateway
59
+ allocated.to_a.sort[1]
60
+ end
61
+
62
+ def allocate_network(gateway)
63
+ allocate(range.first.to_s)
64
+ allocate(range.last.to_s)
65
+ allocate(gateway)
66
+ end
52
67
  end
53
68
  end
@@ -2,6 +2,6 @@ require 'furnish/range_set'
2
2
  module Furnish
3
3
  class IP < RangeSet
4
4
  # Version for furnish-ip
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  require 'helper'
2
2
 
3
- class TestAutoIPProvisioner < Furnish::RunningSchedulerTestCase
3
+ class TestAutoIPProvisioner < Furnish::RunningSchedulerTest
4
4
  def setup
5
5
  super
6
6
  @klass = Furnish::Provisioner::AutoIP
data/test/test_ip_lib.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'helper'
2
2
 
3
- class TestIPLib < Furnish::TestCase
3
+ class TestIPLib < Furnish::Test
4
4
  def test_constructor
5
5
  ip = Furnish::IP.new("127.0.0.1/24")
6
6
  assert_equal("default", ip.name, "default name is 'default'")
@@ -33,7 +33,7 @@ class IPReturningProvisioner < Furnish::Provisioner::API
33
33
  end
34
34
  end
35
35
 
36
- class TestIPProvisioner < Furnish::RunningSchedulerTestCase
36
+ class TestIPProvisioner < Furnish::RunningSchedulerTest
37
37
  def setup
38
38
  super
39
39
  @klass = Furnish::Provisioner::IP
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: furnish-ip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Hollensbe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-01 00:00:00.000000000 Z
11
+ date: 2013-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: furnish
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '4.7'
61
+ version: '5.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: '4.7'
68
+ version: '5.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-minitest
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -161,7 +161,7 @@ files:
161
161
  - test/test_auto_ip_provisioner.rb
162
162
  - test/test_ip_lib.rb
163
163
  - test/test_ip_provisioner.rb
164
- homepage: ''
164
+ homepage: https://github.com/chef-workflow/furnish-ip
165
165
  licenses: []
166
166
  metadata: {}
167
167
  post_install_message: