codegears 0.0.12.pre → 0.0.13.pre
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.
- data/lib/cg/api.rb +7 -2
- data/lib/cg/command/app.rb +12 -1
- data/lib/cg/version.rb +1 -1
- data/lib/generators/cg/install/install_generator.rb +1 -1
- metadata +1 -1
data/lib/cg/api.rb
CHANGED
@@ -3,9 +3,14 @@ require "httparty"
|
|
3
3
|
module CG
|
4
4
|
class API
|
5
5
|
include HTTParty
|
6
|
+
ROOT_URL = "http://localhost:3000"
|
6
7
|
|
7
|
-
def self.
|
8
|
-
self.post("
|
8
|
+
def self.create_app_request(email)
|
9
|
+
self.post("#{ROOT_URL}/apps", :body => { :application => { :email => email } })
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.show_app_request(id)
|
13
|
+
self.get("#{ROOT_URL}/apps/#{id}")
|
9
14
|
end
|
10
15
|
end
|
11
16
|
end
|
data/lib/cg/command/app.rb
CHANGED
@@ -4,7 +4,7 @@ require "colorize"
|
|
4
4
|
module Command
|
5
5
|
class App
|
6
6
|
def self.create(email = "")
|
7
|
-
response = CG::API.
|
7
|
+
response = CG::API.create_app_request(email)
|
8
8
|
if response["success"] == false
|
9
9
|
response["errors"].each do |k,v|
|
10
10
|
puts "#{k.capitalize} #{v.first}\n".red
|
@@ -21,5 +21,16 @@ module Command
|
|
21
21
|
puts "And restart application to start using the CodeGears platform.".green
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
def self.main(id = "")
|
26
|
+
puts "Application ID can't be blank".red and return if id.blank?
|
27
|
+
response = CG::API.show_app_request(id)
|
28
|
+
if response["success"] == false
|
29
|
+
puts "Application not found".red
|
30
|
+
else
|
31
|
+
status = response["active"]
|
32
|
+
puts "Active: #{status}".send(status ? :green : :red)
|
33
|
+
end
|
34
|
+
end
|
24
35
|
end
|
25
36
|
end
|
data/lib/cg/version.rb
CHANGED