jump_cloud 0.1.0 → 0.2.0.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +6 -0
  3. data/lib/jump_cloud.rb +53 -12
  4. data/lib/jump_cloud/agent.rb +46 -0
  5. data/lib/jump_cloud/api.rb +1 -1
  6. data/{app/models/jump_cloud → lib/jump_cloud/api}/association.rb +0 -0
  7. data/lib/jump_cloud/api/command.rb +10 -0
  8. data/lib/jump_cloud/api/group.rb +13 -0
  9. data/lib/jump_cloud/api/model.rb +17 -0
  10. data/lib/jump_cloud/api/system.rb +9 -0
  11. data/{app/models/jump_cloud → lib/jump_cloud/api}/system/association.rb +4 -1
  12. data/lib/jump_cloud/api/system/group.rb +15 -0
  13. data/{app/models/jump_cloud → lib/jump_cloud/api}/user.rb +0 -0
  14. data/{app/models/jump_cloud → lib/jump_cloud/api}/user/association.rb +0 -1
  15. data/{app/models/jump_cloud → lib/jump_cloud/api}/user/group.rb +3 -2
  16. data/{app/models/jump_cloud → lib/jump_cloud/api}/v1/model.rb +1 -2
  17. data/lib/jump_cloud/api/v2/model.rb +7 -0
  18. data/lib/jump_cloud/api/v2/system_group.rb +8 -0
  19. data/lib/jump_cloud/middleware.rb +10 -4
  20. data/lib/jump_cloud/version.rb +1 -1
  21. metadata +27 -43
  22. data/.gitignore +0 -78
  23. data/.rspec +0 -3
  24. data/.travis.yml +0 -14
  25. data/CODE_OF_CONDUCT.md +0 -74
  26. data/Gemfile +0 -18
  27. data/LICENSE.txt +0 -21
  28. data/Rakefile +0 -6
  29. data/app/models/jump_cloud/group.rb +0 -5
  30. data/app/models/jump_cloud/system.rb +0 -8
  31. data/app/models/jump_cloud/system/group.rb +0 -11
  32. data/bin/console +0 -14
  33. data/bin/setup +0 -8
  34. data/jump_cloud.gemspec +0 -41
  35. data/lib/jump_cloud/config.rb +0 -0
  36. data/spec/jump_cloud/models/system/group_spec.rb +0 -35
  37. data/spec/jump_cloud_spec.rb +0 -5
  38. data/spec/spec_helper.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 8b783994df364c108dd44045998ef53282caa818d82bedcb4468591e1720afc2
4
- data.tar.gz: 27877e520b0fba233c73384f2082a95a32f536debf754743d5d74ea8419ba080
2
+ SHA1:
3
+ metadata.gz: 25c87063055fdb0e78a011d08be5a4fa5f8d2159
4
+ data.tar.gz: c67e35de1487e2f54dad64a0f04d8ec48caeed89
5
5
  SHA512:
6
- metadata.gz: 2ec0e3749fce7d36b0e90ecd8441ebe1099125ec6e70fda3d52bb381d5c6a35ffc67227be2ec5d4bc0343448dad02013c473aa6c4921478e6bd0a903d33d08cb
7
- data.tar.gz: da60e0f05251573afecad67034aeb509f5fdc17619f3c34802dc1a24dcc54fee873f84a93da14ea3ae3b72356eb4461ea0b063108010ac4eacb8ba01607a1521
6
+ metadata.gz: 18e776f46a78be9640b37873000d419c753b652bee950ee0967f1c6f8878ea3b30e8894471673b0f1b83d6735e9ceed1cf0c8aad6827eab6de1dec957f7c1181
7
+ data.tar.gz: 4c5198b8435264af65af86da19de5669ff83000d2c7acd1e33d00a010e749d729cd946831f88d4380a4d326ce06f929c66207dc57ac1ca20f7019d56d51e488c
data/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ [![Version ](https://img.shields.io/gem/v/jump_cloud.svg?maxAge=2592000)](https://rubygems.org/gems/jump_cloud)
2
+ [![Build Status ](https://travis-ci.org/TwilightCoders/jump_cloud.svg)](https://travis-ci.org/TwilightCoders/jump_cloud)
3
+ [![Code Climate ](https://api.codeclimate.com/v1/badges/c551761bd36839129013/maintainability)](https://codeclimate.com/github/TwilightCoders/jump_cloud/maintainability)
4
+ [![Test Coverage](https://codeclimate.com/github/TwilightCoders/jump_cloud/badges/coverage.svg)](https://codeclimate.com/github/TwilightCoders/jump_cloud/coverage)
5
+ [![Dependencies ](https://gemnasium.com/badges/github.com/TwilightCoders/jump_cloud.svg)](https://gemnasium.com/github.com/TwilightCoders/jump_cloud)
6
+
1
7
  # JumpCloud
2
8
 
3
9
  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/jump_cloud`. To experiment with that code, run `bin/console` for an interactive prompt.
data/lib/jump_cloud.rb CHANGED
@@ -11,15 +11,46 @@ require 'her'
11
11
  # App
12
12
  require 'jump_cloud/middleware'
13
13
  require 'jump_cloud/api'
14
+ require 'jump_cloud/agent'
14
15
 
16
+ # Models
17
+ require 'jump_cloud/api/model'
18
+ require 'jump_cloud/api/v1/model'
19
+ require 'jump_cloud/api/v2/model'
20
+
21
+ require 'jump_cloud/api/user'
22
+ require 'jump_cloud/api/system'
23
+ require 'jump_cloud/api/group'
24
+ require 'jump_cloud/api/association'
25
+
26
+ require 'jump_cloud/api/user/association'
27
+ require 'jump_cloud/api/user/group'
28
+
29
+ require 'jump_cloud/api/system/association'
30
+ require 'jump_cloud/api/system/group'
31
+
32
+ # Shims
33
+ require 'jump_cloud/api/v2/system_group'
15
34
 
16
35
  module JumpCloud
17
36
  extend ActiveSupport::Autoload
18
37
 
19
- autoload :JumpCloud
38
+ # autoload :JumpCloud
20
39
 
21
40
  class << self
22
41
  attr_writer :logger
42
+ attr_accessor :config
43
+
44
+ DEFAULT_CONFIG = {
45
+ api_key: ENV['JUMPCLOUD_API_KEY'],
46
+ connect_key: ENV['JUMPCLOUD_CONNECT_KEY'],
47
+ install_sudo: false,
48
+ install_command: :curl
49
+ }
50
+
51
+ def self.root(*args)
52
+ (@root ||= Pathname.new(File.expand_path('../', __dir__))).join(*args)
53
+ end
23
54
 
24
55
  def logger
25
56
  @logger ||= Logger.new($stdout).tap do |log|
@@ -27,21 +58,31 @@ module JumpCloud
27
58
  log.level = JumpCloud.config.log_level
28
59
  end
29
60
  end
30
- end
31
- end
32
61
 
33
- def safeload(paths)
34
- paths.delete_if do |path|
35
- begin
36
- require(path)
37
- true
38
- rescue NameError => e
39
- false
62
+ def reset_config
63
+ @config = OpenStruct.new(DEFAULT_CONFIG)
64
+ end
65
+
66
+ def configure
67
+ yield(config)
40
68
  end
41
69
  end
70
+
71
+ reset_config
42
72
  end
43
73
 
44
- f = safeload Dir[__dir__ + '/../app/models/**/*.rb']
45
- safeload f
74
+ # def safeload(paths)
75
+ # paths.delete_if do |path|
76
+ # begin
77
+ # require(path)
78
+ # true
79
+ # rescue NameError => e
80
+ # false
81
+ # end
82
+ # end
83
+ # end
84
+
85
+ # f = safeload Dir[__dir__ + '/../app/api/**/*.rb']
86
+ # safeload f
46
87
 
47
88
  JC = JumpCloud
@@ -0,0 +1,46 @@
1
+ module JumpCloud
2
+ module Agent
3
+
4
+ class << self
5
+ def install(fetch: :curl)
6
+ if system(install_cmd(fetch))
7
+ puts "Agent installed"
8
+ else
9
+ puts "Agent not installed. Check /opt/jc/jcagentInstall.log"
10
+ puts `cat /opt/jc/jcagentInstall.log`
11
+ end
12
+ end
13
+
14
+ def system_id
15
+ config['systemKey']
16
+ end
17
+
18
+ def config_file
19
+ "/opt/jc/jcagent.conf"
20
+ end
21
+
22
+ def config(cache: true)
23
+ @config = (cache ? @config : false) || JSON.parse( IO.read(config_file) )
24
+ rescue JSON::ParserError => e
25
+ warn "Malformed config in #{config_file}"
26
+ {}
27
+ rescue StandardError => e
28
+ {}
29
+ end
30
+
31
+ def install_cmd(fetch)
32
+ kick_start_url = "https://kickstart.jumpcloud.com/Kickstart"
33
+ case fetch
34
+ when :curl
35
+ curl_flags = "--silent --show-error"
36
+ curl_headers = "--header 'x-connect-key: #{JumpCloud.config.connect_key}'"
37
+ exe = JumpCloud.config.install_sudo ? "sudo bash" : "bash"
38
+ "curl #{curl_flags} #{curl_headers} #{kick_start_url} | #{exe}"
39
+ else
40
+ fail "Not supported"
41
+ end
42
+ end
43
+ end
44
+
45
+ end
46
+ end
@@ -1,4 +1,3 @@
1
- require 'pry'
2
1
  module JumpCloud
3
2
  module V1
4
3
  API = Her::API.new
@@ -9,6 +8,7 @@ module JumpCloud
9
8
 
10
9
  # Request
11
10
  # c.use Faraday::Request::UrlEncoded
11
+ c.use JumpCloud::Middleware::JSONRequest
12
12
 
13
13
  # Response
14
14
  # c.use Her::Middleware::DefaultParseJSON
@@ -0,0 +1,10 @@
1
+ module JumpCloud
2
+ class Command < V2::Model
3
+
4
+ has_many :associations
5
+ has_many :systems
6
+
7
+ has_many :system_groups, class_name: 'System::Group', path: 'commands/:id/systemgroups'
8
+
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ module JumpCloud
2
+ class Group < V2::Model
3
+
4
+ def add(item)
5
+ path = "#{self.request_path}/members"
6
+ self.class.put(path, {
7
+ op: "add",
8
+ type: item.class.name.demodulize.downcase,
9
+ id: item.id
10
+ })
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ module JumpCloud
2
+ class Model
3
+ include Her::Model
4
+
5
+ def self.proxy(namespace, api)
6
+ klass = Class.new(self) do |klass|
7
+ use_api api
8
+
9
+ def self.instantiate_record(klass, parsed_data)
10
+ super(klass.superclass, parsed_data)
11
+ end
12
+
13
+ end
14
+ const_set(namespace, klass)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ module JumpCloud
2
+ class System < V1::Model
3
+ has_many :groups, class_name: 'System::Group', path: '/memberof'
4
+
5
+ has_many :associations, class_name: 'System::Association'
6
+
7
+ has_many :users
8
+ end
9
+ end
@@ -1,8 +1,11 @@
1
- require 'jump_cloud/user'
2
1
  module JumpCloud
3
2
  class System
4
3
  class Association < ::JumpCloud::Association
5
4
  collection_path "/v2/systems/:system_id/associations"
5
+
6
+ belongs_to :group
7
+ belongs_to :system
8
+
6
9
  end
7
10
  end
8
11
  end
@@ -0,0 +1,15 @@
1
+ module JumpCloud
2
+ class System
3
+ proxy :V2, JumpCloud::V2::API
4
+
5
+ class Group < ::JumpCloud::Group
6
+ collection_path "systemgroups"
7
+ # attributes :id, :name
8
+
9
+ # type "system_group"
10
+ has_many :systems, class_name: 'JumpCloud::System::V2', path: '/membership'
11
+ has_many :users, class_name: 'JumpCloud::User::V2', path: '/users'
12
+ # has_many :user_groups, class_name: 'JumpCloud::User::Group::V2', path: '/members'
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,3 @@
1
- require 'jump_cloud/user'
2
1
  module JumpCloud
3
2
  class User
4
3
  class Association < ::JumpCloud::Association
@@ -1,11 +1,12 @@
1
- require 'jump_cloud/user'
2
1
  module JumpCloud
3
2
  class User
4
3
  class Group < ::JumpCloud::Group
5
4
  collection_path "usergroups"
6
5
  # attributes :id, :name
7
6
 
8
- type "user_group"
7
+ belongs_to :user
8
+
9
+ proxy :V2, JumpCloud::V2::API
9
10
  end
10
11
  end
11
12
  end
@@ -1,7 +1,6 @@
1
1
  module JumpCloud
2
2
  module V1
3
- class Model
4
- include Her::Model
3
+ class Model < JumpCloud::Model
5
4
  use_api API
6
5
  end
7
6
  end
@@ -0,0 +1,7 @@
1
+ module JumpCloud
2
+ module V2
3
+ class Model < JumpCloud::Model
4
+ use_api API
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ module JumpCloud
2
+ module V2
3
+ class SystemGroup < JumpCloud::System::Group
4
+ use_api API
5
+
6
+ end
7
+ end
8
+ end
@@ -4,7 +4,7 @@ module JumpCloud
4
4
 
5
5
  class Authentication < Faraday::Middleware
6
6
  def call(env)
7
- env[:request_headers]["x-api-key"] = ENV['JUMPCLOUD_KEY']
7
+ env[:request_headers]["x-api-key"] = JumpCloud.config.api_key
8
8
  # env[:request_headers]["x-api-key"] = RequestStore.store[:my_api_token]
9
9
  @app.call(env)
10
10
  end
@@ -21,8 +21,9 @@ module JumpCloud
21
21
  end
22
22
 
23
23
  def on_complete(env)
24
- result = super
25
- result
24
+ super.tap do
25
+ puts "status: #{env.status}"
26
+ end
26
27
  end
27
28
 
28
29
  private
@@ -30,7 +31,12 @@ module JumpCloud
30
31
  def clean_attributes(data)
31
32
  case data
32
33
  when Hash
33
- data.except(:attributes)
34
+ return data if data.empty?
35
+ id = data.delete(:_id) || data.delete(:id)
36
+ ((attributes = data.delete(:attributes)) || data).merge({
37
+ id: (data.delete(:id) || id || fail("no id!")),
38
+ meta: attributes ? data : {}
39
+ })
34
40
  when Array
35
41
  data.collect { |d| clean_attributes(d) }
36
42
  end
@@ -1,3 +1,3 @@
1
1
  module JumpCloud
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0-rc1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jump_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0.pre.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Stevens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: her
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.10.0
19
+ version: '0.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.10.0
26
+ version: '0.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry-byebug
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -97,40 +97,29 @@ dependencies:
97
97
  description: JumpCloud API
98
98
  email:
99
99
  - dale@twilightcoders.net
100
- executables:
101
- - console
102
- - setup
100
+ executables: []
103
101
  extensions: []
104
102
  extra_rdoc_files: []
105
103
  files:
106
- - ".gitignore"
107
- - ".rspec"
108
- - ".travis.yml"
109
- - CODE_OF_CONDUCT.md
110
- - Gemfile
111
- - LICENSE.txt
112
104
  - README.md
113
- - Rakefile
114
- - app/models/jump_cloud/association.rb
115
- - app/models/jump_cloud/group.rb
116
- - app/models/jump_cloud/system.rb
117
- - app/models/jump_cloud/system/association.rb
118
- - app/models/jump_cloud/system/group.rb
119
- - app/models/jump_cloud/user.rb
120
- - app/models/jump_cloud/user/association.rb
121
- - app/models/jump_cloud/user/group.rb
122
- - app/models/jump_cloud/v1/model.rb
123
- - bin/console
124
- - bin/setup
125
- - jump_cloud.gemspec
126
105
  - lib/jump_cloud.rb
106
+ - lib/jump_cloud/agent.rb
127
107
  - lib/jump_cloud/api.rb
128
- - lib/jump_cloud/config.rb
108
+ - lib/jump_cloud/api/association.rb
109
+ - lib/jump_cloud/api/command.rb
110
+ - lib/jump_cloud/api/group.rb
111
+ - lib/jump_cloud/api/model.rb
112
+ - lib/jump_cloud/api/system.rb
113
+ - lib/jump_cloud/api/system/association.rb
114
+ - lib/jump_cloud/api/system/group.rb
115
+ - lib/jump_cloud/api/user.rb
116
+ - lib/jump_cloud/api/user/association.rb
117
+ - lib/jump_cloud/api/user/group.rb
118
+ - lib/jump_cloud/api/v1/model.rb
119
+ - lib/jump_cloud/api/v2/model.rb
120
+ - lib/jump_cloud/api/v2/system_group.rb
129
121
  - lib/jump_cloud/middleware.rb
130
122
  - lib/jump_cloud/version.rb
131
- - spec/jump_cloud/models/system/group_spec.rb
132
- - spec/jump_cloud_spec.rb
133
- - spec/spec_helper.rb
134
123
  homepage: https://github.com/twilightcoders/jump_cloud
135
124
  licenses:
136
125
  - MIT
@@ -141,8 +130,6 @@ rdoc_options: []
141
130
  require_paths:
142
131
  - lib
143
132
  - spec
144
- - app
145
- - app/models
146
133
  required_ruby_version: !ruby/object:Gem::Requirement
147
134
  requirements:
148
135
  - - ">="
@@ -150,16 +137,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
137
  version: '2.2'
151
138
  required_rubygems_version: !ruby/object:Gem::Requirement
152
139
  requirements:
153
- - - ">="
140
+ - - ">"
154
141
  - !ruby/object:Gem::Version
155
- version: '0'
142
+ version: 1.3.1
156
143
  requirements: []
157
144
  rubyforge_project:
158
- rubygems_version: 2.7.6
145
+ rubygems_version: 2.6.14.1
159
146
  signing_key:
160
147
  specification_version: 4
161
148
  summary: JumpCloud API
162
- test_files:
163
- - spec/jump_cloud/models/system/group_spec.rb
164
- - spec/jump_cloud_spec.rb
165
- - spec/spec_helper.rb
149
+ test_files: []
data/.gitignore DELETED
@@ -1,78 +0,0 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile ~/.gitignore_global
6
-
7
- # Database config and secrets
8
- /config/database.yml
9
- /config/secrets.yml
10
-
11
- # Ignore bundler config
12
- /.bundle
13
-
14
- # Ignore client credentials
15
- /config/client_api_credentials.yml
16
-
17
- # Ignore the default SQLite database.
18
- /db/*.sqlite3
19
-
20
- # Ignore all logfiles and tempfiles.
21
- /log/*.log
22
- /tmp
23
- /db/structure.sql
24
- /doc/app/*
25
- /vendor/cldr/*
26
- /public/uploads/*
27
- /public/photo/*
28
- /public/test/*
29
- /test/assets/*
30
- /spec/assets/*
31
- /public/assets/**
32
- .powenv
33
- .rvmrc
34
- .env
35
- .ruby-version
36
-
37
- # Compiled source #
38
- ###################
39
- /pkg/
40
- *.com
41
- *.class
42
- *.dll
43
- *.exe
44
- *.o
45
- *.so
46
-
47
- # Packages #
48
- ############
49
- # it's better to unpack these files and commit the raw source
50
- # git has its own built in compression methods
51
- *.7z
52
- *.dmg
53
- *.gz
54
- *.iso
55
- *.jar
56
- *.rar
57
- *.tar
58
- *.zip
59
-
60
- # Logs and databases #
61
- ######################
62
- *.log
63
- *.sql
64
- *.sqlite
65
-
66
- # OS generated files #
67
- ######################
68
- .DS_Store
69
- .DS_Store?
70
- ._*
71
- .Spotlight-V100
72
- .Trashes
73
- Icon?
74
- ehthumbs.db
75
- Thumbs.db
76
- /Gemfile.lock
77
- /coverage
78
- /.editorconfig
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- language: ruby
2
- sudo: false
3
-
4
- cache: bundler
5
- script:
6
- - bundle exec rspec
7
-
8
- after_success:
9
- - bundle exec codeclimate-test-reporter
10
-
11
- rvm:
12
- - 2.5
13
- - 2.4
14
- - 2.3
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at dale@getnotion.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,18 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- group :test do
6
-
7
- # Generates coverage stats of specs
8
- gem 'simplecov'
9
-
10
- # Publishes coverage to codeclimate
11
- gem 'codeclimate-test-reporter'
12
-
13
- # Gives CircleCI more perspective on our tests
14
- gem 'rspec_junit_formatter'
15
-
16
- gem 'rspec'
17
-
18
- end
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017 Dale Stevens
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.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,5 +0,0 @@
1
- module JumpCloud
2
- class Group < V2::Model
3
-
4
- end
5
- end
@@ -1,8 +0,0 @@
1
- module JumpCloud
2
- class System < V1::Model
3
-
4
- has_many :groups, class_name: 'System::Group', path: 'systems/:id/memberof'
5
-
6
- has_many :users
7
- end
8
- end
@@ -1,11 +0,0 @@
1
- require 'jump_cloud/system'
2
- module JumpCloud
3
- class System
4
- class Group < ::JumpCloud::Group
5
- collection_path "systemgroups"
6
- # attributes :id, :name
7
-
8
- type "system_group"
9
- end
10
- end
11
- end
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'dotenv'
4
- Dotenv.load
5
-
6
- require "bundler/setup"
7
- require "jump_cloud"
8
-
9
- # You can add fixtures and/or initialization code here to make experimenting
10
- # with your gem easier. You can also use a different console, if you like.
11
-
12
- # (If you use this, don't forget to add pry to your Gemfile!)
13
- require 'pry'
14
- Pry.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
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/jump_cloud.gemspec DELETED
@@ -1,41 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'jump_cloud/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "jump_cloud"
8
- spec.version = JumpCloud::VERSION
9
- spec.authors = ["Dale Stevens"]
10
- spec.email = ["dale@twilightcoders.net"]
11
-
12
- spec.summary = %q{JumpCloud API}
13
- spec.description = %q{JumpCloud API}
14
- spec.homepage = "https://github.com/twilightcoders/jump_cloud"
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'] = 'https://rubygems.org'
21
- else
22
- raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
23
- end
24
-
25
- spec.files = `git ls-files -z`.split("\x0")
26
- spec.bindir = 'bin'
27
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
28
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
29
- spec.require_paths = ['lib', 'spec', 'app', 'app/models']
30
-
31
- spec.required_ruby_version = '>= 2.2'
32
-
33
- spec.add_runtime_dependency 'her', '~> 0.10.0'
34
-
35
- spec.add_development_dependency 'pry-byebug', '~> 3'
36
- spec.add_development_dependency 'bundler', '~> 1.3'
37
- spec.add_development_dependency 'rake', '~> 12.0'
38
- spec.add_development_dependency 'rspec', '~> 3.0'
39
- spec.add_development_dependency 'dotenv', '~> 2.2'
40
-
41
- end
File without changes
@@ -1,35 +0,0 @@
1
- RSpec.describe JC::System::Group do
2
-
3
- it "Create a new System Group" do
4
- g = JumpCloud::System::Group.create(name: 'foo-to-delete')
5
- g = JumpCloud::System::Group.find(g.id)
6
- expect(g.name).to eq('foo-to-delete')
7
- g.destroy
8
- end
9
-
10
- it "Update a System Group" do
11
- g = JumpCloud::System::Group.create(name: 'foo-to-update')
12
- g.name = 'foo-to-delete'
13
- g.save
14
- g = JumpCloud::System::Group.find(g.id)
15
- expect(g.name).to eq('foo-to-delete')
16
- g.destroy
17
- end
18
-
19
- it "Delete a System Group" do
20
- g = JumpCloud::System::Group.create(name: 'foo-to-delete')
21
- g.destroy
22
- end
23
-
24
- it "List all System Groups" do
25
- system_groups = JumpCloud::System::Group.all.fetch
26
- expect(system_groups.count).to eq(4)
27
- end
28
-
29
- it "View an individual System Group details" do
30
- g = JumpCloud::System::Group.find('5a989c8145886d7d22e12a82')
31
- expect(g.name).to eq('foo-1-keep')
32
-
33
- end
34
-
35
- end
@@ -1,5 +0,0 @@
1
- RSpec.describe JumpCloud do
2
- it "has a version number" do
3
- expect(JumpCloud::VERSION).not_to be nil
4
- end
5
- end
data/spec/spec_helper.rb DELETED
@@ -1,21 +0,0 @@
1
- require 'bundler/setup'
2
-
3
- require 'pry'
4
-
5
- require 'dotenv'
6
- Dotenv.load
7
-
8
- require 'jump_cloud'
9
-
10
- RSpec.configure do |config|
11
- # Enable flags like --only-failures and --next-failure
12
- config.example_status_persistence_file_path = ".rspec_status"
13
-
14
- # Disable RSpec exposing methods globally on `Module` and `main`
15
- config.disable_monkey_patching!
16
-
17
- config.expect_with :rspec do |c|
18
- c.syntax = :expect
19
- end
20
-
21
- end