snow_sync 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 767c4c759ea7399131d6ac18244530e04ce3adce
4
- data.tar.gz: 9ae30f53d195d5b30be3af7178db1f7991d901b4
3
+ metadata.gz: a63114b35a309a5bdc3714391dc51d33ce00ea45
4
+ data.tar.gz: df6af2460173980d80e7ed4424d7decdde326339
5
5
  SHA512:
6
- metadata.gz: 1ad5b750d3827b94f06cf70ea3c7fcf0d57be2ab14c1009574538dc6b375f44baeefb814281a87d93633e66f75f85402889be555370d1376656ddf43c5c2d864
7
- data.tar.gz: fb8306796cc66077ea171110cbd39c687ab352a5474680d8a5ecea8e2ad6934693a44dde5a7351b8c922a1d392287f9c937e4d3dce1cb8a6b6b0b47821a1f5a8
6
+ metadata.gz: 0d090c298a497186d93292956a31eb63adcc8aca067cf7b5f40ee2657256b6d9a447ef2eaf3a7ce33d6ae48b6f43410b071c11dfe88d60cfee8bc9b06f46e6d4
7
+ data.tar.gz: 68c8c45c05758e7b5dfbb9ebd61e5d6150fd6ddb0021c41277718ee226f84cdadba0036f2bfe35007199fcd8d1a1a5da127ac0f8a4ee8d970ba7954e34e8056f
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # SnowSync
2
2
 
3
+ [![Gem Version](https://img.shields.io/badge/gem-v2.0.4-blue.svg)](https://rubygems.org/gems/snow_sync) [![Dependency Status](https://img.shields.io/badge/dependencies-up--to--date-orange.svg)](https://rubygems.org/gems/snow_sync) [![Downloads](https://img.shields.io/badge/downloads-3k%2B-brightgreen.svg)](https://rubygems.org/gems/snow_sync)
4
+
3
5
  SnowSync is a file sync utility tool and API which provides a bridge for off platform ServiceNow development using an IDE or text editor locally.
4
6
 
5
7
  SnowSync syncronizes configured fields (scripts) for a ServiceNow instance locally, then watches for file changes and syncs back changes to the corresponding record.
@@ -11,9 +11,8 @@ module SnowSync
11
11
 
12
12
  attr_accessor :cf, :configs, :logger
13
13
 
14
- # creates a utility object
15
- # sets the encapsulated data
16
- # opts {string}: optional configuration
14
+ # Creates a utility object & sets the encapsulated config data
15
+ # @param [String] opts Optional configuration
17
16
 
18
17
  def initialize(opts = nil)
19
18
  opts.nil? ? @cf = "configs.yml" : @cf = "test_configs.yml"
@@ -21,9 +20,9 @@ module SnowSync
21
20
  @logger = Logger.new(STDERR)
22
21
  end
23
22
 
24
- # creates a directory if no directory exists
25
- # name {string}: required directory name
26
- # &block {object}: optional directory path
23
+ # Creates a directory if no directory exists
24
+ # @param [String] name Required directory name
25
+ # @param [Object] &block Optional directory path
27
26
 
28
27
  def create_directory(name, &block)
29
28
  yield block if block_given?
@@ -33,11 +32,10 @@ module SnowSync
33
32
  end
34
33
  end
35
34
 
36
- # creates a js file
37
- # logs the file creation
38
- # name {string}: required file name
39
- # json {object}: required json object
40
- # &block {object}: optional file path
35
+ # Creates a JS file & logs the file creation
36
+ # @param [String] name Required file name
37
+ # @param [Object] json Required json object
38
+ # @param [Object] &block Optional file path
41
39
 
42
40
  def create_file(name, json, &block)
43
41
  yield if block_given?
@@ -47,8 +45,8 @@ module SnowSync
47
45
  end
48
46
  end
49
47
 
50
- # checks required configurations
51
- # raises an exception when configs aren't found
48
+ # Checks required configurations
49
+ # @raise [ExceptionClass] Raises exception if configs are not found
52
50
 
53
51
  def check_required_configs
54
52
  missing_path = @configs["conf_path"].nil?
@@ -64,7 +62,7 @@ module SnowSync
64
62
  end
65
63
  end
66
64
 
67
- # encrypts config credentials based on previous sync
65
+ # Encrypts config credentials based on previous sync
68
66
 
69
67
  def encrypt_credentials
70
68
  previous_sync = File.directory?("sync")
@@ -83,7 +81,7 @@ module SnowSync
83
81
  end
84
82
  end
85
83
 
86
- # requests, retrieves, sets up the js script file locally
84
+ # Requests, retrieves, sets up the JS script file locally
87
85
 
88
86
  def setup_sync_directories
89
87
  @configs["table_map"].each do |key, value|
@@ -112,8 +110,8 @@ module SnowSync
112
110
  end
113
111
  end
114
112
 
115
- # classify's a local js file name
116
- # file {string}: js file path
113
+ # Classifies a JS file by name
114
+ # @param [String] file JS file path
117
115
 
118
116
  def classify(file)
119
117
  file = file.split("/").last.split(".").first.camelcase
@@ -121,8 +119,9 @@ module SnowSync
121
119
  file
122
120
  end
123
121
 
124
- # returns the configured SN table hash
125
- # file {string}: js file path
122
+ # Lookup returns the configured servicenow table hash
123
+ # @param [String] file JS file path
124
+ # @return configured servicenow table hash
126
125
 
127
126
  def table_lookup(file)
128
127
  @configs["table_map"].select do |key, value|
@@ -132,10 +131,9 @@ module SnowSync
132
131
  end
133
132
  end
134
133
 
135
- # replaces the encapsulated table response value
136
- # with the current js file updates
137
- # file {string}: js file path
138
- # table_hash {hash}: configured SN table hash
134
+ # Merges JS file changes with the encapsulated table response value
135
+ # @param [String] file JS file path
136
+ # @param [Hash] table_hash Configured servicenow table hash
139
137
 
140
138
  def merge_update(file, table_hash)
141
139
  FileUtils.cd(file.split("/")[0..1].join("/"))
@@ -144,9 +142,7 @@ module SnowSync
144
142
  FileUtils.cd("../..")
145
143
  end
146
144
 
147
- # check required configurations
148
- # encrypt configured credentials
149
- # retrieve, set up the script file locally
145
+ # Completes a sync based on the configurations
150
146
 
151
147
  def start_sync
152
148
  check_required_configs
@@ -154,9 +150,8 @@ module SnowSync
154
150
  setup_sync_directories
155
151
  end
156
152
 
157
- # merges all js file changes
158
- # updates a SN instance with the changes
159
- # files {array}: array of js file paths
153
+ # Merges all JS file changes & pushes to the configured servicenow instance
154
+ # @param [Array] files JS file paths
160
155
 
161
156
  def push_modifications(files)
162
157
  files.each do |file|
@@ -1,3 +1,3 @@
1
1
  module SnowSync
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snow_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Wallace
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-13 00:00:00.000000000 Z
11
+ date: 2017-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler