dewiring 0.1.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.
Files changed (44) hide show
  1. checksums.yaml +15 -0
  2. data/bin/wire +7 -0
  3. data/bin/wire-network-container.sh +547 -0
  4. data/lib/test_fig.rb +46 -0
  5. data/lib/wire/cli/cli_commands.rb +88 -0
  6. data/lib/wire/cli/main_cli.rb +129 -0
  7. data/lib/wire/cli.rb +8 -0
  8. data/lib/wire/commands/base_command.rb +139 -0
  9. data/lib/wire/commands/down_command.rb +69 -0
  10. data/lib/wire/commands/down_command_handler.rb +199 -0
  11. data/lib/wire/commands/init_command.rb +89 -0
  12. data/lib/wire/commands/init_interactive.rb +75 -0
  13. data/lib/wire/commands/spec_command.rb +240 -0
  14. data/lib/wire/commands/spec_templates.rb +134 -0
  15. data/lib/wire/commands/up_command.rb +69 -0
  16. data/lib/wire/commands/up_command_handler.rb +193 -0
  17. data/lib/wire/commands/updown_command_base.rb +80 -0
  18. data/lib/wire/commands/validate_command.rb +64 -0
  19. data/lib/wire/commands/verify_command.rb +196 -0
  20. data/lib/wire/commands/verify_command_handler.rb +134 -0
  21. data/lib/wire/commands.rb +19 -0
  22. data/lib/wire/common.rb +42 -0
  23. data/lib/wire/execution/local_exec.rb +110 -0
  24. data/lib/wire/execution.rb +7 -0
  25. data/lib/wire/model/appgroup_validation.rb +45 -0
  26. data/lib/wire/model/loader.rb +49 -0
  27. data/lib/wire/model/network_validation.rb +111 -0
  28. data/lib/wire/model/project.rb +64 -0
  29. data/lib/wire/model/state.rb +154 -0
  30. data/lib/wire/model/validation.rb +66 -0
  31. data/lib/wire/model/verification.rb +37 -0
  32. data/lib/wire/model.rb +13 -0
  33. data/lib/wire/resource/bridge.rb +76 -0
  34. data/lib/wire/resource/dhcp_range_config.rb +135 -0
  35. data/lib/wire/resource/fig_adapter.rb +127 -0
  36. data/lib/wire/resource/ip_binary.rb +141 -0
  37. data/lib/wire/resource/ipaddr_ext.rb +38 -0
  38. data/lib/wire/resource/ipaddr_on_intf.rb +108 -0
  39. data/lib/wire/resource/network_injection.rb +138 -0
  40. data/lib/wire/resource/resource.rb +52 -0
  41. data/lib/wire/resource.rb +14 -0
  42. data/lib/wire/version.rb +14 -0
  43. data/lib/wire.rb +24 -0
  44. metadata +117 -0
@@ -0,0 +1,52 @@
1
+ # encoding: utf-8
2
+
3
+ # The MIT License (MIT)
4
+ # Copyright (c) 2014 Andreas Schmidt, andreas@de-wiring.net
5
+ #
6
+
7
+ # Wire module
8
+ module Wire
9
+ # Resource module
10
+ module Resource
11
+ # ResourceBase is the base class for all
12
+ # resource elements
13
+ class ResourceBase
14
+ # +name+ of the resource
15
+ attr_accessor :name
16
+
17
+ # initializes base with given +name+
18
+ def initialize(name)
19
+ @name = name
20
+ end
21
+
22
+ # returns string representation
23
+ def to_s
24
+ "Resource:[#{name}]"
25
+ end
26
+ end
27
+
28
+ # ResourceFactory creates Resource objects
29
+ # given by name
30
+ class ResourceFactory
31
+ include Singleton
32
+
33
+ # given a +resource_name+ as a symbol (i.e. :ovsbridge)
34
+ # this creates a resource with given name (i.e. "testbridge")
35
+ # and hands on arguments (+resource_nameargs+, may be 1..n)
36
+ # returns
37
+ # - a new Resource object, depending on type
38
+ def create(resource_symname, *resource_nameargs)
39
+ clazz_map = {
40
+ :ovsbridge => OVSBridge,
41
+ :bridgeip => IPAddressOnIntf,
42
+ :dhcpconfig => DHCPRangeConfiguration,
43
+ :figadapter => FigAdapter,
44
+ :networkinjection => NetworkInjection
45
+ }
46
+ clazz = clazz_map[resource_symname]
47
+ fail(ArgumentError, "Unknown resource type #{resource_symname}") unless clazz
48
+ clazz.new(*resource_nameargs)
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ # The MIT License (MIT)
4
+ # Copyright (c) 2014 Andreas Schmidt, andreas@de-wiring.net
5
+ #
6
+
7
+ require_relative 'resource/resource'
8
+ require_relative 'resource/bridge'
9
+ require_relative 'resource/ipaddr_on_intf'
10
+ require_relative 'resource/ip_binary'
11
+ require_relative 'resource/ipaddr_ext'
12
+ require_relative 'resource/dhcp_range_config'
13
+ require_relative 'resource/fig_adapter'
14
+ require_relative 'resource/network_injection'
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ # The MIT License (MIT)
4
+ # Copyright (c) 2014 Andreas Schmidt, andreas@de-wiring.net
5
+ #
6
+
7
+ # Wire module
8
+ module Wire
9
+ # Wire Version information
10
+ module WireVersion
11
+ # current version
12
+ VERSION = '0.1.2'
13
+ end
14
+ end
data/lib/wire.rb ADDED
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+
3
+ # The MIT License (MIT)
4
+ # Copyright (c) 2014 Andreas Schmidt, andreas@de-wiring.net
5
+ #
6
+
7
+ require 'rubygems'
8
+
9
+ #
10
+ # modules
11
+ #
12
+ require_relative 'wire/common.rb'
13
+ require_relative 'wire/cli.rb'
14
+ require_relative 'wire/commands.rb'
15
+ require_relative 'wire/model.rb'
16
+ require_relative 'wire/execution.rb'
17
+ require_relative 'wire/resource.rb'
18
+
19
+ include Wire
20
+
21
+ #
22
+ # main, drop into cli processing
23
+ #
24
+ WireCLI.start(ARGV)
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dewiring
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Andreas Schmidt
8
+ - Dustin Huptas
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-09-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: 0.19.1
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.19.1
28
+ - !ruby/object:Gem::Dependency
29
+ name: rainbow
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: 2.0.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: 2.0.0
42
+ description: System and Network architecture generator
43
+ email: gem@de-wiring.net
44
+ executables:
45
+ - wire
46
+ - wire-network-container.sh
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - bin/wire
51
+ - bin/wire-network-container.sh
52
+ - lib/test_fig.rb
53
+ - lib/wire.rb
54
+ - lib/wire/cli.rb
55
+ - lib/wire/cli/cli_commands.rb
56
+ - lib/wire/cli/main_cli.rb
57
+ - lib/wire/commands.rb
58
+ - lib/wire/commands/base_command.rb
59
+ - lib/wire/commands/down_command.rb
60
+ - lib/wire/commands/down_command_handler.rb
61
+ - lib/wire/commands/init_command.rb
62
+ - lib/wire/commands/init_interactive.rb
63
+ - lib/wire/commands/spec_command.rb
64
+ - lib/wire/commands/spec_templates.rb
65
+ - lib/wire/commands/up_command.rb
66
+ - lib/wire/commands/up_command_handler.rb
67
+ - lib/wire/commands/updown_command_base.rb
68
+ - lib/wire/commands/validate_command.rb
69
+ - lib/wire/commands/verify_command.rb
70
+ - lib/wire/commands/verify_command_handler.rb
71
+ - lib/wire/common.rb
72
+ - lib/wire/execution.rb
73
+ - lib/wire/execution/local_exec.rb
74
+ - lib/wire/model.rb
75
+ - lib/wire/model/appgroup_validation.rb
76
+ - lib/wire/model/loader.rb
77
+ - lib/wire/model/network_validation.rb
78
+ - lib/wire/model/project.rb
79
+ - lib/wire/model/state.rb
80
+ - lib/wire/model/validation.rb
81
+ - lib/wire/model/verification.rb
82
+ - lib/wire/resource.rb
83
+ - lib/wire/resource/bridge.rb
84
+ - lib/wire/resource/dhcp_range_config.rb
85
+ - lib/wire/resource/fig_adapter.rb
86
+ - lib/wire/resource/ip_binary.rb
87
+ - lib/wire/resource/ipaddr_ext.rb
88
+ - lib/wire/resource/ipaddr_on_intf.rb
89
+ - lib/wire/resource/network_injection.rb
90
+ - lib/wire/resource/resource.rb
91
+ - lib/wire/version.rb
92
+ homepage: https://github.com/de-wiring/wire
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ! '>='
103
+ - !ruby/object:Gem::Version
104
+ version: 1.9.3
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.2.2
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: Wire command line tool
116
+ test_files: []
117
+ has_rdoc: