Browse files

beginning thor integration

  • Loading branch information...
1 parent 1d08ddc commit d06d6902eac646322c036168bc0d073c071e5367 @noeticpenguin noeticpenguin committed Apr 3, 2012
Showing with 38 additions and 2 deletions.
  1. +2 −0 Gemfile
  2. +5 −0 bin/metaforce
  3. +29 −0 lib/metaforce/thor/metaforce.rb
  4. +2 −2 metaforce.gemspec
View
2 Gemfile
@@ -1,4 +1,6 @@
source "http://rubygems.org"
+gem 'highline'
+gem 'thor'
# Specify your gem's dependencies in metaforce.gemspec
gemspec
View
5 bin/metaforce
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+
+require 'lib/metaforce/thor/metaforce'
+
+MetaForce.start
View
29 lib/metaforce/thor/metaforce.rb
@@ -0,0 +1,29 @@
+class MetaForce < Thor
+ include Thor::Actions
+ include Utility
+
+ desc "login", "accepts login parameters and completes a soap call to salesforce via the partner api."
+ def login
+ if File.exists? LoginDetails::STORAGE_LOCATION
+ say "using stored login information"
+ @login_details = LoginDetails.load
+ @connection = PartnerApi.login(@login_details.username, @login_details.password, @login_details.security_token)
+ else
+ login_email = ask "Login Email address: "
+ login_pass = masked_ask "Login Password : "
+ login_security_token = masked_ask "Security Token : "
+ say "If you'd like I can save this login information to this directories .git/config/force.com.config"
+ say "----- PLEASE NOTE, HOWEVER, THAT SAVING THIS INFORMATION IS INSECURE AND IS IN NO WAY ENCRYPTED"
+ save = yes? "Should I save this Login information? (y/n) "
+
+ if save
+ LoginDetails.new(login_email, login_pass, login_security_token).save
+ else
+ @login_details = LoginDetails.new(login_email, login_pass, login_security_token)
+ @connection = PartnerApi.login(@login_details.username, @login_details.password, @login_details.security_token)
+ end
+
+ end
+ end
+
+end
View
4 metaforce.gemspec
@@ -5,8 +5,8 @@ require "metaforce/version"
Gem::Specification.new do |s|
s.name = "metaforce"
s.version = Metaforce::VERSION
- s.authors = ["Eric J. Holmes"]
- s.email = ["eric@ejholmes.net"]
+ s.authors = ["Eric J. Holmes", "Kevin J. Poorman"]
+ s.email = ["eric@ejholmes.net", "Kevinp@madronasg.com"]
s.homepage = "https://github.com/ejholmes/metaforce"
s.summary = %q{A Ruby gem for interacting with the Salesforce Metadata API}
s.description = %q{A Ruby gem for interacting with the Salesforce Metadata API}

0 comments on commit d06d690

Please sign in to comment.