speckle 0.1.22 → 0.1.23
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.
- checksums.yaml +8 -8
- data/Rakefile +11 -1
- data/lib/speckle/cli/environment.rb +14 -6
- data/lib/speckle/version.rb +1 -1
- data/lib/speckle.riml +17 -0
- data/portkey.json +33 -0
- data/spec/speckle/cli/environment_spec.rb +13 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTI5ZjViNTdhYTBmZmZmZjYyMzI5YzA1ODExYzAzNzU0Y2MwYjgzYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmMzMjJkOTliY2VlMmU0YzdkOWUwNDIxZThhNzE5ZmZkNTg2ZDNmOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWQzZDY1YzAzODY1M2JmNGUzZDZiYjVkMjMwZGViMWJhMTg3OGY2MTUxNjg2
|
10
|
+
NzQxOTFmZTY2MGUzYTc0YzBiMjQ5Y2ZmYmY0NTZiNTk3ZjUzMTg4NzgwZTI2
|
11
|
+
MjA3ZDQ0YjFjNjkzYWYzZDUxNmM1YTEzZTNjZjcyODA4NmRlNzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTMwOGI3MTYyZGI1OTk0Y2ViOWRmNTFkNWVhMzEwNTlmM2NkNzFkMGI2NjE3
|
14
|
+
MzdlODM3NWVhNzZmYWZlYmVkNGJmMzNiODM1Yzk5ZjM1NzY4N2IxOWViNzlj
|
15
|
+
M2U5NWI0NGZiZjZlMGZjMzU3NjBkMWMwZDNjN2EyYWMzMDI0YWM=
|
data/Rakefile
CHANGED
@@ -77,6 +77,7 @@ namespace :speckle do
|
|
77
77
|
TEST_VIM = ENV['TEST_VIM'] || 'vim'
|
78
78
|
TEST_REPORTER = ENV['TEST_REPORTER'] || 'spec'
|
79
79
|
TEST_LOG = "#{BUILD_DIR}/speckle.log"
|
80
|
+
TEST_EXIT_FILE = "#{TEST_LOG}.exit"
|
80
81
|
DEBUG_LOG = "#{BUILD_DIR}/debug.log"
|
81
82
|
TEST_SOURCES = FileList.new do |fl|
|
82
83
|
sources = ENV['TEST_SOURCES']
|
@@ -217,9 +218,18 @@ namespace :speckle do
|
|
217
218
|
begin
|
218
219
|
verbose DEBUG do
|
219
220
|
launch_file = get_launch_cmd_file()
|
221
|
+
File.delete(TEST_LOG) if File.exist?(TEST_LOG)
|
222
|
+
File.delete(TEST_EXIT_FILE) if File.exist?(TEST_EXIT_FILE)
|
223
|
+
|
220
224
|
sh "#{TEST_VIM} #{get_vim_options()} -S #{launch_file.path}"
|
221
|
-
sh "cat #{TEST_LOG}"
|
222
225
|
launch_file.unlink
|
226
|
+
if File.exist?(TEST_EXIT_FILE)
|
227
|
+
sh "cat #{TEST_LOG}"
|
228
|
+
exit_code = File.read(TEST_EXIT_FILE)[0].to_i
|
229
|
+
exit!(exit_code)
|
230
|
+
else
|
231
|
+
fail "Fatal error: #{TEST_LOG} not found."
|
232
|
+
end
|
223
233
|
end
|
224
234
|
rescue RuntimeError => error
|
225
235
|
puts error
|
@@ -114,14 +114,18 @@ module Speckle
|
|
114
114
|
parser.parse!(args)
|
115
115
|
|
116
116
|
if options.action.nil?
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
117
|
+
if args_empty?(args)
|
118
|
+
spec_dir = "#{options.cwd}/spec"
|
119
|
+
if File.directory?(spec_dir)
|
120
|
+
args << 'spec'
|
121
|
+
options.action = :compile_and_test
|
122
|
+
else
|
123
|
+
options.action = :show_no_spec_dir
|
124
|
+
end
|
121
125
|
else
|
122
|
-
options.action = :
|
126
|
+
options.action = :compile_and_test
|
123
127
|
end
|
124
|
-
elsif action_needs_args?(options.action) and args
|
128
|
+
elsif action_needs_args?(options.action) and args_empty?(args)
|
125
129
|
spec_dir = "#{options.cwd}/spec"
|
126
130
|
if File.directory?(spec_dir)
|
127
131
|
args << 'spec'
|
@@ -164,6 +168,10 @@ module Speckle
|
|
164
168
|
|
165
169
|
libs.uniq.join(':')
|
166
170
|
end
|
171
|
+
|
172
|
+
def args_empty?(args)
|
173
|
+
args.empty? || (args.length == 1 && args[0] == '')
|
174
|
+
end
|
167
175
|
end
|
168
176
|
|
169
177
|
end
|
data/lib/speckle/version.rb
CHANGED
data/lib/speckle.riml
CHANGED
@@ -105,6 +105,10 @@ class g:Speckle
|
|
105
105
|
return g:speckle_output_file
|
106
106
|
end
|
107
107
|
|
108
|
+
defm get_exit_code_file
|
109
|
+
return self.get_output_file() . '.exit'
|
110
|
+
end
|
111
|
+
|
108
112
|
defm get_reporter_name
|
109
113
|
return g:speckle_reporter_name
|
110
114
|
end
|
@@ -149,6 +153,8 @@ class g:Speckle
|
|
149
153
|
if self.is_file_mode()
|
150
154
|
writer.flush()
|
151
155
|
end
|
156
|
+
|
157
|
+
self.write_exit_code(stats.is_ok())
|
152
158
|
end
|
153
159
|
|
154
160
|
defm add_specs(runner, lines)
|
@@ -164,4 +170,15 @@ class g:Speckle
|
|
164
170
|
end
|
165
171
|
end
|
166
172
|
end
|
173
|
+
|
174
|
+
defm get_exit_code(ok)
|
175
|
+
return ok == true ? '0' : '1'
|
176
|
+
end
|
177
|
+
|
178
|
+
defm write_exit_code(ok)
|
179
|
+
writer = new FileWriter()
|
180
|
+
writer.set_output_file(self.get_exit_code_file())
|
181
|
+
writer.write(self.get_exit_code(ok))
|
182
|
+
writer.flush()
|
183
|
+
end
|
167
184
|
end
|
data/portkey.json
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"lib/matchers/*.riml": {
|
3
|
+
"type": "matcher",
|
4
|
+
"test": "spec/matchers/%s_spec.riml"
|
5
|
+
},
|
6
|
+
"lib/reporters/*.riml": {
|
7
|
+
"type": "reporter"
|
8
|
+
},
|
9
|
+
"lib/runners/*.riml": {
|
10
|
+
"type": "runner"
|
11
|
+
},
|
12
|
+
"lib/writers/*.riml": {
|
13
|
+
"type": "writer",
|
14
|
+
"mapping": "i"
|
15
|
+
},
|
16
|
+
"lib/utils/*.riml": {
|
17
|
+
"type": "utility"
|
18
|
+
},
|
19
|
+
"lib/speckle/cli/*.rb": {
|
20
|
+
"type": "cli"
|
21
|
+
},
|
22
|
+
"lib/speckle/list/*.rb": {
|
23
|
+
"type": "list"
|
24
|
+
},
|
25
|
+
|
26
|
+
"spec/matchers/*_spec.riml": {
|
27
|
+
"type": "spec",
|
28
|
+
"alternate": "lib/matchers/%s.riml"
|
29
|
+
},
|
30
|
+
"spec/*_spec.riml": {
|
31
|
+
"type": "spec"
|
32
|
+
}
|
33
|
+
}
|
@@ -103,7 +103,7 @@ end
|
|
103
103
|
|
104
104
|
module Speckle
|
105
105
|
module CLI
|
106
|
-
|
106
|
+
|
107
107
|
describe 'Main options basics' do
|
108
108
|
|
109
109
|
it 'defaults to compile_and_test without args' do
|
@@ -129,7 +129,7 @@ module Speckle
|
|
129
129
|
|
130
130
|
describe 'Source path defaults' do
|
131
131
|
|
132
|
-
it '
|
132
|
+
it 'uses spec directory without args', :dms => true do
|
133
133
|
expect('').to include_path('spec')
|
134
134
|
end
|
135
135
|
|
@@ -147,6 +147,17 @@ module Speckle
|
|
147
147
|
expect('-t').to include_path('spec')
|
148
148
|
expect('--test').to include_path('spec')
|
149
149
|
end
|
150
|
+
|
151
|
+
it 'does not use spec directory when file is specified', :dms => true do
|
152
|
+
expect('a.riml').to include_path('a.riml')
|
153
|
+
expect('a.riml').to_not include_path('spec')
|
154
|
+
end
|
155
|
+
|
156
|
+
it 'does not use spec directory when multiple file is specified', :dms => true do
|
157
|
+
env = Environment.new
|
158
|
+
opts = env.load(['a.riml', 'b.riml'])
|
159
|
+
expect(opts.inputs).to eq(['a.riml', 'b.riml'])
|
160
|
+
end
|
150
161
|
end
|
151
162
|
|
152
163
|
describe 'Extra options and flags' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speckle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darshan Sawardekar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riml
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/writers/console_writer.riml
|
160
160
|
- lib/writers/file_writer.riml
|
161
161
|
- lib/writers/writer_factory.riml
|
162
|
+
- portkey.json
|
162
163
|
- spec/after_hooks_spec.riml
|
163
164
|
- spec/before_hooks_spec.riml
|
164
165
|
- spec/logger/logger_spec.riml
|