salesforce-deploy-tool 0.6.0 → 0.7.0

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
  SHA1:
3
- metadata.gz: 017c01cab1d76fa386f3d7ce393179bfc4f90e5e
4
- data.tar.gz: ebd31823a6824baf96f2dd932a8be0bd04b99682
3
+ metadata.gz: fad8de757cf36572a02786cc1cb215ee881c87d2
4
+ data.tar.gz: 17136965e98bddbe06fd4c28e2e189c0265e1ddd
5
5
  SHA512:
6
- metadata.gz: 4bb293aac72a795e695f3cd7883f7a7ccdc6ed1182a5a4b07986231349e83c905e79b880ed343147dc25ec3bfbae561b6127cdb94db7a1046fd8f3094fdb4d19
7
- data.tar.gz: 8230741c51cec8be54a6f4cf9608b3170829dd3cf8a6fb794ee0284a85222743be988f5f16b445173dbb31017caef5c627574ed832d310daafeb488ed7fc5be9
6
+ metadata.gz: 897cf3aba5186e2a8eb2bd3740f2295824bcb2e3390584f706933052044712dc9b6b11abf4f0eb16259944f44d258ef21a7335ed0912e3a4c23d89bc1b45afcd
7
+ data.tar.gz: 8aa320556bc9183abe9f6e354184a281f69fc3335bf82bce2625c6caff61671d4e64bac57d05933bef636566c6d637b84ac61ad5dd27bc53edfbc4ced8eb51e1
data/bin/sf CHANGED
@@ -1,16 +1,28 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'yaml'
3
+ require 'fileutils'
4
+ require 'pp'
5
+
6
+ CONFIG_DIR = '~/.sf'
7
+ CONFIG_FILE = '~/.sf/credentials.yaml'
8
+ GLOBAL_CONFIG_FILE = '~/.sf/salesforce.yaml'
9
+ SANDBOX_CONFIG_FILE = '~/.sf/salesforce.sbox'
10
+
11
+ FileUtils.mkdir File.expand_path CONFIG_DIR if not Dir.exists? File.expand_path CONFIG_DIR
12
+
13
+ config = {}
14
+ [CONFIG_FILE,GLOBAL_CONFIG_FILE].each do |file|
15
+ file = File.expand_path file
16
+ if File.exists? file
17
+ config_content = YAML::load(File.open(file).read)
18
+ config.merge! config_content if config_content
19
+ else
20
+ FileUtils.touch file
21
+ end
22
+ end
3
23
 
4
- CONFIG_FILE = '~/.salesforce.yaml'
5
- SANDBOX_CONFIG_FILE = '~/.salesforce.sbox'
6
24
 
7
- config = nil
8
- if File.exists? File.expand_path CONFIG_FILE
9
- config = YAML::load File.open(File.expand_path CONFIG_FILE).read
10
- else
11
- puts "error: ~/.salesforce.yaml not found"
12
- exit 1
13
- end
25
+ pp config
14
26
 
15
27
  begin
16
28
  sandbox = File.open(File.expand_path(SANDBOX_CONFIG_FILE)).read
@@ -177,11 +189,11 @@ command :config do |c|
177
189
 
178
190
  config_new[:username] = ask "Please enter your SalesForce production login user name" do |q|
179
191
  q.validate = /^[\.@a-zA-Z\s]+$/
180
- end
192
+ end.to_s
181
193
 
182
194
  config_new[:password] = ask "Please enter your Salesforce production password" do |q|
183
195
  q.echo = "x"
184
- end
196
+ end.to_s
185
197
 
186
198
  git_name = ask "Please enter your Full name to be used as commit owner on GIT" do |q|
187
199
  q.validate = /^[a-zA-Z\s]+$/
@@ -191,13 +203,13 @@ command :config do |c|
191
203
  q.validate = /^.+@.+$/
192
204
  end
193
205
 
194
- %x[git config --global user.email "#{git_email}"]
195
- %x[git config --global user.name "#{git_name}"]
206
+ #%x[git config --global user.email "#{git_email}"]
207
+ #%x[git config --global user.name "#{git_name}"]
196
208
 
197
- config[:username] = config_new[:username].to_s
198
- config[:password] = config_new[:password].to_s
209
+ config[:username] = config_new[:username]
210
+ config[:password] = config_new[:password]
199
211
 
200
- File.open(File.expand_path(CONFIG_FILE),'w').write config.to_yaml
212
+ File.open(File.expand_path(CONFIG_FILE),'w').write config_new.to_yaml
201
213
 
202
214
  end
203
215
  end
@@ -1,3 +1,3 @@
1
1
  module SalesforceDeployTool
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce-deploy-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Breinlinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-01 00:00:00.000000000 Z
11
+ date: 2014-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler