power_school 0.0.2 → 0.0.3

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: cc50b73510d4031bebd06fe0a6fa6156f43150de
4
- data.tar.gz: 4786e531e4d12b32db78744a3b06cd9ce1ea4409
3
+ metadata.gz: 9700dbc021b5fad2a6992e56c523a29b2365272d
4
+ data.tar.gz: ed144d2a87b9b6ff0961645e2d7354f3ca933578
5
5
  SHA512:
6
- metadata.gz: 85bb73a5dce13f7077c650627640ace436972bcd9051e62b3a7f01c3e206ff32b8fc9d3659f68b8a102035a64f86a915b070869090a1c3ec6ee453293fb96bea
7
- data.tar.gz: 780f295cb04625d45ef06103f1e98e6e95664a625b58a52d6eb8f396aaa2d97d7f886c564d3e94ddeda24b8cc77b41cae066889feff3b20753de9dedcf711113
6
+ metadata.gz: 3ee61ccbb66f61cc447958e8ad8910fc00302582c7648df0442c00d1c09eaeed0c322be4972d0b1ddd8deb2586cec10016d5628a55d6c880c97005159fe4d40d
7
+ data.tar.gz: b4e7fd22b1669b5ac8f944b24f1f330c0ea8fe9fe6c9953a9281e6d35990075d67270a58772b30005d1daf35906f254267444b2082fe2d9bfd1aa0cef3bc0c45
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p0
1
+ 2.1.0
@@ -36,7 +36,6 @@ module PowerSchool
36
36
  #self.browser ||= Watir::Browser.new(driver)
37
37
 
38
38
  self.browser ||= Watir::Browser.new :firefox, :profile => profile
39
-
40
39
  end
41
40
  end
42
41
  end
@@ -49,7 +49,7 @@ module PowerSchool
49
49
  PowerSchool::Connection.go_to "importexport/quickimport/quickimport1.html"
50
50
  PowerSchool.browser.select_list(:id, "filenumber").select table_name
51
51
  PowerSchool.browser.select_list(:id, "fielddelim").select "Other:"
52
- PowerSchool.browser.text_field(:id => 'custfielddelim').set ','
52
+ PowerSchool.browser.text_field(:id => 'custfielddelim').set ';'
53
53
  PowerSchool.browser.select_list(:id, "recdelim").select "LF"
54
54
  PowerSchool.browser.file_field(:id, "filename").set( file_name )
55
55
  PowerSchool.browser.button(:id => "btnImport").click
@@ -15,5 +15,25 @@ module PowerSchool
15
15
  def self.import(file_path)
16
16
  PowerSchool::Connection.quick_import('Students', file_path)
17
17
  end
18
+
19
+ def self.list_array( fields = ["Student_Number", "LastFirst", "Grade_Level"], css = "#content-main .box-round table tr", enroll_status = "Active" )
20
+ case enroll_status
21
+ when "Active"
22
+ PowerSchool::Connection.go_home("?selectstudent=")
23
+ when "Pre-registered"
24
+ PowerSchool::Connection.go_home("?selectstudent=/enroll_status=-1")
25
+ end
26
+ PowerSchool::Connection.go_to("studentlist/studentlist1.html")
27
+
28
+ PowerSchool::Connection.clear_form
29
+
30
+ fields.each_with_index do |field, index|
31
+ index = index + 1
32
+ PowerSchool.browser.text_field(:id => "tt"+index.to_s).set (field)
33
+ end
34
+ PowerSchool.browser.button(:id => "btnSubmit").click
35
+ student_array = PowerSchool.table_to_a( PowerSchool.browser.html, css)
36
+ end
37
+
18
38
  end
19
39
  end
@@ -1,3 +1,3 @@
1
1
  module PowerSchool
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/power_school.rb CHANGED
@@ -11,4 +11,11 @@ require 'open-uri'
11
11
  module PowerSchool
12
12
  extend Configuration
13
13
 
14
+ def self.table_to_a( html, css )
15
+ resArray = Nokogiri::HTML(html).css(css).to_a
16
+ resArray = resArray.map {|row| row.css("td").map {|c| c.text}.to_a }
17
+ resArray.shift
18
+ resArray
19
+ end
20
+
14
21
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: power_school
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauro Morales
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-16 00:00:00.000000000 Z
11
+ date: 2014-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: watir
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: capybara
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.6'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Interact with PowerSchool
@@ -101,9 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .rspec
106
- - .ruby-version
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".ruby-version"
107
107
  - Gemfile
108
108
  - LICENSE.txt
109
109
  - README.md
@@ -125,19 +125,18 @@ require_paths:
125
125
  - lib
126
126
  required_ruby_version: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - '>='
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - '>='
133
+ - - ">="
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.0.0
138
+ rubygems_version: 2.2.0
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Interact with PowerSchool by using capybara
142
142
  test_files: []
143
- has_rdoc: