arukas 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a3d34e78199d3f9915776073ee4bf3035ea15aa775e264d7c9c7f6d6c95892b7
4
+ data.tar.gz: 5adb85b7f184b6a37fadec977c3a0beb970a6d84c20b8a486442afe24109592f
5
+ SHA512:
6
+ metadata.gz: a132c849bf1fc5ec74eca52c7b4b7113d70bd3cfeb07439108eb1cf73c9a39e2be2ed259612f59ed61bd0d0352d424672d0c8d4192f330711ede0af5ae75f2be
7
+ data.tar.gz: 7e922a6835fd2dc95ab0db40244fe9d8be8d29aa6be63906f0060817b449cf0140f29e30f0aa3c83c73985a6f70c34ec0a8072557d899d76282f5b73ab3897cc
data/.env.sample ADDED
@@ -0,0 +1,2 @@
1
+ ARUKAS_JSON_API_TOKEN=
2
+ ARUKAS_JSON_API_SECRET=
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /.env
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 2.0.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in arukas.gemspec
4
+ gemspec
5
+
6
+ gem "rest-client"
data/Gemfile.lock ADDED
@@ -0,0 +1,45 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ arukas (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ domain_name (0.5.20180417)
10
+ unf (>= 0.0.5, < 1.0.0)
11
+ ffi (1.10.0-x64-mingw32)
12
+ http-cookie (1.0.3)
13
+ domain_name (~> 0.5)
14
+ mime-types (3.2.2)
15
+ mime-types-data (~> 3.2015)
16
+ mime-types-data (3.2019.0331)
17
+ minitest (5.11.3)
18
+ netrc (0.11.0)
19
+ rake (10.5.0)
20
+ rest-client (2.0.2)
21
+ http-cookie (>= 1.0.2, < 2.0)
22
+ mime-types (>= 1.16, < 4.0)
23
+ netrc (~> 0.8)
24
+ rest-client (2.0.2-x64-mingw32)
25
+ ffi (~> 1.9)
26
+ http-cookie (>= 1.0.2, < 2.0)
27
+ mime-types (>= 1.16, < 4.0)
28
+ netrc (~> 0.8)
29
+ unf (0.1.4)
30
+ unf_ext
31
+ unf_ext (0.0.7.6)
32
+
33
+ PLATFORMS
34
+ ruby
35
+ x64-mingw32
36
+
37
+ DEPENDENCIES
38
+ arukas!
39
+ bundler (~> 2.0)
40
+ minitest (~> 5.0)
41
+ rake (~> 10.0)
42
+ rest-client
43
+
44
+ BUNDLED WITH
45
+ 2.0.1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 S.H.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Arukas
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/arukas`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'arukas'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install arukas
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/arukas.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
data/arukas.gemspec ADDED
@@ -0,0 +1,28 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "arukas/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "arukas"
8
+ spec.version = Arukas::VERSION
9
+ spec.authors = "S.H."
10
+ spec.email = "gamelinks007@gmail.com"
11
+
12
+ spec.summary = "Arukas Ruby Client"
13
+ spec.description = "Arukas Ruby Client"
14
+ spec.homepage = "https://github.com/S-H-GAMELINKS"
15
+
16
+ # Specify which files should be added to the gem when it is released.
17
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ end
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 2.0"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "minitest", "~> 5.0"
28
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "arukas"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/arukas.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "arukas/version"
2
+ require "arukas/api"
3
+
4
+ module Arukas
5
+ class Error < StandardError; end
6
+ # Your code goes here...
7
+ end
data/lib/arukas/api.rb ADDED
@@ -0,0 +1,26 @@
1
+ require "rest-client"
2
+ require "json"
3
+
4
+ module Arukas
5
+ class API
6
+ def initialize(token, secret)
7
+ @url = "https://#{token}:#{secret}@app.arukas.io/api/apps/"
8
+ end
9
+
10
+ def get_apps
11
+ RestClient.get @url
12
+ end
13
+
14
+ def create_apps(params)
15
+ RestClient.post @url, payload=params, {:content_type => :json}
16
+ end
17
+
18
+ def get_app(id)
19
+ RestClient.get @url + "#{id}"
20
+ end
21
+
22
+ def delete_app(id)
23
+ RestClient.delete @url + "#{id}"
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ module Arukas
2
+ VERSION = "0.1.0"
3
+ end
data/test.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "data":{
3
+ "type": "apps",
4
+ "attributes": {
5
+ "name": "myapp"
6
+ },
7
+ "relationships": {
8
+ "services": {
9
+ "data": [
10
+ {
11
+ "lid": "1",
12
+ "type": "services"
13
+ }
14
+ ]
15
+ }
16
+ }
17
+ },
18
+ "included": [
19
+ {
20
+ "lid": "1",
21
+ "type": "services",
22
+ "attributes": {
23
+ "command": "",
24
+ "custom-domain": "",
25
+ "image": "nginx",
26
+ "instances": 1,
27
+ "ports": [
28
+ {
29
+ "number": "80",
30
+ "protocol": "tcp"
31
+ },
32
+ {
33
+ "number": "443",
34
+ "protocol": "tcp"
35
+ }
36
+ ],
37
+ "environment": [
38
+ ],
39
+ "subdomain": ""
40
+ },
41
+ "relationships": {
42
+ "service-plan": {
43
+ "data": {
44
+ "type": "service-plans",
45
+ "id": "jp-tokyo/hobby"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ ]
51
+ }
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arukas
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - S.H.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ description: Arukas Ruby Client
56
+ email: gamelinks007@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - ".env.sample"
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - Gemfile
65
+ - Gemfile.lock
66
+ - LICENSE
67
+ - README.md
68
+ - Rakefile
69
+ - arukas.gemspec
70
+ - bin/console
71
+ - bin/setup
72
+ - lib/arukas.rb
73
+ - lib/arukas/api.rb
74
+ - lib/arukas/version.rb
75
+ - test.json
76
+ homepage: https://github.com/S-H-GAMELINKS
77
+ licenses: []
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubygems_version: 3.0.3
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Arukas Ruby Client
98
+ test_files: []