specinfra 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,9 +5,9 @@ module SpecInfra
5
5
  module #{backend}
6
6
  def backend(commands_object=nil)
7
7
  if ! respond_to?(:commands)
8
- commands_object = self.class.const_get(SPEC_TYPE).const_get('Commands').const_get('Base').new
8
+ commands_object = SpecInfra::Command::Base.new
9
9
  end
10
- instance = self.class.const_get('SpecInfra').const_get('Backend').const_get('#{backend}').instance
10
+ instance = SpecInfra::Backend::#{backend}.instance
11
11
  instance.set_commands(commands_object || commands)
12
12
  instance
13
13
  end
@@ -18,9 +18,9 @@ module SpecInfra
18
18
  module Backend
19
19
  def backend_for(type)
20
20
  if ! respond_to?(:commands)
21
- commands_object = self.class.const_get(SPEC_TYPE).const_get('Commands').const_get('Base').new
21
+ commands_object = SpecInfra::Command::Base.new
22
22
  end
23
- instance = self.class.const_get('SpecInfra').const_get('Backend').const_get("#{type.to_s.capitalize}").instance
23
+ instance = self.class.const_get('SpecInfra').const_get('Backend').const_get(type.to_s.capitalize).instance
24
24
  instance.set_commands(commands_object || commands)
25
25
  instance
26
26
  end
@@ -8,10 +8,10 @@ module SpecInfra
8
8
  if property[:os_by_host][host]
9
9
  os = property[:os_by_host][host]
10
10
  else
11
- os = backend(self.class.const_get(SPEC_TYPE).const_get('Commands').const_get('Base')).check_os
11
+ os = backend(SpecInfra::Command::Base).check_os
12
12
  property[:os_by_host][host] = os
13
13
  end
14
- self.class.const_get(SPEC_TYPE).const_get('Commands').const_get(os[:family]).new
14
+ self.class.const_get('SpecInfra').const_get('Command').const_get(os[:family]).new
15
15
  end
16
16
  end
17
17
  end
@@ -18,7 +18,7 @@ module SpecInfra
18
18
  eval <<-EOF
19
19
  module #{os}
20
20
  def commands
21
- self.class.const_get(SPEC_TYPE).const_get('Commands').const_get('#{os}').new
21
+ SpecInfra::Command::#{os}.new
22
22
  end
23
23
  end
24
24
  EOF
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,13 +1,3 @@
1
1
  require 'specinfra'
2
2
 
3
3
  include SpecInfra::Helper::Exec
4
-
5
- SPEC_TYPE = 'SpecInfra'
6
-
7
- module SpecInfra
8
- module Commands
9
- class Base
10
- # dummy class for test
11
- end
12
- end
13
- end
metadata CHANGED
@@ -1,64 +1,76 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.5
3
+ version: !ruby/object:Gem::Version
4
+ hash: 19
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 6
10
+ version: 0.0.6
5
11
  platform: ruby
6
- authors:
12
+ authors:
7
13
  - Gosuke Miyashita
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2013-12-04 00:00:00 +09:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
14
22
  name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :development
21
23
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
24
27
  - - ~>
25
- - !ruby/object:Gem::Version
26
- version: '1.3'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
28
+ - !ruby/object:Gem::Version
29
+ hash: 9
30
+ segments:
31
+ - 1
32
+ - 3
33
+ version: "1.3"
34
34
  type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
35
38
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
48
  type: :development
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: rspec
49
52
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
61
+ version: "0"
62
+ type: :development
63
+ version_requirements: *id003
55
64
  description: Common layer for serverspec and configspec
56
- email:
65
+ email:
57
66
  - gosukenator@gmail.com
58
67
  executables: []
68
+
59
69
  extensions: []
70
+
60
71
  extra_rdoc_files: []
61
- files:
72
+
73
+ files:
62
74
  - .gitignore
63
75
  - .travis.yml
64
76
  - Gemfile
@@ -83,6 +95,21 @@ files:
83
95
  - lib/specinfra/backend/shellscript.rb
84
96
  - lib/specinfra/backend/ssh.rb
85
97
  - lib/specinfra/backend/winrm.rb
98
+ - lib/specinfra/command.rb
99
+ - lib/specinfra/command/aix.rb
100
+ - lib/specinfra/command/base.rb
101
+ - lib/specinfra/command/darwin.rb
102
+ - lib/specinfra/command/debian.rb
103
+ - lib/specinfra/command/freebsd.rb
104
+ - lib/specinfra/command/gentoo.rb
105
+ - lib/specinfra/command/linux.rb
106
+ - lib/specinfra/command/plamo.rb
107
+ - lib/specinfra/command/redhat.rb
108
+ - lib/specinfra/command/smartos.rb
109
+ - lib/specinfra/command/solaris.rb
110
+ - lib/specinfra/command/solaris10.rb
111
+ - lib/specinfra/command/solaris11.rb
112
+ - lib/specinfra/command/windows.rb
86
113
  - lib/specinfra/configuration.rb
87
114
  - lib/specinfra/helper.rb
88
115
  - lib/specinfra/helper/backend.rb
@@ -97,31 +124,41 @@ files:
97
124
  - spec/helper/properties_spec.rb
98
125
  - spec/spec_helper.rb
99
126
  - specinfra.gemspec
100
- homepage: ''
101
- licenses:
127
+ has_rdoc: true
128
+ homepage: ""
129
+ licenses:
102
130
  - MIT
103
- metadata: {}
104
131
  post_install_message:
105
132
  rdoc_options: []
106
- require_paths:
133
+
134
+ require_paths:
107
135
  - lib
108
- required_ruby_version: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - '>='
111
- - !ruby/object:Gem::Version
112
- version: '0'
113
- required_rubygems_version: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
136
+ required_ruby_version: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
144
+ version: "0"
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ hash: 3
151
+ segments:
152
+ - 0
153
+ version: "0"
118
154
  requirements: []
155
+
119
156
  rubyforge_project:
120
- rubygems_version: 2.0.3
157
+ rubygems_version: 1.6.2
121
158
  signing_key:
122
- specification_version: 4
159
+ specification_version: 3
123
160
  summary: Common layer for serverspec and configspec
124
- test_files:
161
+ test_files:
125
162
  - spec/configurtaion_spec.rb
126
163
  - spec/helper/backend_spec.rb
127
164
  - spec/helper/properties_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: edbba5bc30cf23808d8e828ac95c1f398526df6f
4
- data.tar.gz: a669a05b82327a45f7b61651b83cf9c7b2c43046
5
- SHA512:
6
- metadata.gz: 3bbb954c0da945b9299b7bb058c62913c469cc57a3217153c0fddc81583fe9580859810ba425f646c7f21bc052f3428d60429237c334cdc6e457b450768dbfcc
7
- data.tar.gz: a3b0b7dea9ce2e7800b8ba03cb11586508c98f9493f90aecb153baeb162cc97e14d1d99e724950eee11472f8d9c98b5c2bef10b586c76d72bbe842c8b9903077