deadwood 0.0.1 → 0.0.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.
Files changed (76) hide show
  1. data/README.md +65 -3
  2. data/Rakefile +2 -4
  3. data/lib/deadwood/active_resource_oauth_client.rb +16 -8
  4. data/lib/deadwood/model/activation_key.rb +24 -8
  5. data/lib/deadwood/model/base.rb +16 -9
  6. data/lib/deadwood/model/changeset.rb +18 -10
  7. data/lib/deadwood/model/consumer.rb +16 -8
  8. data/lib/deadwood/model/crl.rb +16 -8
  9. data/lib/deadwood/model/entitlement.rb +16 -8
  10. data/lib/deadwood/model/environment.rb +22 -20
  11. data/lib/deadwood/model/errata.rb +16 -8
  12. data/lib/deadwood/model/gpg_key.rb +21 -16
  13. data/lib/deadwood/model/organization.rb +16 -8
  14. data/lib/deadwood/model/pool.rb +16 -8
  15. data/lib/deadwood/model/product.rb +22 -13
  16. data/lib/deadwood/model/provider.rb +18 -9
  17. data/lib/deadwood/model/repository.rb +16 -8
  18. data/lib/deadwood/model/role.rb +21 -14
  19. data/lib/deadwood/model/status.rb +16 -8
  20. data/lib/deadwood/model/subscription.rb +16 -8
  21. data/lib/deadwood/model/system.rb +18 -9
  22. data/lib/deadwood/model/system_group.rb +22 -13
  23. data/lib/deadwood/model/task.rb +16 -8
  24. data/lib/deadwood/model/template.rb +18 -9
  25. data/lib/deadwood/model/user.rb +16 -8
  26. data/lib/deadwood/model/version.rb +16 -8
  27. data/rake/rpmtask.rb +16 -13
  28. data/spec/models/activation_key_spec.rb +48 -8
  29. data/spec/models/base_spec.rb +16 -8
  30. data/spec/models/changeset_spec.rb +16 -8
  31. data/spec/models/crl_spec.rb +16 -8
  32. data/spec/models/environment_spec.rb +16 -8
  33. data/spec/models/gpg_key_spec.rb +16 -8
  34. data/spec/models/organization_spec.rb +16 -8
  35. data/spec/models/product_spec.rb +16 -8
  36. data/spec/models/provider_spec.rb +16 -8
  37. data/spec/models/repository_spec.rb +16 -8
  38. data/spec/models/role_spec.rb +16 -8
  39. data/spec/models/system_group_spec.rb +16 -8
  40. data/spec/models/task_spec.rb +16 -8
  41. data/spec/models/template_spec.rb +16 -8
  42. data/spec/models/user_spec.rb +16 -8
  43. data/spec/spec_helper.rb +15 -21
  44. data/spec/vcr/cassettes/create_activation_key.yml +91 -91
  45. data/spec/vcr/cassettes/create_changeset.yml +93 -93
  46. data/spec/vcr/cassettes/create_find_all_environment.yml +45 -45
  47. data/spec/vcr/cassettes/create_find_by_id_activation_key.yml +214 -0
  48. data/spec/vcr/cassettes/create_find_single_environment.yml +49 -49
  49. data/spec/vcr/cassettes/create_gpg_key.yml +64 -64
  50. data/spec/vcr/cassettes/create_provider_for_default_org.yml +63 -63
  51. data/spec/vcr/cassettes/create_repository.yml +98 -98
  52. data/spec/vcr/cassettes/create_role.yml +46 -46
  53. data/spec/vcr/cassettes/create_system.yml +59 -59
  54. data/spec/vcr/cassettes/create_template.yml +86 -86
  55. data/spec/vcr/cassettes/create_update_activation_key.yml +345 -0
  56. data/spec/vcr/cassettes/create_user.yml +48 -48
  57. data/spec/vcr/cassettes/create_user_role.yml +103 -103
  58. data/spec/vcr/cassettes/find_ACME_Corporation.yml +14 -14
  59. data/spec/vcr/cassettes/find_admin.yml +14 -14
  60. data/spec/vcr/cassettes/find_crl.yml +22 -22
  61. data/spec/vcr/cassettes/find_template.yml +13 -13
  62. data/spec/vcr/cassettes/find_users.yml +13 -13
  63. data/spec/vcr/cassettes/organization_1_exists.yml +28 -28
  64. data/spec/vcr/cassettes/organization_create.yml +46 -46
  65. data/spec/vcr/cassettes/organization_default_exists.yml +14 -14
  66. data/spec/vcr/cassettes/organization_exists.yml +13 -13
  67. data/spec/vcr/cassettes/organization_update.yml +44 -44
  68. data/spec/vcr/cassettes/provider_1_exists.yml +14 -14
  69. data/spec/vcr/cassettes/providers_all_exists.yml +15 -15
  70. data/spec/vcr/cassettes/read_products.yml +92 -92
  71. data/spec/vcr/cassettes/update_environment_name_description.yml +83 -83
  72. data/spec/vcr/cassettes/update_provider_for_org.yml +64 -64
  73. data/spec/vcr/cassettes/update_role.yml +67 -67
  74. data/spec/vcr/cassettes/update_user.yml +48 -48
  75. data/spec/vcr_setup.rb +16 -23
  76. metadata +8 -32
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -22,11 +30,12 @@ module Deadwood
22
30
  end
23
31
 
24
32
  def element_path(id = self.id, prefix_options = {}, query_options = nil)
25
- prefix_options, query_options = split_options(prefix_options) if query_options.nil?
26
- org_id = self.organization_id
27
- # Remove the attributes that aren't allowed to be updated
28
- attributes.delete(:organization_id)
29
- "#{self.class.prefix(prefix_options)}organizations/#{org_id}/#{self.class.collection_name}/#{self.id}#{query_string(query_options)}"
33
+ black_list = Array[:organization_id]
34
+ prefix_options, query_options = split_options(prefix_options) if query_options.nil?
35
+ org_id = self.organization_id
36
+ # Remove the attributes that aren't allowed to be updated
37
+ black_list.each {|x| attributes.delete(x)}
38
+ "#{self.class.prefix(prefix_options)}organizations/#{org_id}/#{self.class.collection_name}/#{self.id}#{query_string(query_options)}"
30
39
  end
31
40
  end
32
41
  end
@@ -1,22 +1,31 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
14
22
  module Katello
15
23
  class Provider < Base
16
24
  def collection_path(prefix_options = {}, query_options = nil)
25
+ black_list = Array[:organization_id]
17
26
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
18
27
  query_options.merge!(self.attributes)
19
- attributes.delete(:organization_id)
28
+ black_list.each {|x| attributes.delete(x)}
20
29
  "#{self.class.prefix(prefix_options)}#{self.class.collection_name}#{query_string(query_options)}"
21
30
  end
22
31
  end
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -26,12 +34,11 @@ module Deadwood
26
34
  end
27
35
 
28
36
  def element_path(id = self.id, prefix_options = {}, query_options = nil)
29
- prefix_options, query_options = split_options(prefix_options) if query_options.nil?
30
- # Remove the attributes that aren't allowed to be updated
31
- attributes.delete(:updated_at)
32
- attributes.delete(:created_at)
33
- attributes.delete(:locked)
34
- "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{self.id}#{query_string(query_options)}"
37
+ black_list = Array[:updated_at, :created_at, :locked]
38
+ prefix_options, query_options = split_options(prefix_options) if query_options.nil?
39
+ # Remove the attributes that aren't allowed to be updated
40
+ black_list.each {|x| attributes.delete(x)}
41
+ "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{self.id}#{query_string(query_options)}"
35
42
  end
36
43
  end
37
44
  end
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -1,22 +1,31 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
14
22
  module Katello
15
23
  class System < Base
16
24
  def collection_path(prefix_options = {}, query_options = nil)
25
+ black_list = Array[:environment_id]
17
26
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
18
27
  query_options.merge!(self.attributes)
19
- self.attributes().delete(:environment_id)
28
+ black_list.each {|x| attributes.delete(x)}
20
29
  "#{self.class.prefix(prefix_options)}#{self.class.collection_name}#{query_string(query_options)}"
21
30
  end
22
31
  end
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -22,11 +30,12 @@ module Deadwood
22
30
  end
23
31
 
24
32
  def element_path(id = self.id, prefix_options = {}, query_options = nil)
25
- prefix_options, query_options = split_options(prefix_options) if query_options.nil?
26
- org_id = self.organization_id
27
- # Remove the attributes that aren't allowed to be updated
28
- attributes.delete(:organization_id)
29
- "#{self.class.prefix(prefix_options)}organizations/#{org_id}/#{self.class.collection_name}/#{self.id}#{query_string(query_options)}"
33
+ black_list = Array[:organization_id]
34
+ prefix_options, query_options = split_options(prefix_options) if query_options.nil?
35
+ org_id = self.organization_id
36
+ # Remove the attributes that aren't allowed to be updated
37
+ black_list.each {|x| attributes.delete(x)}
38
+ "#{self.class.prefix(prefix_options)}organizations/#{org_id}/#{self.class.collection_name}/#{self.id}#{query_string(query_options)}"
30
39
  end
31
40
  end
32
41
  end
@@ -1,13 +1,21 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
@@ -1,22 +1,31 @@
1
1
  # Copyright (c) 2012 Chris Alfonso
2
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
3
4
  # of this software and associated documentation files (the "Software"), to deal
4
- # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
- # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions:
6
- # # The above copyright notice and this permission notice shall be included in
7
- # all copies or substantial portions of the Software. #
8
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
19
  # THE SOFTWARE.
12
20
 
13
21
  module Deadwood
14
22
  module Katello
15
23
  class Template < Base
16
24
  def collection_path(prefix_options = {}, query_options = nil)
25
+ black_list = Array[:environment_id]
17
26
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
18
27
  query_options.merge!(self.attributes)
19
- self.attributes().delete(:environment_id)
28
+ black_list.each {|x| attributes.delete(x)}
20
29
  "#{self.class.prefix(prefix_options)}#{self.class.collection_name}#{query_string(query_options)}"
21
30
  end
22
31
  end