gdm 3.2.3

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d5bd6f0fa01074569a92e297953af0349acce08fecad542d80b6f458a3d91c9e
4
+ data.tar.gz: a727baa1333bf2a5666f062d6a5bbe30afeea2f02187d24d19ff87f24575c5e4
5
+ SHA512:
6
+ metadata.gz: 26a864ee17a5247167ee3ddfb37c1db6f3a8dd8cac6fc01d33c6a09b2aa19ab6c9e5c55f9031de86453e42b7bf89e65ed034f9c822a1861e282442217b19053e
7
+ data.tar.gz: b9eb05aa55dd20a6a115c2d5995deecb49d442a22f558fb85ae3301d551b8985457852111e23cec7ebd9e10b770cbe34768baf9b0ede848477ac77a07350337f
@@ -0,0 +1,18 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0.0
14
+ - name: Run the default task
15
+ run: |
16
+ gem install bundler -v 2.2.3
17
+ bundle install
18
+ bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ /cmd/
11
+ /logs/
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.0.0
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in gdm.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
data/Gemfile.lock ADDED
@@ -0,0 +1,23 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ gdm (3.2.3)
5
+ rubyzip (= 2.3.0)
6
+ uname (= 1.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ rake (13.0.3)
12
+ rubyzip (2.3.0)
13
+ uname (1.0)
14
+
15
+ PLATFORMS
16
+ x86_64-linux
17
+
18
+ DEPENDENCIES
19
+ gdm!
20
+ rake (~> 13.0)
21
+
22
+ BUNDLED WITH
23
+ 2.2.3
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 KrakenLab
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
+ # GDM
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/gdm`. 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 'gdm'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install gdm
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. 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 the created tag, 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]/gdm.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ task default: %i[]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'gdm'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require 'pry'
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ 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/gdm.gemspec ADDED
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/gdm/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'gdm'
7
+ spec.version = GDM::VERSION
8
+ spec.authors = ['Marlon Henry Schweigert']
9
+ spec.email = ['marlon.schweigert@krakenlab.io']
10
+
11
+ spec.summary = 'Godot Manager'
12
+ spec.homepage = 'https://github.com/krakenlab/gdm'
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7.1')
14
+
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
+ spec.metadata['source_code_uri'] = spec.homepage
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
22
+ end
23
+ spec.bindir = 'cmd'
24
+ spec.executables = spec.files.grep(%r{\Acmd/}) { |f| File.basename(f) }
25
+ spec.require_paths = ['lib']
26
+
27
+ # Uncomment to register a new dependency of your gem
28
+ spec.add_dependency 'uname', '1.0'
29
+ spec.add_dependency 'rubyzip', '2.3.0'
30
+ end
data/lib/gdm.rb ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'gdm/version'
4
+ require_relative 'gdm/platform'
5
+ require_relative 'gdm/workspace'
6
+ require_relative 'gdm/repo'
7
+
8
+ module GDM
9
+ class Error < StandardError; end
10
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+ require 'uname'
3
+
4
+ module GDM
5
+ module Platform
6
+ module_function
7
+
8
+ def windows_editor_filename
9
+ "#{::GDM::Workspace::GODOT_WORKSPACE}/#{::GDM::GODOT}.exe"
10
+ end
11
+
12
+ def linux_editor_filename
13
+ "#{::GDM::Workspace::GODOT_WORKSPACE}/#{::GDM::GODOT}.o"
14
+ end
15
+
16
+ def linux_server_filename
17
+ "#{::GDM::Workspace::GODOT_SERVER_WORKSPACE}/#{::GDM::GODOT}.o"
18
+ end
19
+
20
+ def linux_headless_filename
21
+ "#{::GDM::Workspace::GODOT_HEADLESS_WORKSPACE}/#{::GDM::GODOT}.o"
22
+ end
23
+
24
+ def windows?
25
+ Gem.win_platform? || Uname.invokeUname('-a').include?('Microsoft')
26
+ end
27
+
28
+ def linux?
29
+ !windows? && RUBY_PLATFORM.include?('linux')
30
+ end
31
+
32
+ def osx?
33
+ raise 'Must be implemented :)'
34
+ end
35
+ end
36
+ end
data/lib/gdm/repo.rb ADDED
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'net/http'
4
+ require 'thread'
5
+ require 'zip'
6
+
7
+ module GDM
8
+ module Repo
9
+ LIBRARY = {
10
+ '3.2.3' => {
11
+ linux: 'https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_x11.64.zip',
12
+ osx: 'https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_osx.64.zip',
13
+ windows: 'https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_win64.exe.zip',
14
+ server: 'https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_linux_server.64.zip',
15
+ headless: 'https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_linux_headless.64.zip',
16
+ template: 'https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_export_templates.tpz',
17
+ }
18
+ }
19
+
20
+ CURRENT = LIBRARY[::GDM::GODOT]
21
+ end
22
+
23
+ module Editor
24
+
25
+ module_function
26
+
27
+ def windows_install
28
+ filename = ::GDM::Platform.windows_editor_filename
29
+ url = ::GDM::Repo::CURRENT[:windows]
30
+ donwload(filename, url)
31
+ end
32
+
33
+ def linux_install
34
+ t1 = Thread.new do
35
+ filename = ::GDM::Platform.linux_editor_filename
36
+ url = ::GDM::Repo::CURRENT[:linux]
37
+ donwload(filename, url)
38
+ end
39
+
40
+ t2 = Thread.new do
41
+ filename = ::GDM::Platform.linux_server_filename
42
+ url = ::GDM::Repo::CURRENT[:server]
43
+ donwload(filename, url)
44
+ end
45
+
46
+ t3 = Thread.new do
47
+ filename = ::GDM::Platform.linux_headless_filename
48
+ url = ::GDM::Repo::CURRENT[:headless]
49
+ donwload(filename, url)
50
+ end
51
+
52
+ [t1, t2, t3].map(&:join)
53
+ end
54
+
55
+ def donwload(filename, url, ext = 'zip')
56
+ filename_ext = "#{filename}.#{ext}"
57
+ puts "downloading #{filename_ext}"
58
+
59
+ ::File.open(filename_ext, 'wb') do |file|
60
+ file.write(Net::HTTP.get(URI(url)))
61
+ end unless File.exists?(filename_ext)
62
+
63
+ puts "#{filename_ext} downloaded"
64
+
65
+ unzip(filename_ext, filename)
66
+ end
67
+
68
+ def unzip(zipname, filename)
69
+ ::Zip::File.open(zipname).each do |file|
70
+ file.extract(filename) unless File.exists?(filename)
71
+ end
72
+
73
+ File.chmod(0777, filename) if ::GDM::Platform.linux?
74
+
75
+ puts("#{filename} unziped")
76
+ end
77
+
78
+ def install
79
+ windows_install if ::GDM::Platform.windows?
80
+ linux_install if ::GDM::Platform.linux?
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GDM
4
+ VERSION = '3.2.3'
5
+ GODOT = ENV['GODOT'] || VERSION
6
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module GDM
6
+ module Workspace
7
+ GODOT_WORKSPACE = File.expand_path('~/.gdm/godot')
8
+ GODOT_SERVER_WORKSPACE = File.expand_path('~/.gdm/server')
9
+ GODOT_HEADLESS_WORKSPACE = File.expand_path('~/.gdm/headless')
10
+
11
+ module_function
12
+
13
+ def create
14
+ ::FileUtils.mkdir_p GODOT_WORKSPACE
15
+ ::FileUtils.mkdir_p GODOT_SERVER_WORKSPACE
16
+ ::FileUtils.mkdir_p GODOT_HEADLESS_WORKSPACE
17
+ end
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gdm
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.2.3
5
+ platform: ruby
6
+ authors:
7
+ - Marlon Henry Schweigert
8
+ autorequire:
9
+ bindir: cmd
10
+ cert_chain: []
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: uname
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubyzip
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 2.3.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 2.3.0
41
+ description:
42
+ email:
43
+ - marlon.schweigert@krakenlab.io
44
+ executables:
45
+ - ".gitkeep"
46
+ - gdm-editor
47
+ - gdm-headless
48
+ - gdm-install
49
+ - gdm-server
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - ".github/workflows/main.yml"
54
+ - ".gitignore"
55
+ - ".tool-versions"
56
+ - Gemfile
57
+ - Gemfile.lock
58
+ - LICENSE
59
+ - README.md
60
+ - Rakefile
61
+ - bin/console
62
+ - bin/setup
63
+ - cmd/.gitkeep
64
+ - cmd/gdm-editor
65
+ - cmd/gdm-headless
66
+ - cmd/gdm-install
67
+ - cmd/gdm-server
68
+ - gdm.gemspec
69
+ - lib/gdm.rb
70
+ - lib/gdm/platform.rb
71
+ - lib/gdm/repo.rb
72
+ - lib/gdm/version.rb
73
+ - lib/gdm/workspace.rb
74
+ homepage: https://github.com/krakenlab/gdm
75
+ licenses: []
76
+ metadata:
77
+ homepage_uri: https://github.com/krakenlab/gdm
78
+ source_code_uri: https://github.com/krakenlab/gdm
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: 2.7.1
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.2.3
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Godot Manager
98
+ test_files: []