project_btorretta 0.0.2

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.
Files changed (2) hide show
  1. data/project_btorretta.rb +34 -0
  2. metadata +45 -0
@@ -0,0 +1,34 @@
1
+ require 'net/https'
2
+ class Servicedesk
3
+ # This is just meant to take in a ticket from a user prompt and pass back the status
4
+ # example: input 671148 at the command prompt
5
+ #no arguments needed
6
+ #This is my documentation
7
+ #note at the moment, its specific to the my environment, so I'll have to make it general as a gem. To use it as your own, you'd want to stub in your api and u/p
8
+
9
+
10
+
11
+
12
+
13
+
14
+ attr_accessor :ticket
15
+ def initialize
16
+ @ticket = ticket
17
+ end
18
+ def lets_ask(*ticket)
19
+ i = puts "What is your ticket number?"
20
+ ticket = gets.chomp
21
+ ticket = ticket.to_i
22
+ site = Net::HTTP.new(yourapihere.com", 443)
23
+ site.use_ssl = true
24
+ response = site.get2("/v1/incident/IUAT#{ticket}.yaml", 'Authorization' =>'Basic ' + ["user:password"].pack('m').strip)
25
+ puts response.body
26
+ if response.body.match("error") then raise SyntaxError.new('Please enter your Incident number without letters, for example 671148') end
27
+ end
28
+ #n= Servicedesk.new
29
+ #n.lets_ask
30
+ end
31
+ class ServiceDesk2 <Servicedesk
32
+ n= Servicedesk.new
33
+ n.lets_ask
34
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: project_btorretta
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brian Torretta
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-08 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: api ticket checker
15
+ email: bshields18@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - project_btorretta.rb
21
+ homepage: https://rubygems.org/gems/project_btorretta
22
+ licenses: []
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 1.8.24
42
+ signing_key:
43
+ specification_version: 3
44
+ summary: proj!
45
+ test_files: []