sfrest 0.0.26 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c2abf785e53299e84b3ad976ef8272f4437d881691fb44e2b3a3b1b8459fed4
4
- data.tar.gz: ab870aa55cf4fd7bc270e195bf839617b4c50077da3e15c6b0adf7000cdcf416
3
+ metadata.gz: 68df6f447ad598b5f0cb7c2069016978fa49447ef19be534060d861b160f1817
4
+ data.tar.gz: f86a6154bcf5b735445bee40ae085135d153b63b41c74300032704460fa9a63e
5
5
  SHA512:
6
- metadata.gz: ea57be27d0c8fa318db7ce3464d96178444bb85b79c9fe8559524b737e6e4f750c178c15af5a64bc85136c303b96cea04f47a952a955f0917d3fc7d36d028b0e
7
- data.tar.gz: 511c642c4ea6f14867036408ab2fe7a84b94a6f13ea983433ff540b68be23e2a7f243923defc101ba63ebaff4d8438981822879c67bc0f98ef53f15c9d010ad5
6
+ metadata.gz: 909a76936f3a281bb493e5f3d063a84024f6ee6aba946590fbc66f5fbb02942ee54f4968685521d0c835c261f86024da8b7ab32aea564f48f870ba70e02607d5
7
+ data.tar.gz: 3e2510b147e4bc76f2a2c81b4af9d1ea664ffb2eeb24c3ff962d78f51fdbda8763fe1a9a119ed6266bafd8b0b262ad77c88dde2f3e5f9dcdf1a9208121608a1c
data/lib/sfrest/audit.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Get all the audit devents.
3
5
  class Audit
data/lib/sfrest/backup.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Backup a site or restore onto that site
3
5
  class Backup
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # List codebases on the factory.
3
5
  class Codebase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Find colletions, return their data.
3
5
  class Collection
@@ -61,7 +63,7 @@ module SFRest
61
63
  not_done = true
62
64
  count = 0
63
65
  while not_done
64
- current_path = '/api/v1/collections?page=' << page.to_s
66
+ current_path = '/api/v1/collections?page='.dup << page.to_s
65
67
  res = @conn.get(current_path)
66
68
  if res['collections'] == []
67
69
  not_done = false
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Generic http methods
3
5
  # accessors for all the sub classes.
@@ -179,8 +181,8 @@ module SFRest
179
181
 
180
182
  REST_METHODS.each do |m|
181
183
  define_method(m) do
182
- m.capitalize!
183
- sfrest_klass = "SFRest::#{m}"
184
+ klazz = m.dup.capitalize!
185
+ sfrest_klass = "SFRest::#{klazz}"
184
186
  Object.const_get(sfrest_klass).new(self)
185
187
  end
186
188
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Find Staging envs and stage a set of sites
3
5
  class Domains
data/lib/sfrest/error.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Error classes for SFRest
3
5
 
data/lib/sfrest/group.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # SF Group management
3
5
  class Group
@@ -18,7 +20,7 @@ module SFRest
18
20
  # Deletes the group with the specified id
19
21
  # @param [Integer] group_id Id of the group to fetch
20
22
  def delete_group(group_id)
21
- current_path = '/api/v1/groups/' << group_id.to_s
23
+ current_path = '/api/v1/groups/' + group_id.to_s
22
24
  @conn.delete(current_path)
23
25
  end
24
26
 
@@ -35,7 +37,7 @@ module SFRest
35
37
  # @param [Integer] group_id Id of the group to fetch
36
38
  # @return [Hash] group object from the SF Api
37
39
  def get_group(group_id = 0)
38
- current_path = '/api/v1/groups/' << group_id.to_s
40
+ current_path = '/api/v1/groups/' + group_id.to_s
39
41
  @conn.get(current_path)
40
42
  end
41
43
 
@@ -116,7 +118,7 @@ module SFRest
116
118
  not_done = true
117
119
  count = 0
118
120
  while not_done
119
- current_path = '/api/v1/groups?page=' << page.to_s
121
+ current_path = '/api/v1/groups?page='.dup << page.to_s
120
122
  res = @conn.get(current_path)
121
123
  if res['groups'] == []
122
124
  not_done = false
data/lib/sfrest/info.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Retrieve Site Factory info.
3
5
  class Info
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # make a url querypath
3
5
  # so that if the are multiple items in a get request
data/lib/sfrest/role.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # create, delete, update, roles
3
5
  class Role
@@ -16,7 +18,7 @@ module SFRest
16
18
  not_done = true
17
19
  count = 0
18
20
  while not_done
19
- current_path = '/api/v1/roles?page=' << page.to_s
21
+ current_path = '/api/v1/roles?page='.dup << page.to_s
20
22
  res = @conn.get(current_path)
21
23
  if res['roles'] == []
22
24
  not_done = false
data/lib/sfrest/site.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Find sites, create a site,
3
5
  class Site
@@ -64,7 +66,7 @@ module SFRest
64
66
  count = 0
65
67
  sites = []
66
68
  while not_done
67
- current_path = '/api/v1/sites?page=' << page.to_s
69
+ current_path = '/api/v1/sites?page='.dup << page.to_s
68
70
  current_path <<= '&show_incomplete=true' if show_incomplete
69
71
  res = @conn.get(current_path)
70
72
  if res['sites'] == []
data/lib/sfrest/stage.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Find Staging envs and stage a set of sites
3
5
  class Stage
data/lib/sfrest/task.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Deal with tasks, find them, pause them...
3
5
  class Task
@@ -23,7 +25,7 @@ module SFRest
23
25
  # @param [Integer] status
24
26
  # @return [Boolean]
25
27
  def status_not_started?(status)
26
- return true if (status.to_i & STATUS_TO_BE_RUN) > 0
28
+ return true if (status.to_i & STATUS_TO_BE_RUN).positive?
27
29
 
28
30
  false
29
31
  end
@@ -42,7 +44,7 @@ module SFRest
42
44
  # @param [Integer] status
43
45
  # @return [Boolean]
44
46
  def status_running?(status)
45
- return true if (status.to_i & STATUS_RUNNING) > 0
47
+ return true if (status.to_i & STATUS_RUNNING).positive?
46
48
 
47
49
  false
48
50
  end
@@ -70,7 +72,7 @@ module SFRest
70
72
  # @param [Integer] status
71
73
  # @return [Boolean]
72
74
  def status_done?(status)
73
- return true if (status.to_i & STATUS_DONE) > 0
75
+ return true if (status.to_i & STATUS_DONE).positive?
74
76
 
75
77
  false
76
78
  end
@@ -207,7 +209,7 @@ module SFRest
207
209
  # Get a specific task's logs
208
210
  # @param [Integer] task_id
209
211
  def get_task_logs(task_id)
210
- current_path = '/api/v1/tasks/' << task_id.to_s << '/logs'
212
+ current_path = '/api/v1/tasks/' + task_id.to_s + '/logs'
211
213
  @conn.get(current_path)
212
214
  end
213
215
 
@@ -220,8 +222,8 @@ module SFRest
220
222
  begin
221
223
  res = @conn.get(current_path)
222
224
  paused = res['wip_pause_global']
223
- rescue SFRest::SFError => error
224
- paused = false if error.message =~ /Variable not found/
225
+ rescue SFRest::SFError => e
226
+ paused = false if e.message =~ /Variable not found/
225
227
  end
226
228
  paused
227
229
  end
@@ -231,7 +233,7 @@ module SFRest
231
233
  # @param [Integer] task_id
232
234
  # @param [String] level family|task
233
235
  def pause_task(task_id, level = 'family')
234
- current_path = '/api/v1/pause/' << task_id.to_s
236
+ current_path = '/api/v1/pause/' + task_id.to_s
235
237
  payload = { 'paused' => true, 'level' => level }.to_json
236
238
  @conn.post(current_path, payload)
237
239
  end
@@ -241,7 +243,7 @@ module SFRest
241
243
  # @param [Integer] task_id
242
244
  # @param [String] level family|task
243
245
  def resume_task(task_id, level = 'family')
244
- current_path = '/api/v1/pause/' << task_id.to_s
246
+ current_path = '/api/v1/pause/' + task_id.to_s
245
247
  payload = { 'paused' => false, 'level' => level }.to_json
246
248
  @conn.post(current_path, payload)
247
249
  end
@@ -259,7 +261,7 @@ module SFRest
259
261
  # This will delete the task and its children
260
262
  # @param [Integer] task_id
261
263
  def delete_task(task_id)
262
- current_path = '/api/v1/tasks/' << task_id.to_s
264
+ current_path = '/api/v1/tasks/' + task_id.to_s
263
265
  @conn.delete(current_path)
264
266
  end
265
267
 
@@ -267,7 +269,7 @@ module SFRest
267
269
  # @param [String] type softpaused | softpause-for-update
268
270
  # @return [Array] Array of wip classes
269
271
  def get_task_class_info(type = '')
270
- current_path = '/api/v1/classes/' << type
272
+ current_path = '/api/v1/classes/' + type
271
273
  @conn.get(current_path)
272
274
  end
273
275
 
data/lib/sfrest/theme.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Tell the Factory that there is theme work to do
3
5
  class Theme
data/lib/sfrest/update.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Drive updates on the Site Factory
3
5
  class Update
@@ -24,7 +26,7 @@ module SFRest
24
26
 
25
27
  # Lists vcs refs.
26
28
  def list_vcs_refs(type = 'sites', stack_id = 1)
27
- current_path = '/api/v1/vcs?type=' << type << '&stack_id=' << stack_id.to_s
29
+ current_path = '/api/v1/vcs?type=' + type + '&stack_id=' + stack_id.to_s
28
30
  @conn.get(current_path)
29
31
  end
30
32
 
data/lib/sfrest/usage.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Get all the audit devents.
3
5
  class Usage
data/lib/sfrest/user.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Do User actions within the Site Factory
3
5
  class User
@@ -14,7 +16,7 @@ module SFRest
14
16
  not_done = true
15
17
  count = 0
16
18
  while not_done
17
- current_path = '/api/v1/users?page=' << page.to_s
19
+ current_path = '/api/v1/users?page=' + page.to_s
18
20
  res = @conn.get(current_path)
19
21
  if res['users'] == []
20
22
  not_done = false
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Perform actions against variables in the Factory
3
5
  class Variable
@@ -14,7 +16,7 @@ module SFRest
14
16
 
15
17
  # Gets the value of a specific variable.
16
18
  def get_variable(name)
17
- current_path = '/api/v1/variables?name=' << name
19
+ current_path = '/api/v1/variables?name=' + name
18
20
  @conn.get(current_path)
19
21
  end
20
22
 
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SFRest
2
4
  # Just tracks the version of sfrest.
3
- VERSION = '0.0.26'.freeze
5
+ VERSION = '0.0.27'
4
6
  end
data/lib/sfrest.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Simple wrappper around RestClient.Resource
2
4
  $LOAD_PATH.unshift(__dir__) unless
3
5
  $LOAD_PATH.include?(__dir__) ||
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - ACSF Engineering