mumukit 2.6.0 → 2.7.0

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: a6d0b647d318cdc6cc5072e736638106eefc9dcd
4
- data.tar.gz: 25a632bffaa00647f377301fba3885afb513ae45
3
+ metadata.gz: 92b6f5f0aef129cae95f9c8cbdf2af0acf1e245f
4
+ data.tar.gz: 3b9d1b1b3a787c38416ca9296d88a6ce01f6a061
5
5
  SHA512:
6
- metadata.gz: 3f24e318953114610768cf28ebad44a95a614fbf90fb09cb6366d0e6724e7d2cd1f7a95dffc20cb1d2df40b2218f0b4ad3a487b88905e08ed75f1681cdbc1013
7
- data.tar.gz: 4c7e254ba9a1eed3925a8eba6e45561226e38545036ac0b8869ea379a42616a8e1b89633a81ecc9ab7d30cbacf77ee89fa7eea451e05923d642d97e74d25ae79
6
+ metadata.gz: 107002a3a1f6f82125d0dc2f15beb17c68f4e2d5ed8057a74158722dbceef7472c6cf19625d0193053614a4ed78aac24f0694f605b6b558134fdfc888c28bddf
7
+ data.tar.gz: af81b4c924434799d566c27b6c0bf42ee757158501bbf6cc2c45a9b429a3d65ac708676650d95d40eba00c3478bba1fab0662665fccde85ba98939b9fb4df4ae
@@ -48,6 +48,7 @@ require 'mumukit/content_type'
48
48
 
49
49
  require_relative 'mumukit/version'
50
50
  require_relative 'mumukit/env'
51
+ require_relative 'mumukit/cookie'
51
52
  require_relative 'mumukit/with_tempfile'
52
53
  require_relative 'mumukit/with_content_type'
53
54
  require_relative 'mumukit/with_command_line'
@@ -0,0 +1,19 @@
1
+ class Mumukit::Cookie
2
+ attr_accessor :statements
3
+
4
+ def initialize(statements)
5
+ @statements = statements || []
6
+ end
7
+
8
+ def code
9
+ "#{statements_code}\n#{stdout_separator_code}\n"
10
+ end
11
+
12
+ def trim(output)
13
+ output.split("#{stdout_separator}\n")[1]
14
+ end
15
+
16
+ def stdout_separator
17
+ '!!!!MUMUKI-COOKIE-STDOUT-SEPARATOR-END!!!!'
18
+ end
19
+ end
@@ -3,6 +3,7 @@ module Mumukit
3
3
  end
4
4
  end
5
5
 
6
+ require_relative './defaults/default_version_hook'
6
7
  require_relative './defaults/default_expectations_hook'
7
8
  require_relative './defaults/default_query_hook'
8
9
  require_relative './defaults/default_feedback_hook'
@@ -0,0 +1,3 @@
1
+ class Mumukit::Defaults::VersionHook
2
+ VERSION = File.read('version') rescue 'master'
3
+ end
@@ -27,4 +27,11 @@ class Mumukit::Hook
27
27
  def should_forward_to_config?(args, name)
28
28
  args.length == 0 && !block_given? && @config[name]
29
29
  end
30
+
31
+ def self.stateful_through(cookie_clazz)
32
+ include Mumukit::Templates::WithCookie
33
+ define_method :cookie_class do
34
+ cookie_clazz
35
+ end
36
+ end
30
37
  end
@@ -2,7 +2,7 @@ module Mumukit::RuntimeInfo
2
2
  def info
3
3
  {
4
4
  name: Mumukit.runner_name,
5
- version: (File.read('version') rescue 'master'),
5
+ version: hook_class(:version)::VERSION,
6
6
  escualo_base_version: ENV['ESCUALO_BASE_VERSION'],
7
7
  escualo_service_version: ENV['ESCUALO_SERVICE_VERSION'],
8
8
  mumukit_version: Mumukit::VERSION,
@@ -21,8 +21,6 @@ class Mumukit::Runtime
21
21
  hook_class(hook_name).new(@config)
22
22
  end
23
23
 
24
- private
25
-
26
24
  def hook_class(hook_name)
27
25
  @hook_classes[hook_name] ||=
28
26
  if hook_defined? hook_name
@@ -10,3 +10,4 @@ require_relative './templates/with_embedded_environment'
10
10
  require_relative './templates/with_isolated_environment'
11
11
  require_relative './templates/mulang_expectations_hook'
12
12
  require_relative './templates/with_code_smells'
13
+ require_relative './templates/with_cookie'
@@ -0,0 +1,10 @@
1
+ module Mumukit::Templates::WithCookie
2
+ def build_cookie_code(request)
3
+ @cookie = cookie_class.new(request.cookie)
4
+ @cookie.code
5
+ end
6
+
7
+ def trim_cookie_output(output)
8
+ @cookie.trim(output)
9
+ end
10
+ end
@@ -1,7 +1,7 @@
1
1
  module Mumukit
2
2
  module Templates::WithMashupFileContent
3
3
  def compile_file_content(request)
4
- mashup_fields.map { |field| request.send field }.join("\n")
4
+ mashup_fields.map { |field| request.public_send field }.join("\n")
5
5
  end
6
6
 
7
7
  def mashup_fields
@@ -1,3 +1,3 @@
1
1
  module Mumukit
2
- VERSION = '2.6.0'
2
+ VERSION = '2.7.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: sinatra
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -200,10 +214,10 @@ extensions: []
200
214
  extra_rdoc_files: []
201
215
  files:
202
216
  - bin/limit
203
- - bin/mulang
204
217
  - lib/locales/en.yml
205
218
  - lib/locales/es.yml
206
219
  - lib/mumukit.rb
220
+ - lib/mumukit/cookie.rb
207
221
  - lib/mumukit/defaults.rb
208
222
  - lib/mumukit/defaults/default_expectations_hook.rb
209
223
  - lib/mumukit/defaults/default_feedback_hook.rb
@@ -211,6 +225,7 @@ files:
211
225
  - lib/mumukit/defaults/default_query_hook.rb
212
226
  - lib/mumukit/defaults/default_test_hook.rb
213
227
  - lib/mumukit/defaults/default_validation_hook.rb
228
+ - lib/mumukit/defaults/default_version_hook.rb
214
229
  - lib/mumukit/env.rb
215
230
  - lib/mumukit/explainer.rb
216
231
  - lib/mumukit/hook.rb
@@ -235,6 +250,7 @@ files:
235
250
  - lib/mumukit/templates/file_hook.rb
236
251
  - lib/mumukit/templates/mulang_expectations_hook.rb
237
252
  - lib/mumukit/templates/with_code_smells.rb
253
+ - lib/mumukit/templates/with_cookie.rb
238
254
  - lib/mumukit/templates/with_embedded_environment.rb
239
255
  - lib/mumukit/templates/with_isolated_environment.rb
240
256
  - lib/mumukit/templates/with_mashup_file_content.rb
data/bin/mulang DELETED
Binary file