ronin 1.0.0 → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. data/.yardopts +0 -1
  2. data/ChangeLog.md +67 -3
  3. data/Gemfile +20 -12
  4. data/README.md +3 -5
  5. data/gemspec.yml +5 -5
  6. data/lib/ronin/address.rb +8 -3
  7. data/lib/ronin/arch.rb +39 -14
  8. data/lib/ronin/author.rb +2 -0
  9. data/lib/ronin/auto_load.rb +67 -0
  10. data/lib/ronin/campaign.rb +15 -2
  11. data/lib/ronin/class_methods.rb +7 -1
  12. data/lib/ronin/config.rb +5 -0
  13. data/lib/ronin/credential.rb +14 -3
  14. data/lib/ronin/database/database.rb +38 -12
  15. data/lib/ronin/database/migrations.rb +3 -1
  16. data/lib/ronin/database/migrations/add_created_at_column_to_targets_table.rb +48 -0
  17. data/lib/ronin/database/migrations/add_updated_at_column_to_campaigns_table.rb +47 -0
  18. data/lib/ronin/database/migrations/create_licenses_table.rb +1 -1
  19. data/lib/ronin/database/migrations/create_passwords_table.rb +1 -1
  20. data/lib/ronin/database/migrations/{create_cached_files_table.rb → create_script_paths_table.rb} +4 -4
  21. data/lib/ronin/database/migrations/migration.rb +3 -6
  22. data/lib/ronin/database/migrations/migrations.rb +3 -3
  23. data/lib/ronin/email_address.rb +20 -3
  24. data/lib/ronin/environment.rb +0 -3
  25. data/lib/ronin/host_name.rb +20 -6
  26. data/lib/ronin/host_name_ip_address.rb +2 -3
  27. data/lib/ronin/installation.rb +92 -23
  28. data/lib/ronin/ip_address.rb +31 -8
  29. data/lib/ronin/ip_address_mac_address.rb +2 -3
  30. data/lib/ronin/license.rb +1 -1
  31. data/lib/ronin/mac_address.rb +6 -4
  32. data/lib/ronin/model/class_methods.rb +4 -0
  33. data/lib/ronin/model/has_authors/class_methods.rb +4 -0
  34. data/lib/ronin/model/has_authors/has_authors.rb +4 -0
  35. data/lib/ronin/model/has_description/class_methods.rb +2 -0
  36. data/lib/ronin/model/has_description/has_description.rb +2 -0
  37. data/lib/ronin/model/has_license/class_methods.rb +2 -0
  38. data/lib/ronin/model/has_license/has_license.rb +4 -0
  39. data/lib/ronin/model/has_name/class_methods.rb +2 -0
  40. data/lib/ronin/model/has_name/has_name.rb +4 -0
  41. data/lib/ronin/model/has_title/class_methods.rb +2 -0
  42. data/lib/ronin/model/has_title/has_title.rb +2 -0
  43. data/lib/ronin/model/has_unique_name/class_methods.rb +2 -0
  44. data/lib/ronin/model/has_unique_name/has_unique_name.rb +7 -1
  45. data/lib/ronin/model/has_version/class_methods.rb +4 -0
  46. data/lib/ronin/model/has_version/has_version.rb +2 -0
  47. data/lib/ronin/model/model.rb +2 -0
  48. data/lib/ronin/model/types.rb +1 -7
  49. data/lib/ronin/model/types/description.rb +2 -0
  50. data/lib/ronin/network/mixins/esmtp.rb +40 -25
  51. data/lib/ronin/network/mixins/http.rb +336 -73
  52. data/lib/ronin/network/mixins/imap.rb +38 -25
  53. data/lib/ronin/network/mixins/pop3.rb +34 -21
  54. data/lib/ronin/network/mixins/smtp.rb +40 -25
  55. data/lib/ronin/network/mixins/tcp.rb +66 -41
  56. data/lib/ronin/network/mixins/telnet.rb +43 -30
  57. data/lib/ronin/network/mixins/udp.rb +59 -40
  58. data/lib/ronin/open_port.rb +12 -5
  59. data/lib/ronin/organization.rb +1 -2
  60. data/lib/ronin/os.rb +10 -3
  61. data/lib/ronin/os_guess.rb +2 -3
  62. data/lib/ronin/password.rb +11 -3
  63. data/lib/ronin/port.rb +7 -2
  64. data/lib/ronin/{engine/exceptions/deploy_failed.rb → repositories.rb} +4 -6
  65. data/lib/ronin/repository.rb +110 -37
  66. data/lib/ronin/ronin.rb +4 -3
  67. data/lib/ronin/{engine.rb → script.rb} +2 -1
  68. data/lib/ronin/{engine → script}/buildable.rb +43 -29
  69. data/lib/ronin/script/class_methods.rb +84 -0
  70. data/lib/ronin/{engine → script}/deployable.rb +61 -40
  71. data/lib/ronin/{engine → script}/exceptions.rb +4 -3
  72. data/lib/ronin/script/exceptions/deploy_failed.rb +27 -0
  73. data/lib/ronin/{engine/exceptions/not_built.rb → script/exceptions/exception.rb} +2 -2
  74. data/lib/ronin/{engine/exceptions/verification_failed.rb → script/exceptions/not_built.rb} +4 -2
  75. data/lib/ronin/script/exceptions/test_failed.rb +27 -0
  76. data/lib/ronin/script/instance_methods.rb +217 -0
  77. data/lib/ronin/script/path.rb +277 -0
  78. data/lib/ronin/{engine/engine.rb → script/script.rb} +52 -15
  79. data/lib/ronin/{engine/verifiable.rb → script/testable.rb} +97 -68
  80. data/lib/ronin/service.rb +1 -2
  81. data/lib/ronin/service_credential.rb +1 -2
  82. data/lib/ronin/software.rb +3 -2
  83. data/lib/ronin/spec/database.rb +0 -4
  84. data/lib/ronin/target.rb +11 -3
  85. data/lib/ronin/tcp_port.rb +3 -2
  86. data/lib/ronin/udp_port.rb +2 -0
  87. data/lib/ronin/ui/cli/cli.rb +6 -0
  88. data/lib/ronin/ui/cli/command.rb +48 -12
  89. data/lib/ronin/ui/cli/commands/campaigns.rb +3 -3
  90. data/lib/ronin/ui/cli/commands/console.rb +2 -1
  91. data/lib/ronin/ui/cli/commands/creds.rb +3 -3
  92. data/lib/ronin/ui/cli/commands/database.rb +1 -17
  93. data/lib/ronin/ui/cli/commands/emails.rb +3 -3
  94. data/lib/ronin/ui/cli/commands/hosts.rb +3 -7
  95. data/lib/ronin/ui/cli/commands/ips.rb +3 -7
  96. data/lib/ronin/ui/cli/commands/repos.rb +5 -17
  97. data/lib/ronin/ui/cli/commands/urls.rb +3 -3
  98. data/lib/ronin/ui/cli/model_command.rb +82 -97
  99. data/lib/ronin/ui/cli/resources_command.rb +89 -0
  100. data/lib/ronin/ui/cli/script_command.rb +115 -0
  101. data/lib/ronin/ui/console.rb +17 -3
  102. data/lib/ronin/ui/output/helpers.rb +18 -0
  103. data/lib/ronin/ui/output/output.rb +20 -1
  104. data/lib/ronin/ui/output/terminal/color.rb +10 -0
  105. data/lib/ronin/ui/output/terminal/raw.rb +10 -0
  106. data/lib/ronin/ui/shell.rb +2 -0
  107. data/lib/ronin/url.rb +47 -12
  108. data/lib/ronin/url_query_param.rb +4 -0
  109. data/lib/ronin/url_scheme.rb +3 -3
  110. data/lib/ronin/user_name.rb +2 -0
  111. data/lib/ronin/version.rb +1 -1
  112. data/lib/ronin/web_credential.rb +6 -3
  113. data/spec/arch_spec.rb +3 -3
  114. data/spec/classes/my_script.rb +21 -0
  115. data/spec/helpers/repos/{test1 → installed}/ronin.yml +1 -1
  116. data/spec/helpers/repos/{hello/cache → installed/scripts}/.keep +0 -0
  117. data/spec/helpers/repos/local/lib/init.rb +1 -0
  118. data/spec/helpers/repos/{hello → local}/lib/stuff/another_test.rb +0 -0
  119. data/spec/helpers/repos/{hello → local}/lib/stuff/test.rb +0 -0
  120. data/spec/helpers/repos/{random → local}/ronin.yml +1 -1
  121. data/spec/helpers/repos/{random/cache → local/scripts}/.keep +0 -0
  122. data/spec/helpers/repos/{hello → remote}/ronin.yml +1 -1
  123. data/spec/helpers/repos/remote/scripts/.keep +0 -0
  124. data/spec/helpers/repos/{test2 → scripts}/ronin.yml +0 -0
  125. data/spec/helpers/repos/scripts/scripts/cached/cached.rb +10 -0
  126. data/spec/helpers/repos/scripts/scripts/cached/missing.rb +10 -0
  127. data/spec/helpers/repos/scripts/scripts/cached/modified.rb +10 -0
  128. data/spec/helpers/repos/scripts/scripts/cached/unmodified.rb +10 -0
  129. data/spec/helpers/repos/scripts/scripts/failures/exceptions.rb +11 -0
  130. data/spec/helpers/repos/{test2/cache/cacheable_model → scripts/scripts/failures}/load_errors.rb +3 -1
  131. data/spec/helpers/repos/{test2/cache/cacheable_model → scripts/scripts/failures}/name_errors.rb +1 -0
  132. data/spec/helpers/repos/scripts/scripts/failures/no_method_errors.rb +10 -0
  133. data/spec/helpers/repos/scripts/scripts/failures/syntax_errors.rb +11 -0
  134. data/spec/helpers/repos/scripts/scripts/failures/validation_errors.rb +11 -0
  135. data/spec/helpers/repos/scripts/scripts/my_scripts/test.rb +16 -0
  136. data/spec/model/spec_helper.rb +0 -2
  137. data/spec/repository_spec.rb +61 -81
  138. data/spec/ronin_spec.rb +2 -2
  139. data/spec/{engine → script}/buildable_spec.rb +9 -9
  140. data/spec/script/classes/buildable_class.rb +15 -0
  141. data/spec/script/classes/deployable_class.rb +13 -0
  142. data/spec/{engine/classes/engine_class.rb → script/classes/script_class.rb} +3 -3
  143. data/spec/{engine/classes/verifiable_class.rb → script/classes/testable_class.rb} +5 -5
  144. data/spec/{engine → script}/deployable_spec.rb +10 -10
  145. data/spec/{cached_file_spec.rb → script/path_spec.rb} +33 -72
  146. data/spec/script/script_spec.rb +130 -0
  147. data/spec/script/testable_spec.rb +117 -0
  148. data/spec/spec_helper.rb +15 -13
  149. metadata +114 -139
  150. data/lib/ronin/cached_file.rb +0 -247
  151. data/lib/ronin/engine/class_methods.rb +0 -135
  152. data/lib/ronin/engine/instance_methods.rb +0 -97
  153. data/lib/ronin/model/cacheable.rb +0 -21
  154. data/lib/ronin/model/cacheable/cacheable.rb +0 -273
  155. data/lib/ronin/model/cacheable/class_methods.rb +0 -60
  156. data/lib/ronin/ui/cli/engine_command.rb +0 -106
  157. data/spec/engine/classes/buildable_class.rb +0 -15
  158. data/spec/engine/classes/deployable_class.rb +0 -13
  159. data/spec/engine/engine_spec.rb +0 -55
  160. data/spec/engine/verifiable_spec.rb +0 -117
  161. data/spec/helpers/repos/hello/lib/init.rb +0 -1
  162. data/spec/helpers/repos/test1/cache/cacheable_model/one.rb +0 -15
  163. data/spec/helpers/repos/test2/cache/cacheable_model/exceptions.rb +0 -7
  164. data/spec/helpers/repos/test2/cache/cacheable_model/no_method_errors.rb +0 -9
  165. data/spec/helpers/repos/test2/cache/cacheable_model/syntax_errors.rb +0 -7
  166. data/spec/helpers/repos/test2/cache/cacheable_model/two.rb +0 -15
  167. data/spec/helpers/repos/test2/cache/cacheable_model/validation_errors.rb +0 -9
  168. data/spec/model/cacheable_spec.rb +0 -96
  169. data/spec/model/models/cacheable_model.rb +0 -13
@@ -0,0 +1,10 @@
1
+ require 'classes/my_script'
2
+
3
+ MyScript.objectttttt do
4
+
5
+ cache do
6
+ self.name = 'no_method_error'
7
+ self.content = 'this is a NoMethodError test'
8
+ end
9
+
10
+ end
@@ -0,0 +1,11 @@
1
+ require 'classes/my_script'
2
+
3
+ MyScript.object do
4
+
5
+ def
6
+
7
+ cache do
8
+ self.name = 'syntax_error'
9
+ end
10
+
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'classes/my_script'
2
+
3
+ MyScript.object do
4
+
5
+ cache do
6
+ self.name = 'validation_error'
7
+
8
+ # intentionally do not set the content property
9
+ end
10
+
11
+ end
@@ -0,0 +1,16 @@
1
+ require 'classes/my_script'
2
+
3
+ MyScript.object do
4
+
5
+ @var = 2
6
+
7
+ cache do
8
+ self.name = 'test'
9
+ self.content = 'this is a test'
10
+ end
11
+
12
+ def greeting
13
+ 'hello'
14
+ end
15
+
16
+ end
@@ -1,6 +1,5 @@
1
1
  require 'spec_helper'
2
2
  require 'model/models/basic_model'
3
- require 'model/models/cacheable_model'
4
3
  require 'model/models/custom_model'
5
4
  require 'model/models/authored_model'
6
5
  require 'model/models/described_model'
@@ -11,7 +10,6 @@ require 'model/models/titled_model'
11
10
  RSpec.configure do |spec|
12
11
  spec.before(:suite) do
13
12
  BasicModel.auto_migrate!
14
- CacheableModel.auto_migrate!
15
13
  CustomModel.auto_migrate!
16
14
  AuthoredModel.auto_migrate!
17
15
  DescribedModel.auto_migrate!
@@ -1,6 +1,5 @@
1
1
  require 'spec_helper'
2
2
  require 'helpers/repositories'
3
- require 'model/models/cacheable_model'
4
3
 
5
4
  require 'ronin/repository'
6
5
 
@@ -11,16 +10,16 @@ describe Repository do
11
10
 
12
11
  describe "find" do
13
12
  it "should be able to retrieve an Repository by name" do
14
- repo = subject.find('hello')
13
+ repo = subject.find('local')
15
14
 
16
- repo.name.should == 'hello'
15
+ repo.name.should == 'local'
17
16
  end
18
17
 
19
18
  it "should be able to retrieve an Repository by name and domain" do
20
- repo = subject.find('hello/localhost')
19
+ repo = subject.find('installed/github.com')
21
20
 
22
- repo.name.should == 'hello'
23
- repo.domain.should == 'localhost'
21
+ repo.name.should == 'installed'
22
+ repo.domain.should == 'github.com'
24
23
  end
25
24
 
26
25
  it "should raise RepositoryNotFound for unknown Repository names" do
@@ -51,13 +50,13 @@ describe Repository do
51
50
 
52
51
  it "should not allow adding an Repository from the same path twice" do
53
52
  lambda {
54
- subject.add!(:path => repository('hello').path)
53
+ subject.add!(:path => repository('local').path)
55
54
  }.should raise_error(DuplicateRepository)
56
55
  end
57
56
 
58
57
  it "should not allow adding an Repository that was already installed" do
59
58
  lambda {
60
- subject.add!(:path => repository('random').path)
59
+ subject.add!(:path => repository('installed').path)
61
60
  }.should raise_error(DuplicateRepository)
62
61
  end
63
62
  end
@@ -71,46 +70,46 @@ describe Repository do
71
70
 
72
71
  it "should not allow installing an Repository that was already added" do
73
72
  lambda {
74
- subject.install!(:uri => repository('test1').uri)
73
+ subject.install!(:uri => repository('remote').uri)
75
74
  }.should raise_error(DuplicateRepository)
76
75
  end
77
76
 
78
77
  it "should not allow installing an Repository from the same URI twice" do
79
78
  lambda {
80
- subject.install!(:uri => repository('random').uri)
79
+ subject.install!(:uri => repository('installed').uri)
81
80
  }.should raise_error(DuplicateRepository)
82
81
  end
83
82
  end
84
83
 
85
84
  describe "#domain" do
86
85
  it "should be considered local for 'localhost' domains" do
87
- hello = repository('hello')
86
+ repo = repository('local')
88
87
 
89
- hello.should be_local
90
- hello.should_not be_remote
88
+ repo.should be_local
89
+ repo.should_not be_remote
91
90
  end
92
91
 
93
92
  it "should be considered remote for non 'localhost' domains" do
94
- random = repository('random')
93
+ repo = repository('installed')
95
94
 
96
- random.should be_remote
97
- random.should_not be_local
95
+ repo.should be_remote
96
+ repo.should_not be_local
98
97
  end
99
98
  end
100
99
 
101
100
  describe "#initialize" do
102
101
  it "should default the 'name' property to the name of the Repository directory" do
103
102
  repo = subject.new(
104
- :path => File.join(Helpers::Repositories::DIR,'hello')
103
+ :path => File.join(Helpers::Repositories::DIR,'local')
105
104
  )
106
105
 
107
- repo.name.should == 'hello'
106
+ repo.name.should == 'local'
108
107
  end
109
108
 
110
109
  it "should default the 'installed' property to false" do
111
110
  repo = subject.new(
112
- :path => File.join(Helpers::Repositories::DIR,'hello'),
113
- :uri => 'git://github.com/path/to/hello.git'
111
+ :path => File.join(Helpers::Repositories::DIR,'local'),
112
+ :uri => 'git://github.com/path/to/local.git'
114
113
  )
115
114
 
116
115
  repo.installed.should == false
@@ -118,10 +117,10 @@ describe Repository do
118
117
  end
119
118
 
120
119
  describe "#initialize_metadata" do
121
- subject { repository('hello') }
120
+ subject { repository('installed') }
122
121
 
123
122
  it "should load the title" do
124
- subject.title.should == 'Hello World'
123
+ subject.title.should == 'Installed Repo'
125
124
  end
126
125
 
127
126
  it "should load the website" do
@@ -150,14 +149,14 @@ describe Repository do
150
149
  end
151
150
 
152
151
  describe "#activate!" do
153
- subject { repository('hello') }
152
+ subject { repository('local') }
154
153
 
155
154
  before(:all) do
156
155
  subject.activate!
157
156
  end
158
157
 
159
158
  it "should load the init.rb file if present" do
160
- $hello_repo_loaded.should == true
159
+ $local_repo_loaded.should == true
161
160
  end
162
161
 
163
162
  it "should make the lib directory accessible to Kernel#require" do
@@ -166,7 +165,7 @@ describe Repository do
166
165
  end
167
166
 
168
167
  describe "#deactivate!" do
169
- subject { repository('hello') }
168
+ subject { repository('local') }
170
169
 
171
170
  before(:all) do
172
171
  subject.deactivate!
@@ -179,112 +178,93 @@ describe Repository do
179
178
  end
180
179
  end
181
180
 
182
- describe "#cache_paths" do
183
- subject { repository('test1') }
181
+ describe "#each_script" do
182
+ subject { repository('scripts') }
184
183
 
185
184
  it "should list the contents of the 'cache/' directory" do
186
- subject.cache_paths.should_not be_empty
185
+ subject.each_script.to_a.should_not be_empty
187
186
  end
188
187
 
189
188
  it "should only list '.rb' files" do
190
- subject.cache_paths.should_not be_empty
191
-
192
- subject.cache_paths.all? { |path|
193
- path.extname.should == '.rb'
194
- }.should == true
189
+ subject.each_script.map { |path|
190
+ path.extname
191
+ }.uniq.should == ['.rb']
195
192
  end
196
193
  end
197
194
 
198
- describe "#cached_files" do
199
- before(:all) do
200
- CacheableModel.auto_migrate!
201
- end
202
-
203
- let(:test1) { repository('test1') }
204
- let(:test2) { repository('test2') }
195
+ describe "#script_paths" do
196
+ subject { repository('scripts') }
205
197
 
206
- describe "#cache_files!" do
207
- before(:all) do
208
- test1.cache_files!
209
- test2.cache_files!
210
- end
198
+ describe "#cache_scripts!" do
199
+ before(:all) { subject.cache_scripts! }
211
200
 
212
- it "should be populated cached_files" do
213
- test1.cached_files.should_not be_empty
201
+ it "should be populated script_paths" do
202
+ subject.script_paths.should_not be_empty
214
203
  end
215
204
 
216
205
  it "should recover from files that contain syntax errors" do
217
- test2.cached_files.any? { |cached_file|
218
- cached_file.path.basename == Pathname.new('syntax_errors.rb')
219
- }.should == true
206
+ subject.find_script('failures/syntax_errors.rb').should_not be_nil
220
207
  end
221
208
 
222
209
  it "should recover from files that raised exceptions" do
223
- test2.cached_files.any? { |cached_file|
224
- cached_file.path.basename == Pathname.new('exceptions.rb')
225
- }.should == true
210
+ subject.find_script('failures/exceptions.rb').should_not be_nil
226
211
  end
227
212
 
228
213
  it "should recover from files that raise NoMethodError" do
229
- test2.cached_files.any? { |cached_file|
230
- cached_file.path.basename == Pathname.new('no_method_errors.rb')
231
- }.should == true
214
+ subject.find_script('failures/no_method_errors.rb').should_not be_nil
232
215
  end
233
216
 
234
217
  it "should recover from files that have validation errors" do
235
- test2.cached_files.any? { |cached_file|
236
- cached_file.path.basename == Pathname.new('validation_errors.rb')
237
- }.should == true
218
+ subject.find_script('failures/validation_errors.rb').should_not be_nil
238
219
  end
239
220
 
240
- it "should clear cached_files before re-populate them" do
241
- test1_files = test1.cached_files.length
242
- test1.cache_files!
221
+ it "should clear script_paths before re-populate them" do
222
+ paths = subject.script_paths.length
223
+ subject.cache_scripts!
243
224
 
244
- test1.cached_files.length.should == test1_files
225
+ subject.script_paths.length.should == paths
245
226
  end
246
227
 
247
228
  it "should be populated using the paths in the 'cache/' directory" do
248
- test1.cached_files.map { |file|
229
+ subject.script_paths.map { |file|
249
230
  file.path
250
- }.should == test1.cache_paths
231
+ }.should == subject.each_script.to_a
251
232
  end
252
233
  end
253
234
 
254
- describe "#sync_cached_files!" do
235
+ describe "#sync_scripts!" do
255
236
  before(:all) do
256
- test1.cache_files!
257
- test2.cache_files!
237
+ subject.cache_scripts!
258
238
 
259
- file1 = test1.cached_files.first
239
+ script_path = subject.find_script('cached/modified.rb')
260
240
 
261
- file1.timestamp -= 10
262
- file1.save
241
+ script_path.timestamp -= 10
242
+ script_path.save
263
243
 
264
- test2.cached_files.clear
244
+ script_path = subject.find_script('cached/cached.rb')
245
+ script_path.destroy!
265
246
 
266
- test1.sync_cached_files!
267
- test2.sync_cached_files!
247
+ subject.sync_scripts!
268
248
  end
269
249
 
270
250
  it "should update stale cached files" do
271
- cached_file = test1.cached_files.first
251
+ script_path = subject.find_script('cached/modified.rb')
272
252
 
273
- cached_file.timestamp.should == File.mtime(cached_file.path)
253
+ script_path.timestamp.should == File.mtime(script_path.path)
274
254
  end
275
255
 
276
256
  it "should cache new files" do
277
- test2.cached_files.should_not be_empty
257
+ subject.find_script('cached/cached.rb').should_not be_nil
278
258
  end
279
259
  end
280
260
 
281
- describe "#clean_cached_files!" do
261
+ describe "#clean_scripts!" do
282
262
  before(:all) do
283
- test1.clean_cached_files!
263
+ subject.clean_scripts!
284
264
  end
285
265
 
286
- it "should clear the cached_files" do
287
- test1.cached_files.should be_empty
266
+ it "should clear the script_paths" do
267
+ subject.script_paths.should be_empty
288
268
  end
289
269
  end
290
270
  end
data/spec/ronin_spec.rb CHANGED
@@ -10,8 +10,8 @@ describe Ronin do
10
10
  version.should_not be_empty
11
11
  end
12
12
 
13
- it "should include OpenNamespace" do
14
- subject.should include(OpenNamespace)
13
+ it "should include AutoLoad" do
14
+ subject.should include(AutoLoad)
15
15
  end
16
16
 
17
17
  it "should add a const_missing method when included" do
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
- require 'ronin/engine/buildable'
3
- require 'engine/classes/buildable_class'
2
+ require 'ronin/script/buildable'
3
+ require 'script/classes/buildable_class'
4
4
 
5
- describe Engine::Buildable do
5
+ describe Script::Buildable do
6
6
  subject do
7
7
  obj = BuildableClass.new
8
8
  obj.instance_eval do
@@ -16,8 +16,8 @@ describe Engine::Buildable do
16
16
  subject.should_not be_built
17
17
  end
18
18
 
19
- it "should include Verifiable" do
20
- subject.class.included_modules.should include(Engine::Verifiable)
19
+ it "should include Testable" do
20
+ subject.class.included_modules.should include(Script::Testable)
21
21
  end
22
22
 
23
23
  describe "#build!" do
@@ -27,7 +27,7 @@ describe Engine::Buildable do
27
27
  subject.output.should == "hello world"
28
28
  end
29
29
 
30
- it "should mark the engine as built" do
30
+ it "should mark the script as built" do
31
31
  subject.build!
32
32
 
33
33
  subject.should be_built
@@ -42,10 +42,10 @@ describe Engine::Buildable do
42
42
  end
43
43
 
44
44
  describe "#verify!" do
45
- it "should raise a NotBuilt exception when verifying unbuilt engines" do
45
+ it "should raise a NotBuilt exception when verifying unbuilt scripts" do
46
46
  lambda {
47
- subject.verify!
48
- }.should raise_error(Engine::NotBuilt)
47
+ subject.test!
48
+ }.should raise_error(Script::NotBuilt)
49
49
  end
50
50
  end
51
51
  end
@@ -0,0 +1,15 @@
1
+ require 'ronin/script'
2
+ require 'ronin/script/buildable'
3
+
4
+ class BuildableClass
5
+
6
+ include Ronin::Script
7
+ include Ronin::Script::Buildable
8
+
9
+ property :id, Serial
10
+
11
+ parameter :var, :default => 'world'
12
+
13
+ attr_reader :output
14
+
15
+ end
@@ -0,0 +1,13 @@
1
+ require 'ronin/script'
2
+ require 'ronin/script/deployable'
3
+
4
+ class DeployableClass
5
+
6
+ include Ronin::Script
7
+ include Ronin::Script::Deployable
8
+
9
+ property :id, Serial
10
+
11
+ parameter :var, :default => 5
12
+
13
+ end