auto-print 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/auto-print +81 -16
- data/lib/auto-print.rb +77 -11
- metadata +21 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfa12db539878c55d00f42b6fdd44ed0918c9fd7
|
4
|
+
data.tar.gz: d3a1617c5f6c6aaf8fb3ac0d76f960cfb634d93e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8ac04a388347f44028b1ea8f6fbd45771566fbaf997644d8e070d8114e7976820a18f1d0e33dde1cc67fa2440b41a0cac002202b9165c10419be726efe28e1f
|
7
|
+
data.tar.gz: 888cb81a0b24546252311a4c3dce994b679d76afd878b85e16bb55ce042da3fe23c5e56a9072e07858ebb56d0e97d1536d6bb93c8f48279c3fbdbb2fa310bebc
|
data/bin/auto-print
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
require 'rubygems'
|
4
4
|
require 'selenium-webdriver'
|
5
|
-
require '
|
5
|
+
require 'colorize'
|
6
6
|
#################
|
7
7
|
# COMMAND
|
8
8
|
#################
|
@@ -16,17 +16,82 @@ size = {
|
|
16
16
|
'xsmall' => 768,
|
17
17
|
'mobile' => 400
|
18
18
|
}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
if ARGV.length == 1 and ARGV[0] == "help"
|
23
|
+
puts "
|
24
|
+
______________________
|
25
|
+
| |
|
26
|
+
| A U T O P R I N T |
|
27
|
+
| |
|
28
|
+
| ~~~~~~~~~~~~~~~~~ |
|
29
|
+
| ~~~~~~~~~~~~~~~~~ |
|
30
|
+
| ~~~~~~~~~~~~~~~~~ |
|
31
|
+
| ~~~~~~~~~~~~~~~~~ |
|
32
|
+
| ~~~~~~~~~~~~~~~~~ |
|
33
|
+
| ~~~~~~~~~~~~~~~~~ |
|
34
|
+
L____________________|
|
35
|
+
|
36
|
+
".cyan
|
37
|
+
|
38
|
+
puts " THE AUTOMATED PRINTING PROGRAM ".yellow.blink
|
39
|
+
|
40
|
+
puts "this program has been written to automate the process of preparing screenshots and printing them for strategy to pass their aproval. instead of taking hours to compile the necessary images, you can print them in seconds!
|
41
|
+
|
42
|
+
this also makes things easier when uploading to NOOSH
|
43
|
+
|
44
|
+
to run the program run this command:\n\n"
|
45
|
+
|
46
|
+
puts "auto-print [url]\n".yellow
|
47
|
+
|
48
|
+
print "where "
|
49
|
+
print " [url] ".yellow
|
50
|
+
puts "is the webpage you wish to make a screenshot\n\n"
|
51
|
+
|
52
|
+
puts "make sure to not unclude any javascript variables in the url\n".red
|
53
|
+
|
54
|
+
puts "you will be asked to answer a few questions about your project and then the necessary files will be created.
|
55
|
+
make sure to delete any community webpages that were generated that are not apart of your campaign."
|
56
|
+
|
57
|
+
|
58
|
+
elsif ARGV.length == 1 and (ARGV[0] == "-v" or ARGV[0] == "-version" or ARGV[0] == "version")
|
59
|
+
|
60
|
+
puts "
|
61
|
+
__________________________
|
62
|
+
| VERSION 0.1.0 |
|
63
|
+
--------------------------
|
64
|
+
".colorize(:yellow)
|
65
|
+
puts " the use of this program is open source, but intended for the needs of Erickson Living employees only. if you wish to make a pull request you may do so at \n\n".yellow
|
66
|
+
puts "https://github.com/alejandro-londono/auto-print".colorize(:color=>:white, :background=>:blue)
|
67
|
+
puts "\n\n"
|
68
|
+
# --------------------------------------------
|
69
|
+
# if the user input has nothing to do with the help or version options this code is run
|
70
|
+
elsif ARGV.length == 1 and ARGV[0] != "version" or ARGV[0] != "help" or ARGV[0] != '-version' or ARGV[0] != "-v"
|
71
|
+
# line 68 catches any user input that relates to .xls files in the form of
|
72
|
+
# prune-erickson yourfile.xls [digit] outputfile.xls
|
73
|
+
if ARGV[0] =~ /(http)+[\S]*/
|
74
|
+
puts "program"
|
75
|
+
driver = Selenium::WebDriver.for :firefox
|
76
|
+
com_codes.each do |com|
|
77
|
+
driver.navigate.to "#{url}"+"?from="+"#{com}".upcase
|
78
|
+
driver.save_screenshot("#{com}".upcase+".png")
|
79
|
+
puts "#{com}".upcase
|
80
|
+
end
|
81
|
+
|
82
|
+
size.each do |key, number|
|
83
|
+
driver.navigate.to "#{url}"
|
84
|
+
puts key
|
85
|
+
driver.manage.window.resize_to(number-50,800)
|
86
|
+
driver.save_screenshot("#{number}".upcase+".png")
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
else
|
91
|
+
print "\n
|
92
|
+
Are you trying to use auto-print?
|
93
|
+
why dont you try this command:\n\n
|
94
|
+
auto-print help \n\n\n
|
95
|
+
"
|
96
|
+
end
|
97
|
+
end
|
data/lib/auto-print.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'selenium-webdriver'
|
3
|
+
require 'colorize'
|
3
4
|
#################
|
4
5
|
# COMMAND
|
5
6
|
#################
|
@@ -13,17 +14,82 @@ size = {
|
|
13
14
|
'xsmall' => 768,
|
14
15
|
'mobile' => 400
|
15
16
|
}
|
16
|
-
driver = Selenium::WebDriver.for :firefox
|
17
17
|
|
18
|
-
com_codes.each do |com|
|
19
|
-
driver.navigate.to "#{url}"+"?from="+"#{com}".upcase
|
20
|
-
driver.save_screenshot("#{com}".upcase+".png")
|
21
|
-
puts "#{com}".upcase
|
22
|
-
end
|
23
18
|
|
24
|
-
|
25
|
-
|
26
|
-
puts
|
27
|
-
|
28
|
-
|
19
|
+
|
20
|
+
if ARGV.length == 1 and ARGV[0] == "help"
|
21
|
+
puts "
|
22
|
+
______________________
|
23
|
+
| |
|
24
|
+
| A U T O P R I N T |
|
25
|
+
| |
|
26
|
+
| ~~~~~~~~~~~~~~~~~ |
|
27
|
+
| ~~~~~~~~~~~~~~~~~ |
|
28
|
+
| ~~~~~~~~~~~~~~~~~ |
|
29
|
+
| ~~~~~~~~~~~~~~~~~ |
|
30
|
+
| ~~~~~~~~~~~~~~~~~ |
|
31
|
+
| ~~~~~~~~~~~~~~~~~ |
|
32
|
+
L____________________|
|
33
|
+
|
34
|
+
".cyan
|
35
|
+
|
36
|
+
puts " THE AUTOMATED PRINTING PROGRAM ".yellow.blink
|
37
|
+
|
38
|
+
puts "this program has been written to automate the process of preparing screenshots and printing them for strategy to pass their aproval. instead of taking hours to compile the necessary images, you can print them in seconds!
|
39
|
+
|
40
|
+
this also makes things easier when uploading to NOOSH
|
41
|
+
|
42
|
+
to run the program run this command:\n\n"
|
43
|
+
|
44
|
+
puts "auto-print [url]\n".yellow
|
45
|
+
|
46
|
+
print "where "
|
47
|
+
print " [url] ".yellow
|
48
|
+
puts "is the webpage you wish to make a screenshot\n\n"
|
49
|
+
|
50
|
+
puts "make sure to not unclude any javascript variables in the url\n".red
|
51
|
+
|
52
|
+
puts "you will be asked to answer a few questions about your project and then the necessary files will be created.
|
53
|
+
make sure to delete any community webpages that were generated that are not apart of your campaign."
|
54
|
+
|
55
|
+
|
56
|
+
elsif ARGV.length == 1 and (ARGV[0] == "-v" or ARGV[0] == "-version" or ARGV[0] == "version")
|
57
|
+
|
58
|
+
puts "
|
59
|
+
__________________________
|
60
|
+
| VERSION 0.1.0 |
|
61
|
+
--------------------------
|
62
|
+
".colorize(:yellow)
|
63
|
+
puts " the use of this program is open source, but intended for the needs of Erickson Living employees only. if you wish to make a pull request you may do so at \n\n".yellow
|
64
|
+
puts "https://github.com/alejandro-londono/auto-print".colorize(:color=>:white, :background=>:blue)
|
65
|
+
puts "\n\n"
|
66
|
+
# --------------------------------------------
|
67
|
+
# if the user input has nothing to do with the help or version options this code is run
|
68
|
+
elsif ARGV.length == 1 and ARGV[0] != "version" or ARGV[0] != "help" or ARGV[0] != '-version' or ARGV[0] != "-v"
|
69
|
+
# line 68 catches any user input that relates to .xls files in the form of
|
70
|
+
# prune-erickson yourfile.xls [digit] outputfile.xls
|
71
|
+
if ARGV[0] =~ /(http)+[\S]*/
|
72
|
+
puts "program"
|
73
|
+
driver = Selenium::WebDriver.for :firefox
|
74
|
+
com_codes.each do |com|
|
75
|
+
driver.navigate.to "#{url}"+"?from="+"#{com}".upcase
|
76
|
+
driver.save_screenshot("#{com}".upcase+".png")
|
77
|
+
puts "#{com}".upcase
|
78
|
+
end
|
79
|
+
|
80
|
+
size.each do |key, number|
|
81
|
+
driver.navigate.to "#{url}"
|
82
|
+
puts key
|
83
|
+
driver.manage.window.resize_to(number-50,800)
|
84
|
+
driver.save_screenshot("#{number}".upcase+".png")
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
else
|
89
|
+
print "\n
|
90
|
+
Are you trying to use auto-print?
|
91
|
+
why dont you try this command:\n\n
|
92
|
+
auto-print help \n\n\n
|
93
|
+
"
|
94
|
+
end
|
29
95
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto-print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alejandro Londono
|
@@ -50,6 +50,26 @@ dependencies:
|
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 2.48.1
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: colorize
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0.0'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.7.7
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0.0'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 0.7.7
|
53
73
|
description: automated image processing for url versioning in the erickson living
|
54
74
|
corporation
|
55
75
|
email: alejandro.londono@erickson.com
|