databasedotcom_console 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/dbdc CHANGED
@@ -2,21 +2,34 @@
2
2
 
3
3
  require 'databasedotcom_console'
4
4
  require 'irb'
5
- @dbdc = Databasedotcom::Client.new(
6
- :client_id => '3MVG9QDx8IX8nP5RUXIFbi3L4rSVruiBU4O_ozvkJiU0aGZDBxfsF6XDhngJf6Ha2fDNniyDxpt0Gb9Pp.2Tk',
7
- :client_secret => '7712607496533706277',
8
- :host => ARGV[0]
9
- )
10
- @dbdc.authenticate( :username => ARGV[1], :password => ARGV[2] )
11
5
 
12
- puts "\n\nWelcome to the Databasedotcom Ruby Console. \nYou you can access your databasedotcom client via the variable @dbdc"
13
- puts "\nExamples: \n"
14
- puts "@dbdc.list_sobjects"
15
- puts "@dbdc.materialze \'Account\'"
16
- puts "john = Account.find_by_LastName \'Yamaguchi\'"
17
- puts "account_list = Account.query \'FirstName != null AND My_Custom_Field__C > 7 LIMIT 10\' \n"
18
- puts "\n\n"
19
- puts "Check out https://github.com/heroku/databasedotcom for more documentation on the databasedotcom gem\n\n"
6
+ ohnoes = false
7
+ begin
8
+ @dbdc = Databasedotcom::Client.new(
9
+ :client_id => '3MVG9QDx8IX8nP5RUXIFbi3L4rSVruiBU4O_ozvkJiU0aGZDBxfsF6XDhngJf6Ha2fDNniyDxpt0Gb9Pp.2Tk',
10
+ :client_secret => '7712607496533706277',
11
+ :host => ARGV[0]
12
+ )
13
+ @dbdc.authenticate( :username => ARGV[1], :password => ARGV[2] )
14
+ rescue Exception => e
15
+ ohnoes = true
16
+ puts "ERROR: #{e.message}"
17
+ puts "\nOh Noes! Looks like an error occurred. Make sure you include your salesforce credentials in the following format: \n"
18
+ puts " >> dbdc [host] [username] [password]"
19
+ puts "\nwhere host is likely either \'test.salesforce.com\'' or \'login.salesforce.com\' \n"
20
+ puts "If your org requires a security token, please be sure to concatenate it at the end of your password. \n\n"
21
+ end
20
22
 
21
- ARGV.clear
22
- IRB.start
23
+ unless ohnoes
24
+ puts "\n\nWelcome to the Databasedotcom Ruby Console. \nYou you can access your databasedotcom client via the variable @dbdc"
25
+ puts "\nExamples: \n"
26
+ puts "@dbdc.list_sobjects"
27
+ puts "@dbdc.materialze \'Account\'"
28
+ puts "john = Account.find_by_LastName \'Yamaguchi\'"
29
+ puts "account_list = Account.query \'FirstName != null AND My_Custom_Field__C > 7 LIMIT 10\' \n"
30
+ puts "\n\n"
31
+ puts "Check out https://github.com/heroku/databasedotcom for more documentation on the databasedotcom gem\n\n"
32
+
33
+ ARGV.clear
34
+ IRB.start
35
+ end
@@ -1,3 +1,3 @@
1
1
  module DatabasedotcomConsole
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: databasedotcom_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-29 00:00:00.000000000 Z
12
+ date: 2013-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: databasedotcom