project_btorretta 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/project_btorretta.rb +29 -34
  2. metadata +1 -1
@@ -1,34 +1,29 @@
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
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
+ # Arguments: this doesn't have a CLI mode, so only thing to be passed is a ticket number
6
+ #following guidelines at http://guides.rubygems.org/make-your-own-gem/#documenting-code
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. I really should have used rspec mocks to fake an api with data in it.
8
+
9
+ attr_accessor :ticket
10
+ def initialize
11
+ @ticket = ticket
12
+ end
13
+ def lets_ask(*ticket)
14
+ i = puts "What is your ticket number?"
15
+ ticket = gets.chomp
16
+ ticket = ticket.to_i
17
+ site = Net::HTTP.new(yourapihere.com", 443)
18
+ site.use_ssl = true
19
+ response = site.get2("/v1/incident/IUAT#{ticket}.yaml", 'Authorization' =>'Basic ' + ["user:password"].pack('m').strip)
20
+ puts response.body
21
+ if response.body.match("error") then raise SyntaxError.new('Please enter your Incident number without letters, for example 671148') end
22
+ end
23
+ #n= Servicedesk.new
24
+ #n.lets_ask
25
+ end
26
+ class ServiceDesk2 <Servicedesk
27
+ n= Servicedesk.new
28
+ n.lets_ask
29
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: project_btorretta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: