yade-project-rest-client 0.1.1

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.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +8 -0
  6. data/Gemfile.lock +85 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +39 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/lib/yade/project/rest/client.rb +38 -0
  13. data/lib/yade/project/rest/client/maven_build_step_client.rb +26 -0
  14. data/lib/yade/project/rest/client/maven_build_task_client.rb +26 -0
  15. data/lib/yade/project/rest/client/nvm_runtime_client.rb +26 -0
  16. data/lib/yade/project/rest/client/project_client.rb +32 -0
  17. data/lib/yade/project/rest/client/project_module_client.rb +44 -0
  18. data/lib/yade/project/rest/client/pyenv_runtime_client.rb +26 -0
  19. data/lib/yade/project/rest/client/rvm_runtime_client.rb +26 -0
  20. data/lib/yade/project/rest/client/sdk_package_client.rb +31 -0
  21. data/lib/yade/project/rest/client/vcs_client.rb +26 -0
  22. data/lib/yade/project/rest/model/ide_type.rb +15 -0
  23. data/lib/yade/project/rest/model/maven_build_step.rb +26 -0
  24. data/lib/yade/project/rest/model/maven_build_task.rb +26 -0
  25. data/lib/yade/project/rest/model/nvm_runtime.rb +26 -0
  26. data/lib/yade/project/rest/model/project.rb +37 -0
  27. data/lib/yade/project/rest/model/project_module.rb +38 -0
  28. data/lib/yade/project/rest/model/pyenv_runtime.rb +26 -0
  29. data/lib/yade/project/rest/model/rvm_runtime.rb +26 -0
  30. data/lib/yade/project/rest/model/sdk_package.rb +26 -0
  31. data/lib/yade/project/rest/model/vcs.rb +26 -0
  32. data/lib/yade/project/rest/service/base_service.rb +29 -0
  33. data/lib/yade/project/rest/service/project_service.rb +17 -0
  34. data/lib/yade/project/rest/version.rb +7 -0
  35. data/yade-project-rest-client.gemspec +45 -0
  36. metadata +190 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 22fd2247ffbdff02ccccbf4667e50f9d2321cf5eba5903e3b7215421259f03ad
4
+ data.tar.gz: 5ce4bd55eb68162e01e980162fd41c65e547a56d282af47377ce8342e76e606c
5
+ SHA512:
6
+ metadata.gz: 5acfc104d0ad422d49164cdcdaec6f2ce5f31b5f736221ea75059e588024802e0e34b6de77b5c1e710dfaf9a4dcb898d05b09ef4cdfde5f0e09e34775110e327
7
+ data.tar.gz: fc5a1c4a16b60ba275b93d776a2870f1431306a1de851094ae93719ecb5eb4a9482843c86b3efce7ecbeda75c5ed4de3645740d3f2fa43c9b7b51af8975224ac
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.4.4
7
+ before_install: gem install bundler -v 1.16.4
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in yade-project-rest-client.gemspec
6
+ gemspec
7
+
8
+ gem 'yade-common', :path => "#{ENV['HOME']}/projekte/yade/src/yade-common"
@@ -0,0 +1,85 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ yade-project-rest-client (0.1.1)
5
+ activemodel (~> 5.2)
6
+ httparty (~> 0.15)
7
+ yade-common (~> 0.1)
8
+
9
+ PATH
10
+ remote: /Users/seba/projekte/yade/src/yade-common
11
+ specs:
12
+ yade-common (0.1.1)
13
+ activemodel (~> 5.2)
14
+ httparty (~> 0.15)
15
+ settingslogic (~> 2.0)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ activemodel (5.2.1)
21
+ activesupport (= 5.2.1)
22
+ activesupport (5.2.1)
23
+ concurrent-ruby (~> 1.0, >= 1.0.2)
24
+ i18n (>= 0.7, < 2)
25
+ minitest (~> 5.1)
26
+ tzinfo (~> 1.1)
27
+ ast (2.4.0)
28
+ concurrent-ruby (1.0.5)
29
+ diff-lcs (1.3)
30
+ httparty (0.16.2)
31
+ multi_xml (>= 0.5.2)
32
+ i18n (1.1.0)
33
+ concurrent-ruby (~> 1.0)
34
+ jaro_winkler (1.5.1)
35
+ minitest (5.11.3)
36
+ multi_xml (0.6.0)
37
+ parallel (1.12.1)
38
+ parser (2.5.1.2)
39
+ ast (~> 2.4.0)
40
+ powerpack (0.1.2)
41
+ rainbow (3.0.0)
42
+ rake (10.5.0)
43
+ rspec (3.8.0)
44
+ rspec-core (~> 3.8.0)
45
+ rspec-expectations (~> 3.8.0)
46
+ rspec-mocks (~> 3.8.0)
47
+ rspec-core (3.8.0)
48
+ rspec-support (~> 3.8.0)
49
+ rspec-expectations (3.8.1)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.8.0)
52
+ rspec-json_expectations (2.1.0)
53
+ rspec-mocks (3.8.0)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.8.0)
56
+ rspec-support (3.8.0)
57
+ rubocop (0.58.2)
58
+ jaro_winkler (~> 1.5.1)
59
+ parallel (~> 1.10)
60
+ parser (>= 2.5, != 2.5.1.1)
61
+ powerpack (~> 0.1)
62
+ rainbow (>= 2.2.2, < 4.0)
63
+ ruby-progressbar (~> 1.7)
64
+ unicode-display_width (~> 1.0, >= 1.0.1)
65
+ ruby-progressbar (1.10.0)
66
+ settingslogic (2.0.9)
67
+ thread_safe (0.3.6)
68
+ tzinfo (1.2.5)
69
+ thread_safe (~> 0.1)
70
+ unicode-display_width (1.4.0)
71
+
72
+ PLATFORMS
73
+ ruby
74
+
75
+ DEPENDENCIES
76
+ bundler (~> 1.16)
77
+ rake (~> 10.0)
78
+ rspec (~> 3.0)
79
+ rspec-json_expectations (~> 2.1)
80
+ rubocop (~> 0.58.0)
81
+ yade-common!
82
+ yade-project-rest-client!
83
+
84
+ BUNDLED WITH
85
+ 1.16.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Sebastian Freund
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,39 @@
1
+ # Yade::Project::Rest::Client
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/yade/project/rest/client`. 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 'yade-project-rest-client'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install yade-project-rest-client
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 spec` 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]/yade-project-rest-client.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "yade/project/rest/client"
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__)
@@ -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
@@ -0,0 +1,38 @@
1
+ require 'yade/project/rest/version'
2
+
3
+ require 'yade/common/config/app_config'
4
+ require 'yade/common/model/authentication'
5
+
6
+ require 'yade/common/client/authentication_client'
7
+ require 'yade/common/client/base_client'
8
+
9
+ require 'yade/project/rest/model/project'
10
+ require 'yade/project/rest/model/ide_type'
11
+ require 'yade/project/rest/model/project_module'
12
+ require 'yade/project/rest/model/vcs'
13
+ require 'yade/project/rest/model/nvm_runtime'
14
+ require 'yade/project/rest/model/rvm_runtime'
15
+ require 'yade/project/rest/model/pyenv_runtime'
16
+ require 'yade/project/rest/model/sdk_package'
17
+ require 'yade/project/rest/model/maven_build_task'
18
+ require 'yade/project/rest/model/maven_build_step'
19
+
20
+ require 'yade/project/rest/client/project_client'
21
+ require 'yade/project/rest/client/project_module_client'
22
+ require 'yade/project/rest/client/vcs_client'
23
+ require 'yade/project/rest/client/nvm_runtime_client'
24
+ require 'yade/project/rest/client/rvm_runtime_client'
25
+ require 'yade/project/rest/client/pyenv_runtime_client'
26
+ require 'yade/project/rest/client/sdk_package_client'
27
+ require 'yade/project/rest/client/maven_build_task_client'
28
+ require 'yade/project/rest/client/maven_build_step_client'
29
+
30
+ module Yade
31
+ module Project
32
+ module Rest
33
+ module Client
34
+ # Your code goes here...
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Client
10
+ include Yade::Common::Client
11
+
12
+ # maven build step client
13
+ class MavenBuildStepClient < BaseClient
14
+ include HTTParty
15
+ # logger ::Logger.new(STDOUT), :debug
16
+
17
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
18
+
19
+ def initialize
20
+ super('yadeproject', 'maven-build-step', 'Yade::Project::Rest::Model::MavenBuildStep')
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Client
10
+ include Yade::Common::Client
11
+
12
+ # maven build task client
13
+ class MavenBuildTaskClient < BaseClient
14
+ include HTTParty
15
+ #logger ::Logger.new(STDOUT), :debug
16
+
17
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
18
+
19
+ def initialize
20
+ super('yadeproject', 'maven-build-task', 'Yade::Project::Rest::Model::MavenBuildTask')
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Client
10
+ include Yade::Common::Client
11
+
12
+ # rvm runtime client
13
+ class NvmRuntimeClient < BaseClient
14
+ include HTTParty
15
+ # logger ::Logger.new(STDOUT), :debug
16
+
17
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
18
+
19
+ def initialize
20
+ super('yadeproject', 'nvm-runtime', 'Yade::Project::Rest::Model::NvmRuntime')
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ # yadecli cli
7
+ module Yade
8
+ module Project
9
+ module Rest
10
+ module Client
11
+ include Yade::Common::Client
12
+
13
+ # project client
14
+ class ProjectClient < BaseClient
15
+ include HTTParty
16
+ # logger ::Logger.new(STDOUT), :debug
17
+
18
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
19
+
20
+ def initialize
21
+ super('yadeproject', 'project', 'Yade::Project::Rest::Model::Project')
22
+ end
23
+
24
+ # get project by name
25
+ def project_by_name(project_name)
26
+ list.select { |p| p.name == project_name }.first
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ # yadecli cli
7
+ module Yade
8
+ module Project
9
+ module Rest
10
+ module Client
11
+ include Yade::Common::Client
12
+
13
+ # authentication client
14
+ class ProjectModuleClient < BaseClient
15
+ include HTTParty
16
+ # logger ::Logger.new(STDOUT), :info
17
+
18
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
19
+
20
+ def initialize
21
+ super('yadeproject', 'project-module', 'Yade::Project::Rest::Model::ProjectModule')
22
+ end
23
+
24
+ # get module by name
25
+ def module_by_name(module_name)
26
+ list.select { |m| m.name == module_name }.first
27
+ end
28
+
29
+ # get modules for project with id
30
+ def modules_for_project(project_id)
31
+ list.select { |m| m.projectId == project_id }
32
+ end
33
+
34
+ # get module by name from project with id
35
+ def module_for_project(project_id, module_name)
36
+ modules = modules_for_project(project_id)
37
+
38
+ modules.select { |m| m.name == module_name }.first
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Client
10
+ include Yade::Common::Client
11
+
12
+ # pyenv runtime client
13
+ class PyenvRuntimeClient < BaseClient
14
+ include HTTParty
15
+ # logger ::Logger.new(STDOUT), :debug
16
+
17
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
18
+
19
+ def initialize
20
+ super('yadeproject', 'pyenv-runtime', 'Yade::Project::Rest::Model::PyenvRuntime')
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Client
10
+ include Yade::Common::Client
11
+
12
+ # rvm runtime client
13
+ class RvmRuntimeClient < BaseClient
14
+ include HTTParty
15
+ # logger ::Logger.new(STDOUT), :debug
16
+
17
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
18
+
19
+ def initialize
20
+ super('yadeproject', 'rvm-runtime', 'Yade::Project::Rest::Model::RvmRuntime')
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Client
10
+ include Yade::Common::Client
11
+
12
+ # domain client
13
+ class SdkPackageClient < BaseClient
14
+ include HTTParty
15
+ # logger ::Logger.new(STDOUT), :debug
16
+
17
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
18
+
19
+ def initialize
20
+ super('yadeproject', 'sdk-package', 'Yade::Project::Rest::Model::SdkPackage')
21
+ end
22
+
23
+ # get sdk packages for project with id
24
+ def sdk_packages_for_project(project_id)
25
+ list.select { |sdk_package| sdk_package.projectId == project_id }
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+ require 'logger'
5
+
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Client
10
+ include Yade::Common::Client
11
+
12
+ # vcs client
13
+ class VcsClient < BaseClient
14
+ include HTTParty
15
+ # logger ::Logger.new(STDOUT), :debug
16
+
17
+ base_uri Yade::Common::Config::AppConfig[:yade_url]
18
+
19
+ def initialize
20
+ super('yadeproject', 'vcs', 'Yade::Project::Rest::Model::Vcs')
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # installation status
4
+ module Yade
5
+ module Project
6
+ module Rest
7
+ module Model
8
+ class IdeType
9
+ RUBYMINE = 'mine'
10
+ IDEA = 'idea'
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module Yade
6
+ module Project
7
+ module Rest
8
+ module Model
9
+ # MavenBuildStep
10
+ class MavenBuildStep
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :command, :profiles, :parameters, :mavenBuildTaskId
16
+
17
+ validates_presence_of 'id', 'command', 'mavenBuildTaskId'
18
+
19
+ def attributes
20
+ instance_values
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module Yade
6
+ module Project
7
+ module Rest
8
+ module Model
9
+ # MavenBuildTask
10
+ class MavenBuildTask
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :name, :desc, :profiles, :parameters, :projectModuleId
16
+
17
+ validates_presence_of 'id', 'name', 'projectModuleId'
18
+
19
+ def attributes
20
+ instance_values
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module Yade
6
+ module Project
7
+ module Rest
8
+ module Model
9
+ # NvmRuntime
10
+ class NvmRuntime
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :version, :packages
16
+
17
+ validates_presence_of 'id', 'version',
18
+
19
+ def attributes
20
+ instance_values
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ # Project
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Model
10
+ class Project
11
+ include Yade::Common::Config
12
+ include ActiveModel::Model
13
+ include ActiveModel::Validations
14
+ include ActiveModel::Serializers::JSON
15
+ include Yade::Common::Config
16
+
17
+ attr_accessor :id, :name, :ideType, :vcsId, :nvmRuntimeId, :rvmRuntimeId, :pyenvRuntimeId
18
+ attr_reader :home
19
+
20
+ validates_presence_of 'id', 'name', 'home', 'ideType', 'vcsId'
21
+
22
+ def attributes
23
+ instance_values
24
+ end
25
+
26
+ def home
27
+ "#{AppConfig[:project_home]}/#{name}"
28
+ end
29
+
30
+ def installed?
31
+ File.directory?(home)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ # Module
6
+ module Yade
7
+ module Project
8
+ module Rest
9
+ module Model
10
+ class ProjectModule
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :name, :enabled, :languageType, :buildToolType, :vcsId, :projectId
16
+ attr_reader :home
17
+
18
+ validates_presence_of 'id', 'name', 'home', 'languageType', 'buildToolType', 'vcsId', 'projectId'
19
+
20
+ def attributes
21
+ instance_values
22
+ end
23
+
24
+ def home
25
+ project_client = Yade::Project::Rest::Client::ProjectClient.new
26
+ project = project_client.get(projectId)
27
+
28
+ "#{project.home}/src/#{name}"
29
+ end
30
+
31
+ def installed?
32
+ File.directory?(home)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module Yade
6
+ module Project
7
+ module Rest
8
+ module Model
9
+ # PyenvRuntime
10
+ class PyenvRuntime
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :version, :packages
16
+
17
+ validates_presence_of 'id', 'version',
18
+
19
+ def attributes
20
+ instance_values
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module Yade
6
+ module Project
7
+ module Rest
8
+ module Model
9
+ # RvmRuntime
10
+ class RvmRuntime
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :version, :packages
16
+
17
+ validates_presence_of 'id', 'version',
18
+
19
+ def attributes
20
+ instance_values
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module Yade
6
+ module Project
7
+ module Rest
8
+ module Model
9
+ # SdkPackage
10
+ class SdkPackage
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :name, :projectId, :version
16
+
17
+ validates_presence_of 'id', 'name', 'projectId', 'version'
18
+
19
+ def attributes
20
+ instance_values
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+
5
+ module Yade
6
+ module Project
7
+ module Rest
8
+ module Model
9
+ # Vcs
10
+ class Vcs
11
+ include ActiveModel::Model
12
+ include ActiveModel::Validations
13
+ include ActiveModel::Serializers::JSON
14
+
15
+ attr_accessor :id, :vcsType, :url
16
+
17
+ validates_presence_of 'id', 'vcsType', 'url'
18
+
19
+ def attributes
20
+ instance_values
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ # yadecli cli
4
+ module Yade
5
+ module Project
6
+ module Rest
7
+ module Client
8
+ # base client
9
+ class BaseService
10
+
11
+ # initialize
12
+ def initialize(client)
13
+ @client = client
14
+ end
15
+
16
+ # list all
17
+ def list
18
+ @client.list
19
+ end
20
+
21
+ # get by id
22
+ def get(id)
23
+ @client.get(id)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # yadecli cli
4
+ module Yade
5
+ module Project
6
+ module Rest
7
+ module Service
8
+ # project client
9
+ class ProjectService < BaseService
10
+ def initialize
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,7 @@
1
+ module Yade
2
+ module Project
3
+ module Rest
4
+ VERSION = '0.1.1'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,45 @@
1
+
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'yade/project/rest/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'yade-project-rest-client'
8
+ spec.version = Yade::Project::Rest::VERSION
9
+ spec.authors = ['Sebastian Freund']
10
+ spec.email = ['s.freund@dzbw.de']
11
+
12
+ spec.summary = 'Yade Project Rest Client'
13
+ spec.description = 'Yade Project Rest Client'
14
+ spec.homepage = 'https://gitlab.com/yadedev/yade-project-rest-client'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21
+ # else
22
+ # raise "RubyGems 2.0 or newer is required to protect against " \
23
+ # "public gem pushes."
24
+ # end
25
+
26
+ # Specify which files should be added to the gem when it is released.
27
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
29
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
+ end
31
+ spec.bindir = 'exe'
32
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ['lib']
34
+
35
+ spec.add_dependency 'yade-common', '~> 0.1'
36
+
37
+ spec.add_dependency 'activemodel', '~> 5.2'
38
+ spec.add_dependency 'httparty', '~> 0.15'
39
+
40
+ spec.add_development_dependency 'bundler', '~> 1.16'
41
+ spec.add_development_dependency 'rake', '~> 10.0'
42
+ spec.add_development_dependency 'rspec', '~> 3.0'
43
+ spec.add_development_dependency 'rspec-json_expectations', '~> 2.1'
44
+ spec.add_development_dependency 'rubocop', '~> 0.58.0'
45
+ end
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yade-project-rest-client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Sebastian Freund
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-10-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: yade-common
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activemodel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: httparty
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.15'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.15'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.16'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.16'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec-json_expectations
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.1'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.58.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.58.0
125
+ description: Yade Project Rest Client
126
+ email:
127
+ - s.freund@dzbw.de
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - ".rspec"
134
+ - ".travis.yml"
135
+ - Gemfile
136
+ - Gemfile.lock
137
+ - LICENSE.txt
138
+ - README.md
139
+ - Rakefile
140
+ - bin/console
141
+ - bin/setup
142
+ - lib/yade/project/rest/client.rb
143
+ - lib/yade/project/rest/client/maven_build_step_client.rb
144
+ - lib/yade/project/rest/client/maven_build_task_client.rb
145
+ - lib/yade/project/rest/client/nvm_runtime_client.rb
146
+ - lib/yade/project/rest/client/project_client.rb
147
+ - lib/yade/project/rest/client/project_module_client.rb
148
+ - lib/yade/project/rest/client/pyenv_runtime_client.rb
149
+ - lib/yade/project/rest/client/rvm_runtime_client.rb
150
+ - lib/yade/project/rest/client/sdk_package_client.rb
151
+ - lib/yade/project/rest/client/vcs_client.rb
152
+ - lib/yade/project/rest/model/ide_type.rb
153
+ - lib/yade/project/rest/model/maven_build_step.rb
154
+ - lib/yade/project/rest/model/maven_build_task.rb
155
+ - lib/yade/project/rest/model/nvm_runtime.rb
156
+ - lib/yade/project/rest/model/project.rb
157
+ - lib/yade/project/rest/model/project_module.rb
158
+ - lib/yade/project/rest/model/pyenv_runtime.rb
159
+ - lib/yade/project/rest/model/rvm_runtime.rb
160
+ - lib/yade/project/rest/model/sdk_package.rb
161
+ - lib/yade/project/rest/model/vcs.rb
162
+ - lib/yade/project/rest/service/base_service.rb
163
+ - lib/yade/project/rest/service/project_service.rb
164
+ - lib/yade/project/rest/version.rb
165
+ - yade-project-rest-client.gemspec
166
+ homepage: https://gitlab.com/yadedev/yade-project-rest-client
167
+ licenses:
168
+ - MIT
169
+ metadata: {}
170
+ post_install_message:
171
+ rdoc_options: []
172
+ require_paths:
173
+ - lib
174
+ required_ruby_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ requirements: []
185
+ rubyforge_project:
186
+ rubygems_version: 2.7.7
187
+ signing_key:
188
+ specification_version: 4
189
+ summary: Yade Project Rest Client
190
+ test_files: []