rhcp 0.2.16 → 0.2.17

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.
data/lib/rhcp.rb CHANGED
@@ -23,7 +23,7 @@ module RHCP #:nodoc:
23
23
 
24
24
  MAJOR = 0
25
25
  MINOR = 2
26
- TINY = 16
26
+ TINY = 17
27
27
 
28
28
  def Version.to_s
29
29
  [ MAJOR, MINOR, TINY ].join(".")
@@ -39,13 +39,12 @@ module RHCP
39
39
  @name = name
40
40
  @description = description
41
41
 
42
- # TODO add default value for optional params
43
42
  # TODO also, it should be possible to allow extra values for params with lookups
44
43
  @mandatory = options[:mandatory] || false
45
44
  @lookup_value_block = options[:lookup_method]
46
45
  @has_lookup_values = @lookup_value_block != nil
47
46
  @allows_multiple_values = options[:allows_multiple_values] || false
48
- @is_default_param = options[:is_default_param] || false
47
+ @is_default_param = options[:is_default_param] || options[:default_param] || false
49
48
  @autofill_context_key = options[:autofill_context_key] || nil
50
49
  @default_value = options[:default_value] || nil
51
50
  end
@@ -46,7 +46,10 @@ module RHCP
46
46
 
47
47
  is_new_request = Thread.current[var_name("request_id")] == nil
48
48
  if is_new_request
49
- Thread.current[var_name("request_id")] = Time.now().to_i.to_s + '_' + request.command.name
49
+ Thread.current[var_name("request_id")] = request.param_values.has_key?('request_id') ?
50
+ request.param_values['request_id'].first :
51
+ Time.now().to_i.to_s + '_' + request.command.name
52
+
50
53
  Thread.current[var_name("stack")] = []
51
54
  Thread.current[var_name("id_stack")] = []
52
55
  end
data/lib/rhcp/response.rb CHANGED
@@ -53,7 +53,8 @@ module RHCP
53
53
  :data => @data, # TODO what about JSONinification of data? (probably data should be JSON-ish data only, i.e. no special objects)
54
54
  :result_text => @result_text,
55
55
  :context => @context,
56
- :created_at => @created_at
56
+ :created_at => @created_at,
57
+ :created_at_iso8601 => Time.at(@created_at).iso8601(),
57
58
  }
58
59
  end
59
60
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhcp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 53
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 16
10
- version: 0.2.16
9
+ - 17
10
+ version: 0.2.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Philipp Traeder
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-26 00:00:00 +01:00
18
+ date: 2011-12-07 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency