socialcast 1.0.0.beta4 → 1.0.0

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.
data/config/ldap.yml CHANGED
@@ -49,5 +49,6 @@ options:
49
49
 
50
50
  # http options for connecting to Socialcast servers
51
51
  http:
52
+ timeout: 660
52
53
  # optional setting if script must connect to Socialcast server through a proxy
53
54
  # proxy: "http://username:password@proxy.company.com:3128"
@@ -6,6 +6,7 @@ require 'socialcast'
6
6
  require 'socialcast/message'
7
7
 
8
8
  require 'zlib'
9
+ require 'logger'
9
10
  require 'builder'
10
11
  require 'net/ldap'
11
12
 
@@ -17,7 +18,7 @@ module Socialcast
17
18
  desc "authenticate", "Authenticate using your Socialcast credentials"
18
19
  method_option :user, :type => :string, :aliases => '-u', :desc => 'email address for the authenticated user'
19
20
  method_option :domain, :type => :string, :default => 'api.socialcast.com', :desc => 'socialcast community domain'
20
- method_option :trace, :type => :boolean, :default => false, :aliases => '-v'
21
+ method_option :trace, :type => :boolean, :aliases => '-v'
21
22
  def authenticate
22
23
  user = options[:user] || ask('Socialcast username: ')
23
24
  password = HighLine.new.ask("Socialcast password: ") { |q| q.echo = false }
@@ -27,8 +28,9 @@ module Socialcast
27
28
  say "Authenticating #{user} to #{url}"
28
29
  params = {:email => user, :password => password }
29
30
  resource = RestClient::Resource.new url
31
+ RestClient.log = Logger.new(STDOUT) if options[:trace]
30
32
  response = resource.post params
31
- puts "API response: #{response.body.to_s}" if options[:trace]
33
+ say "API response: #{response.body.to_s}" if options[:trace]
32
34
  communities = JSON.parse(response.body.to_s)['communities']
33
35
  domain = communities.detect {|c| c['domain'] == domain} ? domain : communities.first['domain']
34
36
 
@@ -147,7 +149,7 @@ module Socialcast
147
149
  RestClient.log = Logger.new(STDOUT)
148
150
  RestClient.proxy = http_config['proxy'] if http_config['proxy']
149
151
  url = ['https://', credentials[:domain], '/api/users/provision'].join
150
- private_resource = RestClient::Resource.new url, :user => credentials[:username], :password => credentials[:password], :timeout => 660
152
+ private_resource = RestClient::Resource.new url, :user => credentials[:user], :password => credentials[:password], :timeout => http_config['timeout']
151
153
  File.open(output_file, 'r') do |file|
152
154
  request_params = {:file => file}
153
155
  request_params[:skip_emails] = 'true' if (config['options']["skip_emails"] || options[:skip_emails])
@@ -1,3 +1,3 @@
1
1
  module Socialcast
2
- VERSION = "1.0.0.beta4"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196363
5
- prerelease: 6
4
+ hash: 23
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
- - beta
11
- - 4
12
- version: 1.0.0.beta4
10
+ version: 1.0.0
13
11
  platform: ruby
14
12
  authors:
15
13
  - Ryan Sonnek
@@ -161,14 +159,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
159
  required_rubygems_version: !ruby/object:Gem::Requirement
162
160
  none: false
163
161
  requirements:
164
- - - ">"
162
+ - - ">="
165
163
  - !ruby/object:Gem::Version
166
- hash: 25
164
+ hash: 3
167
165
  segments:
168
- - 1
169
- - 3
170
- - 1
171
- version: 1.3.1
166
+ - 0
167
+ version: "0"
172
168
  requirements: []
173
169
 
174
170
  rubyforge_project: socialcast