uniara_virtual_cli 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 590653e88d6fceb1f80b88cb88cdf77f678008e7
4
+ data.tar.gz: 900dc3177f582d6fc94e3e49977c67721cf40d4a
5
+ SHA512:
6
+ metadata.gz: 20180f1936a73c33c3765ec57ada58dfada636673b7294db008b5f70d99753e1645f96dc61f2fc2246e82e7ff90e2a5087d09e10299314c88ac81c40e7e57609
7
+ data.tar.gz: c183eae5c3b26e2d0e45597374967632a49657e75b65893b56eb8481ac4ab303c1272774243c29e3ca64c710c53eee979fd42f32c03c0bbf225b8ec584ca6890
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ uniara_virtual_cli
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in uniara_virtual_cli.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Carlos Ribeiro
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # UniaraVirtualCli
2
+
3
+ A basic gem to retrieve grades from uniara virtual
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'uniara_virtual_cli'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install uniara_virtual_cli
20
+
21
+ ## Usage
22
+
23
+ ### Retrieve Grades
24
+
25
+ ```
26
+ uniara_virtual grades
27
+ ```
28
+
29
+
30
+ ## Contributing
31
+
32
+ 1. Fork it ( https://github.com/[my-github-username]/uniara_virtual_cli/fork )
33
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
34
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
35
+ 4. Push to the branch (`git push origin my-new-feature`)
36
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'commander/import'
5
+ require 'uniara_virtual_parser'
6
+ require 'terminal-table'
7
+
8
+ program :version, '0.0.1'
9
+ program :description, 'A CLI to access Uniara Virtual'
10
+
11
+ =begin
12
+ command :login, do |c|
13
+ c.syntax = 'uniara_virtual login, [options]'
14
+ c.summary = ''
15
+ c.description = ''
16
+ c.example 'description', 'command example'
17
+ c.option '--some-switch', 'Some switch that does something'
18
+ c.action do |args, options|
19
+ # Do something or c.when_called Uniara_virtual::Commands::Login,
20
+ end
21
+ end
22
+ =end
23
+
24
+ command :grades do |c|
25
+ c.syntax = 'uniara_virtual grades'
26
+ c.summary = 'Retrieve the grades'
27
+ c.description = ''
28
+ c.example 'description', 'command example'
29
+ c.action do |args, options|
30
+ ra = ask 'RA:'
31
+ token = UniaraVirtualParser.login ra, password
32
+ rows = []
33
+ #rows << ['', '1o bim.', '2o bim', '3o bim', '4o bim']
34
+ UniaraVirtualParser.grades(token).each do |grade|
35
+ rows << [grade.name, grade.first_bimester, grade.second_bimester, grade.third_bimester, grade.fourth_bimester]
36
+ end
37
+
38
+ table = Terminal::Table.new rows: rows, headings: ['Matéria', '1o bim', '2o bim', '3o bim', '4o bim']
39
+
40
+ puts table
41
+ end
42
+ end
43
+
@@ -0,0 +1,3 @@
1
+ module UniaraVirtualCli
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,5 @@
1
+ require "uniara_virtual_cli/version"
2
+
3
+ module UniaraVirtualCli
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'uniara_virtual_cli/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "uniara_virtual_cli"
8
+ spec.version = UniaraVirtualCli::VERSION
9
+ spec.authors = ["Kadu Ribeiro"]
10
+ spec.email = ["mail@carlosribeiro.me"]
11
+ spec.summary = "Uniara Virtual CLI"
12
+ spec.description = "CLI to access your Uniara Virtual grades from your terminal"
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "terminal-table", "~> 1.4.5"
22
+ spec.add_dependency "uniara_virtual_parser", "~> 0.0.2"
23
+ spec.add_development_dependency "bundler", "~> 1.7"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: uniara_virtual_cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kadu Ribeiro
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: terminal-table
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.4.5
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.4.5
27
+ - !ruby/object:Gem::Dependency
28
+ name: uniara_virtual_parser
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description: CLI to access your Uniara Virtual grades from your terminal
70
+ email:
71
+ - mail@carlosribeiro.me
72
+ executables:
73
+ - uniara_virtual.rb
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".ruby-gemset"
79
+ - ".ruby-version"
80
+ - Gemfile
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - bin/uniara_virtual.rb
85
+ - lib/uniara_virtual_cli.rb
86
+ - lib/uniara_virtual_cli/version.rb
87
+ - uniara_virtual_cli.gemspec
88
+ homepage: ''
89
+ licenses:
90
+ - MIT
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 2.4.7
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: Uniara Virtual CLI
112
+ test_files: []