gridium 1.0.0 → 1.0.1
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 +4 -4
- data/.gitignore +2 -1
- data/.jenkins-docker +49 -0
- data/Dockerfile +2 -2
- data/Gemfile +1 -0
- data/Rakefile +1 -1
- data/bin/cleanup +14 -0
- data/bin/pull +7 -0
- data/bin/start +17 -0
- data/docker-compose.dev.yml +5 -0
- data/lib/element.rb +14 -1
- data/lib/gridium/version.rb +1 -1
- data/lib/s3.rb +4 -5
- metadata +8 -7
- data/bin/console +0 -14
- data/bin/docker/cleanup.sh +0 -8
- data/bin/docker/start.sh +0 -6
- data/bin/setup +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dc29df3a04ae8f95ff1c46bcfa7a89c674d8093
|
4
|
+
data.tar.gz: 9f6ebb099df861db7955dff000b64d4e150ee975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7d619fc44d6ad485bd3f3eba756004128e7cc294ed96432e14099d72a6751758f5a468326c76a7a13fabddba2be8f71237a5488b8071d9558ec07b8d8f7325b
|
7
|
+
data.tar.gz: 58b0c9a013a9e2edfc59a6e3f8323acfc8da377c01edad71853d33f2784d97e90c69eb70aa07e64c54d2988c2d00afb57ce96619172c8d11dd7e0f82d6279b86
|
data/.gitignore
CHANGED
data/.jenkins-docker
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env sh
|
2
|
+
set -eux
|
3
|
+
#set -o pipefail
|
4
|
+
|
5
|
+
_init_env() {
|
6
|
+
# leading colon force successful return code
|
7
|
+
: ${PUBLISH:=0} # If unset, default to 0
|
8
|
+
: ${REGISTRY:=docker.sendgrid.net}
|
9
|
+
: ${NAMESPACE:=${USER}}
|
10
|
+
: ${APPNAME=gridium}
|
11
|
+
: ${COMPOSE_PROJECT_NAME:=$APPNAME}
|
12
|
+
|
13
|
+
# If we're "jenkins" and on the "origin/master" branch, push to 'docker.sendgrid.net/sendgrid'
|
14
|
+
[[ "${USER}" == "jenkins" ]] && [[ "${GIT_BRANCH}" == "origin/master" ]] && NAMESPACE=sendgrid
|
15
|
+
|
16
|
+
export PUBLISH
|
17
|
+
export REGISTRY
|
18
|
+
export NAMESPACE
|
19
|
+
export APPNAME
|
20
|
+
export COMPOSE_PROJECT_NAME
|
21
|
+
|
22
|
+
}
|
23
|
+
|
24
|
+
run_test(){
|
25
|
+
docker exec $(docker-compose ps -q gridium) rake spec
|
26
|
+
}
|
27
|
+
|
28
|
+
main() {
|
29
|
+
echo "**** Arguments: $@"
|
30
|
+
|
31
|
+
# Cleanup regardless
|
32
|
+
trap bin/cleanup EXIT
|
33
|
+
|
34
|
+
_init_env
|
35
|
+
|
36
|
+
if [[ "${SKIPDOCKERPULL:=0}" -eq 1 ]]; then
|
37
|
+
echo "Skipping docker pull"
|
38
|
+
else
|
39
|
+
bin/pull
|
40
|
+
fi
|
41
|
+
|
42
|
+
bin/start -i
|
43
|
+
sleep 2
|
44
|
+
|
45
|
+
run_test
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
main
|
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/cleanup
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
main() {
|
4
|
+
docker-compose kill
|
5
|
+
|
6
|
+
docker-compose rm -fv
|
7
|
+
|
8
|
+
docker rmi $(docker images -f "dangling=true" -q)
|
9
|
+
|
10
|
+
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
|
11
|
+
|
12
|
+
}
|
13
|
+
|
14
|
+
main
|
data/bin/pull
ADDED
data/bin/start
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
main(){
|
4
|
+
case $1 in
|
5
|
+
-i) #start normally
|
6
|
+
docker-compose up -d
|
7
|
+
;;
|
8
|
+
-d) #start in development mode
|
9
|
+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
|
10
|
+
;;
|
11
|
+
*)
|
12
|
+
echo "Usage: $0 [-i] isolated [-d] gridium dev" 1>&2; exit 1;
|
13
|
+
;;
|
14
|
+
esac
|
15
|
+
}
|
16
|
+
|
17
|
+
main $1
|
data/lib/element.rb
CHANGED
@@ -366,7 +366,7 @@ class Element
|
|
366
366
|
|
367
367
|
def field_empty_afterward?(*args)
|
368
368
|
Log.debug("Checking the field after sending #{args}, to see if it's empty")
|
369
|
-
check_again = (
|
369
|
+
check_again = (has_characters? *args and no_symbols? *args)
|
370
370
|
field_is_empty_but_should_not_be = (check_again and field_empty?)
|
371
371
|
if field_is_empty_but_should_not_be
|
372
372
|
raise "Browser Error: tried to input #{args} but found an empty string afterward: #{value}"
|
@@ -403,4 +403,17 @@ class Element
|
|
403
403
|
false
|
404
404
|
end
|
405
405
|
|
406
|
+
#
|
407
|
+
# helper to check if *args is not empty but contains only empty string(s)/symbol(s)
|
408
|
+
# if so, don't bother trying to validate the text afterward
|
409
|
+
#
|
410
|
+
|
411
|
+
def has_characters?(*args)
|
412
|
+
characters = args.select { |_| not _.is_a? Symbol }.join('')
|
413
|
+
if characters.empty?
|
414
|
+
return false
|
415
|
+
end
|
416
|
+
true
|
417
|
+
end
|
418
|
+
|
406
419
|
end
|
data/lib/gridium/version.rb
CHANGED
data/lib/s3.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
require 'aws-sdk'
|
2
2
|
module Gridium
|
3
3
|
|
4
|
-
|
5
4
|
class GridiumS3
|
6
5
|
|
7
6
|
DELIMITER = "/"
|
8
7
|
|
9
8
|
def initialize(project_name, subdirectory_name='screenshots')
|
10
9
|
Log.debug("initializing GridiumS3 with #{project_name} and #{subdirectory_name}")
|
11
|
-
Aws.config.update({ credentials: Aws::Credentials.new(ENV['S3_ACCESS_KEY_ID'], ENV['S3_SECRET_ACCESS_KEY']) ,region: ENV['S3_DEFAULT_REGION']})
|
10
|
+
Aws.config.update({ credentials: Aws::Credentials.new(ENV['S3_ACCESS_KEY_ID'], ENV['S3_SECRET_ACCESS_KEY']) , region: ENV['S3_DEFAULT_REGION']})
|
12
11
|
_validate_string(project_name)
|
13
12
|
_validate_string(subdirectory_name)
|
14
13
|
@project_name = _sanitize_string(project_name)
|
@@ -37,12 +36,12 @@ module Gridium
|
|
37
36
|
|
38
37
|
def _sanitize_string(input_string)
|
39
38
|
#remove left/right whitespace, split and join to collapse contiguous white space, replace whitespace and non-period special chars with underscore
|
40
|
-
input_string = input_string.strip().split.join(" ").gsub(/[^\w.]/i, '_')
|
39
|
+
input_string = input_string.strip().split.join(" ").gsub(/[^\w.]/i, '_')
|
41
40
|
input_string
|
42
41
|
end
|
43
42
|
|
44
43
|
def _validate_string(input_string)
|
45
|
-
Log.debug("attempting to validate #{input_string} for use as a name")
|
44
|
+
Log.debug("attempting to validate #{input_string} for use as a name")
|
46
45
|
if input_string.empty? or input_string.strip().empty? then
|
47
46
|
raise(ArgumentError, "empty and/or whitespace file names are not wanted here.")
|
48
47
|
end
|
@@ -59,7 +58,7 @@ module Gridium
|
|
59
58
|
upload_size = @bucket.object(s3_name).content_length
|
60
59
|
local_size = File.size local_absolute_path
|
61
60
|
Log.debug("file upload verified: #{upload_size == local_size}. upload size is #{upload_size} and local size is #{local_size}")
|
62
|
-
upload_size == local_size
|
61
|
+
upload_size == local_size
|
63
62
|
end
|
64
63
|
end
|
65
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gridium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Urban
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -139,6 +139,7 @@ extensions: []
|
|
139
139
|
extra_rdoc_files: []
|
140
140
|
files:
|
141
141
|
- ".gitignore"
|
142
|
+
- ".jenkins-docker"
|
142
143
|
- ".rspec"
|
143
144
|
- CODE_OF_CONDUCT.md
|
144
145
|
- Dockerfile
|
@@ -146,10 +147,10 @@ files:
|
|
146
147
|
- LICENSE
|
147
148
|
- README.md
|
148
149
|
- Rakefile
|
149
|
-
- bin/
|
150
|
-
- bin/
|
151
|
-
- bin/
|
152
|
-
-
|
150
|
+
- bin/cleanup
|
151
|
+
- bin/pull
|
152
|
+
- bin/start
|
153
|
+
- docker-compose.dev.yml
|
153
154
|
- docker-compose.yml
|
154
155
|
- gridium.gemspec
|
155
156
|
- lib/driver.rb
|
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
186
|
version: '0'
|
186
187
|
requirements: []
|
187
188
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
189
|
+
rubygems_version: 2.6.10
|
189
190
|
signing_key:
|
190
191
|
specification_version: 4
|
191
192
|
summary: This Gem is used to make building Selenium Tests without Capybara Easier.
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "gridium"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
data/bin/docker/cleanup.sh
DELETED
data/bin/docker/start.sh
DELETED