oc 0.0.9 → 0.1.0

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: 0d074a9487fcacce6033c9a6ffa5c796f6bb378f
4
- data.tar.gz: c5f1094f985d74bd5f8cbf87bce07b79320788b1
3
+ metadata.gz: 9c6c540ce620b7a8a9f090f8c278a0276c2b39d3
4
+ data.tar.gz: c700040a0a0e3adae614b1ea625d2e4f3ad50d91
5
5
  SHA512:
6
- metadata.gz: 672e890f29dab2511e06d64ac7bbac933210015e6d9e5417b0384fbb8f48d2a7293da4fbe78ef749c8a5f4f5c5b478e67ee44e377fbae2f8446f87b07d4087a3
7
- data.tar.gz: 5f1f9492e0493830937ba15ab7ca913c1d1a04d39a512dabcafecf4cbac281c5bd0ba52c20c48dbb7d0f3b4c08880fa8b5070d20f80cd666eb8ddfbdf643989b
6
+ metadata.gz: ae2d17626a62a4c46fea3c7aa8abb205679feb991b0f47f194bf2a68c13c5602ea7cfec52af79816ba92780ca3f69a9da7bc44b845a5f7a669e73ade720b1f22
7
+ data.tar.gz: 5af617b6443dedb5c07ba8cb5f5dd20b26aecaa9866d8fa1143361603d5d7e878333149b7232988d5fd53ede46b1f7a16b3ba2ebab1caa3786abffbf1041e2d0
data/README.md CHANGED
@@ -63,13 +63,13 @@ Or install it yourself as:
63
63
  $ oc ssh keys
64
64
 
65
65
  Add SSH Key
66
- $ oc ssh add [KEY_NAME] [KEY_EMAIL] [KEY_PUB]
66
+ $ oc ssh add [KEY_NAME] [KEY_PUB]
67
67
 
68
68
  Show SSH Key
69
69
  $ oc ssh show [KEY_ID]
70
70
 
71
71
  Edit SSH Key
72
- $ oc ssh edit [KEY_ID] [KEY_NAME] [KEY_EMAIL] [KEY_PUB]
72
+ $ oc ssh edit [KEY_ID] [KEY_NAME] [KEY_PUB]
73
73
 
74
74
  Destroy SSH Key
75
75
  $ oc ssh destroy [KEY_ID]
data/lib/oc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oc
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/system/get.rb CHANGED
@@ -3,66 +3,8 @@ require "json"
3
3
  require "barge"
4
4
  module Oc
5
5
  class Get
6
- def self.get_json path,filter=nil
7
- source = "https://api.digitalocean.com/#{path}/?client_id=#{Oc::Config.get("client_id")}&api_key=#{Oc::Config.get("api_key")}&filter=#{filter}"
8
- puts "I'm thinking, please wait..".blue
9
- response = Net::HTTP.get_response(URI.parse(source))
10
- data = response.body
11
- result = JSON.parse(data)
12
- end
13
-
14
6
  def self.get_barge
15
7
  barge = ::Barge::Client.new(access_token: Oc::Config.get(:api_key))
16
8
  end
17
-
18
-
19
- def self.get_json_parameter path, sub_path = nil ,parameters=[]
20
- url = "https://api.digitalocean.com/#{path}"
21
-
22
- unless sub_path.nil?
23
- url += "/#{sub_path}"
24
- end
25
-
26
- url += "?client_id=#{Oc::Config.get("client_id")}&api_key=#{Oc::Config.get("api_key")}"
27
-
28
- parameter = ""
29
- if parameters.length > 0
30
- parameters.each do |p,v|
31
- parameter += "&#{p}=#{v}"
32
- end
33
- end
34
-
35
- parameter = URI::escape(parameter)
36
-
37
- source = url + parameter
38
-
39
- puts "I'm thinking, please wait..".blue
40
- response = Net::HTTP.get_response(URI.parse(source))
41
- data = response.body
42
- result = JSON.parse(data)
43
- end
44
-
45
-
46
- def self.get_json_url url ,parameters=[]
47
-
48
- url += "?client_id=#{Oc::Config.get("client_id")}&api_key=#{Oc::Config.get("api_key")}"
49
-
50
- parameter = ""
51
- if parameters.length > 0
52
- parameters.each do |p,v|
53
- parameter += "&#{p}=#{v}"
54
- end
55
- end
56
-
57
- parameter = URI::escape(parameter)
58
-
59
- source = url + parameter
60
-
61
- puts "I'm thinking, please wait..".blue
62
- response = Net::HTTP.get_response(URI.parse(source))
63
- data = response.body
64
- result = JSON.parse(data)
65
- end
66
-
67
9
  end
68
10
  end
@@ -40,7 +40,7 @@ module Oc::Run
40
40
  if name.nil? or pub_key.nil?
41
41
  puts "Argument Error".red
42
42
  puts "Usage".yellow
43
- puts "$ oc ssh add [KEY_NAME] [KEY_EMAIL] [KEY_PUB]".yellow
43
+ puts "$ oc ssh add [KEY_NAME] [KEY_PUB]".yellow
44
44
  else
45
45
  result = barge.key.create({
46
46
  :name => name,
@@ -90,7 +90,7 @@ module Oc::Run
90
90
  end
91
91
 
92
92
  description "This method allows you to modify an existing public SSH key in your account."
93
- syntax "oc ssh edit [KEY_ID] [KEY_NAME] [KEY_EMAIL] [KEY_PUB]"
93
+ syntax "oc ssh edit [KEY_ID] [KEY_NAME] [KEY_PUB]"
94
94
 
95
95
  def update(*args)
96
96
  id = args[0]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sedat Ciftci