theroku 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.theroku +1 -1
- data/Gemfile +2 -1
- data/bin/theroku +12 -1
- data/lib/theroku.rb +1 -1
- data/lib/theroku/create_command.rb +2 -1
- data/lib/theroku/open_command.rb +5 -0
- data/lib/theroku/update_command.rb +27 -0
- data/theroku-0.1.0.gem +0 -0
- data/theroku.gemspec +3 -2
- metadata +21 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa0ba2e25eb44511425f2764f6ea4606ba884106
|
4
|
+
data.tar.gz: b413b867571f2d078607dea79d8af9df6a32256f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bac7d06c47b7d6fd9c23f7fac9970112ca31a24296d86fac6766df7639e7b8906b0beca0cd888c0cce07305fac04aff45e8b39612917be3ea2a7b8801dc381d
|
7
|
+
data.tar.gz: 52ced739caf3e5245e11f5d13a9adc5fbc18cd31e8895e2de3fd54e53357d6c32b2347ee0c526c2ffb8eea6733574d688f7ded9725a9f806311eacc1fb8aff31
|
data/.theroku
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
fJyK8p_JqTeq5FXH8P75KA
|
data/Gemfile
CHANGED
data/bin/theroku
CHANGED
@@ -31,7 +31,8 @@ command :update do |c|
|
|
31
31
|
c.option '--url1 STRING', String, 'Changes the url1'
|
32
32
|
c.option '--url2 STRING', String, 'Changes the url2'
|
33
33
|
c.action do |args, options|
|
34
|
-
|
34
|
+
p args
|
35
|
+
UpdateCommand.new.execute(options.app_name, options.url1, options.url2, args[0])
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
@@ -40,5 +41,15 @@ command :destroy do |c|
|
|
40
41
|
c.description = 'theroku destroy <app_name>'
|
41
42
|
c.action do |args, options|
|
42
43
|
DestroyCommand.new.execute(*args)
|
44
|
+
end
|
45
|
+
|
46
|
+
command :open do |c|
|
47
|
+
c.syntax = 'theroku open'
|
48
|
+
c.description = 'theroku open'
|
49
|
+
c.action do |args, options|
|
50
|
+
CreateCommand.new.execute(*args)
|
43
51
|
end
|
44
52
|
end
|
53
|
+
|
54
|
+
|
55
|
+
end
|
data/lib/theroku.rb
CHANGED
@@ -10,7 +10,8 @@ class CreateCommand
|
|
10
10
|
headers: { 'Authorization' => "Token token=#{token}", 'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
11
11
|
)
|
12
12
|
if response.code == 200
|
13
|
-
puts "
|
13
|
+
puts "You succesfully created an application."
|
14
|
+
puts "You can now go to #{subdomain}.therokuapp.com or use theroku open!"
|
14
15
|
else
|
15
16
|
puts "Sorry, something went wrong..."
|
16
17
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class UpdateCommand
|
2
|
+
require 'httparty'
|
3
|
+
def execute(*args)
|
4
|
+
if File.exists?('.theroku')
|
5
|
+
puts "Updating #{args[0]}..."
|
6
|
+
file = File.open(".theroku", "rb")
|
7
|
+
token = file.read
|
8
|
+
body = {}
|
9
|
+
body[:url1] = args[1] if args[1]
|
10
|
+
body[:url2] = args[2] if args[2]
|
11
|
+
body[:subdomain] = args[0] if args[0]
|
12
|
+
|
13
|
+
response = HTTParty.patch("#{Theroku::base_url}apps/#{args[3]}",
|
14
|
+
body: body.to_json,
|
15
|
+
headers: { 'Authorization' => "Token token=#{token}", 'Content-Type' => 'application/json', 'Accept' => 'application/json'}
|
16
|
+
)
|
17
|
+
if response.code == 200
|
18
|
+
puts "#{args[3]}, succesfully updated!"
|
19
|
+
else
|
20
|
+
puts "There were the following errors:"
|
21
|
+
puts response["errors"].capitalize
|
22
|
+
end
|
23
|
+
else
|
24
|
+
puts "You have to login before making any changes you can do that with $ theroku login"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/theroku-0.1.0.gem
ADDED
Binary file
|
data/theroku.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'theroku/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "theroku"
|
8
|
-
spec.version = "0.1.
|
8
|
+
spec.version = "0.1.2"
|
9
9
|
spec.authors = ["alejoescobar", "simon0191", "jasmo2"]
|
10
10
|
spec.email = ["alejoescobac@gmail.com"]
|
11
11
|
spec.summary = "Awesome Heroku load balancer."
|
@@ -19,7 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
spec.bindir = 'bin'
|
21
21
|
spec.add_development_dependency('rdoc', '4.2.0')
|
22
|
-
spec.add_runtime_dependency('
|
22
|
+
spec.add_runtime_dependency('httparty', '0.13.3')
|
23
|
+
spec.add_runtime_dependency('commander', '4.3.4')
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theroku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alejoescobar
|
@@ -27,19 +27,33 @@ dependencies:
|
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 4.2.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
30
|
+
name: httparty
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
35
|
+
version: 0.13.3
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
42
|
+
version: 0.13.3
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: commander
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 4.3.4
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - '='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 4.3.4
|
43
57
|
- !ruby/object:Gem::Dependency
|
44
58
|
name: bundler
|
45
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,8 +101,11 @@ files:
|
|
87
101
|
- lib/theroku/create_command.rb
|
88
102
|
- lib/theroku/destroy_command.rb
|
89
103
|
- lib/theroku/login_command.rb
|
104
|
+
- lib/theroku/open_command.rb
|
105
|
+
- lib/theroku/update_command.rb
|
90
106
|
- lib/theroku/version.rb
|
91
107
|
- theroku-0.0.1.gem
|
108
|
+
- theroku-0.1.0.gem
|
92
109
|
- theroku.gemspec
|
93
110
|
homepage: https://github.com/alejoescobar/theroku
|
94
111
|
licenses:
|