scoutui 2.0.3.27.pre → 2.0.3.28.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/converters/jsony.rb +36 -0
- data/lib/scoutui/base/visual_test_framework.rb +13 -1
- data/lib/scoutui/commands/utils.rb +23 -0
- data/lib/scoutui/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e62490127bd891adcfc389e89e9d66c28f67ca8b
|
4
|
+
data.tar.gz: e230c70a13d642d0941ac7a8daf2e5ef12bb7d80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcbde622927e2c78d21f448777f24d89626c41ea0748195b63c80bc487c14cc2451cc88e2c95c0502899cd63fbb5f8e39b5699ba3b524d38eee4e7e854807cf6
|
7
|
+
data.tar.gz: 42b9fc8ebef14155f30e6fbfbf6b4bdd563312db35593522a0f733247037130c7e0524cb3845521a8689ffa34913383f6ce66445ebeaefded2137ab7ffb1da04
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require 'json'
|
5
|
+
require 'optparse'
|
6
|
+
require 'ostruct'
|
7
|
+
require 'fileutils'
|
8
|
+
|
9
|
+
#quit unless our script gets two command line arguments
|
10
|
+
unless ARGV.length == 3
|
11
|
+
puts "Dude, not the right number of arguments."
|
12
|
+
puts "Usage: ruby YJ_Convert.rb [-j][-y] json_file.json yaml_file.yaml\n"
|
13
|
+
exit
|
14
|
+
end
|
15
|
+
|
16
|
+
$json_file = ARGV[1]
|
17
|
+
$yaml_file = ARGV[2]
|
18
|
+
|
19
|
+
options = OpenStruct.new
|
20
|
+
OptionParser.new do |opt|
|
21
|
+
opt.on('-j', '--json', 'Convert to JSON') { |o| options.json = o }
|
22
|
+
opt.on('-y', '--yaml', 'Convert to YAML') { |o| options.yaml = o }
|
23
|
+
end.parse!
|
24
|
+
|
25
|
+
case
|
26
|
+
when options.yaml == true
|
27
|
+
y_file = File.open("#{$yaml_file}", 'a')
|
28
|
+
y_file.write(YAML.dump(JSON.parse(IO.read($json_file))))
|
29
|
+
y_file.close
|
30
|
+
puts "Converted to YAML. Output file is #{$yaml_file}"
|
31
|
+
|
32
|
+
when options.json == true
|
33
|
+
j_file = YAML.load_file(File.open("#{$yaml_file}", 'r'))
|
34
|
+
File.write "#{$json_file}", JSON.pretty_generate(j_file)
|
35
|
+
puts "Converted to JSON. Output file is #{$json_file}"
|
36
|
+
end
|
@@ -977,7 +977,19 @@ module Scoutui::Base
|
|
977
977
|
puts __FILE__ + (__LINE__).to_s + " == Process SaveAs =="
|
978
978
|
_saveAs = e[STEP_KEY]['saveas']['file'].to_s
|
979
979
|
_f=File.open(_saveAs, 'w')
|
980
|
-
|
980
|
+
|
981
|
+
if e[STEP_KEY]['saveas']['data'].match(/.*\.json$/)
|
982
|
+
_f.puts e[STEP_KEY]['saveas']['data'].to_json
|
983
|
+
elsif e[STEP_KEY]['saveas']['data'].match(/.*\.(yml|yaml)$/)
|
984
|
+
|
985
|
+
# y_file = File.open("#{$yaml_file}", 'a')
|
986
|
+
_f.write(YAML.dump(JSON.parse(IO.read($json_file))))
|
987
|
+
y_file.close
|
988
|
+
|
989
|
+
|
990
|
+
_f.puts e[STEP_KEY]['saveas']['data'].to_json
|
991
|
+
end
|
992
|
+
|
981
993
|
_f.close
|
982
994
|
end
|
983
995
|
|
@@ -48,6 +48,14 @@ module Scoutui::Commands
|
|
48
48
|
'__DATE__' => lambda { Time.now().to_s },
|
49
49
|
'__EMAIL__' => lambda { Faker::Internet.email.to_s},
|
50
50
|
'__DDMMYY__' => lambda { Date.parse(Time.now.to_s).strftime("%d%m%Y") },
|
51
|
+
'__MM/DD/YY__' => lambda { Date.parse(Time.now.to_s).strftime("%m/%d/%y") },
|
52
|
+
'__MM/DD/YY\+\d+__' => lambda { |s|
|
53
|
+
puts __FILE__ + (__LINE__).to_s + " Process s => #{s}"
|
54
|
+
d=s.match(/__MM\/DD\/YY\+(\d+)__/)[1]
|
55
|
+
d=(Date.today + d.to_i).strftime("%m/%d/%y")
|
56
|
+
puts __FILE__ + (__LINE__).to_s + " new date: #{d}"
|
57
|
+
d
|
58
|
+
},
|
51
59
|
'__MMDDYY__' => lambda { Date.parse(Time.now.to_s).strftime("%m%d%y") },
|
52
60
|
'__MMDDYY\+\d+__' => lambda { |s|
|
53
61
|
puts __FILE__ + (__LINE__).to_s + " Process s => #{s}"
|
@@ -56,7 +64,22 @@ module Scoutui::Commands
|
|
56
64
|
puts __FILE__ + (__LINE__).to_s + " new date: #{d}"
|
57
65
|
d
|
58
66
|
},
|
67
|
+
'__MM/DD/YYYY__' => lambda { Date.parse(Time.now.to_s).strftime("%m/%d/%Y") },
|
68
|
+
'__MM/DD/YYYY\+\d+__' => lambda { |s|
|
69
|
+
puts __FILE__ + (__LINE__).to_s + " Process s => #{s}"
|
70
|
+
d=s.match(/__MM\/DD\/YYYY\+(\d+)__/)[1]
|
71
|
+
d=(Date.today + d.to_i).strftime("%m/%d/%Y")
|
72
|
+
puts __FILE__ + (__LINE__).to_s + " new date: #{d}"
|
73
|
+
d
|
74
|
+
},
|
59
75
|
'__MMDDYYYY__' => lambda { Date.parse(Time.now.to_s).strftime("%m%d%Y") },
|
76
|
+
'__MMDDYYYY\+\d+__' => lambda { |s|
|
77
|
+
puts __FILE__ + (__LINE__).to_s + " Process s => #{s}"
|
78
|
+
d=s.match(/__MMDDYYYY\+(\d+)__/)[1]
|
79
|
+
d=(Date.today + d.to_i).strftime("%m%d%Y")
|
80
|
+
puts __FILE__ + (__LINE__).to_s + " new date: #{d}"
|
81
|
+
d
|
82
|
+
},
|
60
83
|
'__PARAGRAPH__' => lambda { Faker::Lorem.paragraph.to_s },
|
61
84
|
'__PASSWORD__' => lambda { Faker::Internet.password.to_s },
|
62
85
|
'__PHONENUMBER__' => lambda { Faker::PhoneNumber.phone_number.to_s },
|
data/lib/scoutui/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scoutui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.3.
|
4
|
+
version: 2.0.3.28.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Kim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- examples/carmax/commands/commands.yml
|
192
192
|
- examples/carmax/tests/test-carmax.sh
|
193
193
|
- examples/ci_reporter/ci_example.rb
|
194
|
+
- examples/converters/jsony.rb
|
194
195
|
- examples/ex1/commands.holidays.yml
|
195
196
|
- examples/ex1/commands.yml
|
196
197
|
- examples/ex1/test-example.sh
|