banner_jobsub 0.1.0 → 0.1.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/CHANGELOG.md +3 -0
- data/README.md +2 -1
- data/examples/gyrschd +3 -3
- data/lib/banner_jobsub.rb +18 -1
- data/lib/banner_jobsub/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23b8ca3b640888b4a2cb2fc16840bad1e9fa8e8a
|
4
|
+
data.tar.gz: cd9d795a8295a091a5128095234f54a537caa4f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07913929a2188fb000253747d58dc25b89698f7a667aa75a43deeec713f68326bcdae37e34d5f280db3ad140e95477fec4f2c8c806a599caf60772385ba4da49
|
7
|
+
data.tar.gz: 7cd08129355065f0583fe86260402cd4bd1ca8ed7a3b3a46524168fe4173fdfa5f1bef7c524894ce0b760222d0b1a974f5d0f1d79b23d396c0f414c73c9045c1
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -27,6 +27,7 @@ More options and configuration values are covered below.
|
|
27
27
|
|
28
28
|
## Installing a Job
|
29
29
|
Setting up a Ruby program to run via jobsub / INB GJAPCTL is basically the same a compiled Pro*C:
|
30
|
+
|
30
31
|
1. Create necessary job and security entries in Banner (GJBJOBS, GJBPDEF, etc) like a normal Pro*C job.
|
31
32
|
2. Place Ruby program _without an extension_ ("gyrruby" in this example) in `$BANNER_HOME/general/exe` (or symlink it there from the appropriate "mods" directory, up to you).
|
32
33
|
3. Set the executable bit on the program:`chmod +x $BANNER_HOME/general/exe/gyrruby`
|
@@ -59,4 +60,4 @@ end_date: 31-DEC-2015
|
|
59
60
|
|
60
61
|
If not found, BannerJobsub will prompt for each parameter in turn. Multi-value parameters should be separated by a comma.
|
61
62
|
|
62
|
-
**Output Formatting**: BannerJobsub suggests using [formatr](https://rubygems.org/gems/formatr) for tabular/fixed output formatting, as it provides "visual" layouts (perlform, essentially). Much easier than using `table(...)` based formatting. `BannerJobsub::Base#print_header` and `BannerJobsub::Base#print_footer` provide simple page header/footer outputs. More information can found at the [formatr docs](http://www.rubydoc.info/gems/formatr/1.10.1/FormatR/Format), the [perlform docs](http://perldoc.perl.org/perlform.html), and in the provided [output example](examples/
|
63
|
+
**Output Formatting**: BannerJobsub suggests using [formatr](https://rubygems.org/gems/formatr) for tabular/fixed output formatting, as it provides "visual" layouts (perlform, essentially). Much easier than using `table(...)` based formatting. `BannerJobsub::Base#print_header` and `BannerJobsub::Base#print_footer` provide simple page header/footer outputs. More information can found at the [formatr docs](http://www.rubydoc.info/gems/formatr/1.10.1/FormatR/Format), the [perlform docs](http://perldoc.perl.org/perlform.html), and in the provided simple [output example](examples/gyrruby).
|
data/examples/gyrschd
CHANGED
@@ -12,7 +12,7 @@ require 'ostruct'
|
|
12
12
|
# be careful running this in a real environment
|
13
13
|
|
14
14
|
# This is a terrible way to send email, btw. Use something like Pony for real use.
|
15
|
-
# Or if you're going to send a _lot_ of email, an
|
15
|
+
# Or if you're going to send a _lot_ of email, an asynchronous worker system
|
16
16
|
# like resque
|
17
17
|
def send_email(to:, body:, opts: {})
|
18
18
|
opts[:server] ||= 'smtp.myschool.edu'
|
@@ -50,7 +50,7 @@ cur.exec(@ban_env.params[:term_code])
|
|
50
50
|
while (row = cur.fetch_hash) do
|
51
51
|
r = row.each_with_object({}) { |(k, v), m| m[k.downcase.to_sym] = v } #convert upcase column name to symbols
|
52
52
|
@instructors[r[:pidm]] = r
|
53
|
-
@instructors[r[:pidm]][
|
53
|
+
@instructors[r[:pidm]][:sections] = []
|
54
54
|
end
|
55
55
|
cur.close
|
56
56
|
|
@@ -59,7 +59,7 @@ cur = @ban_env.conn.parse(@sql_get_sections)
|
|
59
59
|
cur.exec(@ban_env.params[:term_code])
|
60
60
|
while (row = cur.fetch_hash) do
|
61
61
|
r = row.each_with_object({}) { |(k, v), m| m[k.downcase.to_sym] = v }
|
62
|
-
@instructors[r[:pidm]][
|
62
|
+
@instructors[r[:pidm]][:sections] << r
|
63
63
|
end
|
64
64
|
cur.close
|
65
65
|
|
data/lib/banner_jobsub.rb
CHANGED
@@ -5,6 +5,23 @@ require 'yaml'
|
|
5
5
|
require 'banner_jobsub/version'
|
6
6
|
|
7
7
|
module BannerJobsub
|
8
|
+
##
|
9
|
+
# Represents the current Banner environment the job is running in. At initilization,
|
10
|
+
# configuration values are loaded from three sources (in increasing order of precedence):
|
11
|
+
# - $BANNER_HOME/admin/banner_jobsub.yaml
|
12
|
+
# - ~/.banner_jobsub
|
13
|
+
# - +opts+ parameter of +new+
|
14
|
+
#
|
15
|
+
# Avaliable configuration values are:
|
16
|
+
# * +username+ : The username used to connect to Banner database. (Defaults to $BANUID)
|
17
|
+
# * +password+ : The password for +username+. (Defaults to $PSWD)
|
18
|
+
# * +instance+ : The tnsnames name to connect to. (Defaults to $ORACLE_SID)
|
19
|
+
# * +seed_one+ : The SEED1 value for the Banner instance.
|
20
|
+
# * +seed_three+ : The SEED3 value for the Banner instance.
|
21
|
+
# * +page_length+ : The default page length for FormatR output, configuration values are trumped by parameter #99 from jobsub. (Defaults to 55)
|
22
|
+
# * +footer+ : The default footer for FormatR output. (Defaults to '\f')
|
23
|
+
# * +header+ : The default header for FormatR output.
|
24
|
+
#
|
8
25
|
class Base
|
9
26
|
attr_reader :name, :title, :params, :conn, :header, :footer, :log, :page_length
|
10
27
|
|
@@ -88,7 +105,7 @@ module BannerJobsub
|
|
88
105
|
while (r = cur.fetch_hash)
|
89
106
|
p_num = r['GJBPRUN_NUMBER'].to_i
|
90
107
|
if p_num == 99
|
91
|
-
@page_length = r['GJBPRUN_VALUE'].to_i
|
108
|
+
@page_length = r['GJBPRUN_VALUE'].nil? ? nil : r['GJBPRUN_VALUE'].to_i
|
92
109
|
next
|
93
110
|
end
|
94
111
|
if p_num > params.count then fail "FATAL: GJBPRUN parameter number #{p_num} greater than passed parameter list." end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: banner_jobsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Dillon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-oci8
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- ".rspec"
|
92
92
|
- ".rubocop.yml"
|
93
93
|
- ".travis.yml"
|
94
|
+
- CHANGELOG.md
|
94
95
|
- Gemfile
|
95
96
|
- LICENSE.txt
|
96
97
|
- README.md
|
@@ -126,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
127
|
version: '0'
|
127
128
|
requirements: []
|
128
129
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.5.1
|
130
131
|
signing_key:
|
131
132
|
specification_version: 4
|
132
133
|
summary: '"Write Ellucian Banner Jobsub jobs in Ruby."'
|