marty 0.5.18 → 0.5.19

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: a348a98b692037a2ab1dbc2d09d32d64be591374
4
- data.tar.gz: bb8f318e11ba6164af0102b71c3edffbc852c78b
3
+ metadata.gz: 7b041dfaff63f5f2a9252330f8a9899b0f1323ed
4
+ data.tar.gz: 7dcea16c26b2f970166fa238570d25237120cc29
5
5
  SHA512:
6
- metadata.gz: 60e777f722bdd38bea19a725018210bef66700acc5fb5c6b14356e4454deaf4dc9bcd2150bd6fc17c4de098c504f9c8706537943ecede9791b988ad3381f7204
7
- data.tar.gz: e66099a715242f06fec907becf577f37d40c058125c6dd4244509b6443f9f8a62255d518e30faa2cd9c0936b506b6ae4fc872496b9994ba3b198b4462063f0cf
6
+ metadata.gz: 19f4a3eac575745e9f84f45d2816b9a915553e335bfb132f8061e6a2d5e40828ab86b1a7f3511f39919e8f57a860a2f89565018a267be5b571f98065cbe1db56
7
+ data.tar.gz: baf2d7634667b9a634410102c6b96698bbf1d9165a0015e40f299847f9d7adde9c56f4cb2ed4d5d4c2d132ec02d1b8cc8f2823fd4fa0ebc1b2c2c4f157848ca2
@@ -98,13 +98,21 @@ class Marty::ReportForm < Marty::Form
98
98
  var values = this.getForm().getValues();
99
99
  var data = Ext.encode(values);
100
100
 
101
+ var params = {data: data, reptitle: this.reptitle};
102
+
103
+ // very hacky -- when selected_testing is set, we assume we're
104
+ // testing and try to inline the result.
105
+ if (values["selected_testing"]) {
106
+ this.repformat = "txt";
107
+ params["disposition"] = "inline";
108
+ }
109
+
101
110
  var form = document.createElement("form");
111
+
102
112
  form.setAttribute("method", "post");
103
113
  form.setAttribute("action", "#{@@mount_path}/report."+this.repformat);
104
114
 
105
- var params = {data: data, reptitle: this.reptitle};
106
-
107
- for(var key in params) {
115
+ for (var key in params) {
108
116
  if (params.hasOwnProperty(key)) {
109
117
  var hiddenField = document.createElement("input");
110
118
  hiddenField.setAttribute("type", "hidden");
@@ -196,7 +204,12 @@ class Marty::ReportForm < Marty::Form
196
204
  items.empty?
197
205
 
198
206
  # add hidden fields for selected tag/script/node
199
- items += [:selected_tag_id, :selected_script_name, :selected_node].map { |f|
207
+ items += [:selected_tag_id,
208
+ :selected_script_name,
209
+ :selected_node,
210
+ # just for testing
211
+ :selected_testing,
212
+ ].map { |f|
200
213
  {
201
214
  name: f,
202
215
  xtype: :textfield,
@@ -36,7 +36,12 @@ class Marty::Tag < Marty::Base
36
36
  end
37
37
 
38
38
  def self.map_to_tag(tag_id)
39
+ # FIXME: this is really hacky. This function should not take so
40
+ # many different types of arguments.
41
+
39
42
  case tag_id
43
+ when Fixnum, /\A[0-9]+\z/
44
+ tag = find_by_id(tag_id)
40
45
  when String
41
46
  tag = find_by_name(tag_id)
42
47
  # if tag name wasn't found, look for a matching
@@ -46,15 +51,13 @@ class Marty::Tag < Marty::Base
46
51
  tag = find_match(Mcfly.normalize_infinity(posting.created_dt)) if
47
52
  posting
48
53
  end
49
- when Fixnum
50
- tag = find_by_id(tag_id)
51
54
  when nil
52
55
  tag = get_latest1
53
56
  else
54
57
  tag = tag_id
55
58
  end
56
59
 
57
- raise "bad tag identifier #{tag_id || 'nil'}" unless tag.is_a? Marty::Tag
60
+ raise "bad tag identifier #{tag_id.inspect}" unless tag.is_a? Marty::Tag
58
61
  tag
59
62
  end
60
63
 
data/lib/marty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "0.5.18"
2
+ VERSION = "0.5.19"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.18
4
+ version: 0.5.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani