ruby_desk 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  gem.email = "ahmed.eldawy@badrit.com"
11
11
  gem.homepage = "http://github.com/aseldawy/ruby_desk"
12
12
  gem.authors = ["Ahmed ElDawy"]
13
- gem.files = FileList['lib/**/*.rb', '[A-Z]*', 'test/**/*'].to_a
13
+ gem.files = FileList['lib/categories', 'lib/**/*.rb', '[A-Z]*', 'test/**/*'].to_a
14
14
  gem.add_dependency('json')
15
15
  # gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
16
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/lib/categories ADDED
@@ -0,0 +1,84 @@
1
+ Web Development
2
+ * Web Design
3
+ * Web Programming
4
+ * Ecommerce
5
+ * UI Design
6
+ * Website QA
7
+ * Website Project Management
8
+ * Other - Web Development
9
+ Software Development
10
+ * Desktop Applications
11
+ * Game Development
12
+ * Scripts & Utilities
13
+ * Software Plug-ins
14
+ * Mobile Apps
15
+ * Application Interface Design
16
+ * Software Project Management
17
+ * Software QA
18
+ * VOIP
19
+ * Other - Software Development
20
+ Networking & Information Systems
21
+ * Network Administration
22
+ * DBA - Database Administration
23
+ * Server Administration
24
+ * ERP / CRM Implementation
25
+ * Other - Networking & Information Systems
26
+ Writing & Translation
27
+ * Technical Writing
28
+ * Website Content
29
+ * Blog & Article Writing
30
+ * Copywriting
31
+ * Translation
32
+ * Creative Writing
33
+ * Other - Writing & Translation
34
+ Administrative Support
35
+ * Data Entry
36
+ * Personal Assistant
37
+ * Web Research
38
+ * Email Response Handling
39
+ * Transcription
40
+ * Other - Administrative Support
41
+ Design & Multimedia
42
+ * Graphic Design
43
+ * Logo Design
44
+ * Illustration
45
+ * Print Design
46
+ * 3D Modeling & CAD
47
+ * Audio Production
48
+ * Video Production
49
+ * Voice Talent
50
+ * Animation
51
+ * Presentations
52
+ * Engineering & Technical Design
53
+ * Other - Design & Multimedia
54
+ Customer Service
55
+ * Customer Service & Support
56
+ * Technical support
57
+ * Phone Support
58
+ * Order Processing
59
+ * Other - Customer Service
60
+ Sales & Marketing
61
+ * Advertising
62
+ * Email Marketing
63
+ * SEO - Search Engine Optimization
64
+ * SEM - Search Engine Marketing
65
+ * SMM - Social Media Marketing
66
+ * PR - Public Relations
67
+ * Telemarketing & Telesales
68
+ * Business Plans & Marketing Strategy
69
+ * Market Research & Surveys
70
+ * Sales & Lead Generation
71
+ * Other - Sales & Marketing
72
+ Business Services
73
+ * Accounting
74
+ * Bookkeeping
75
+ * HR / Payroll
76
+ * Financial Services & Planning
77
+ * Payment Processing
78
+ * Legal
79
+ * Project Management
80
+ * Business Consulting
81
+ * Recruiting
82
+ * Statistical Analysis
83
+ * Other - Business Services
84
+
@@ -46,11 +46,11 @@ module RubyDesk
46
46
  def prepare_api_call(path, options = {})
47
47
  options = DEFAULT_OPTIONS.merge(options)
48
48
  params = options[:params]
49
- params[:api_sig] = sign(params) if options[:sign] || options[:auth]
50
49
  if options[:auth]
51
50
  params[:api_token] ||= @api_token
52
51
  params[:api_key] ||= @api_key
53
52
  end
53
+ params[:api_sig] = sign(params) if options[:sign] || options[:auth]
54
54
  url = (options[:secure] ? "https" : "http") + "://"
55
55
  url << options[:base_url] << path
56
56
  url << ".#{options[:format]}" if options[:format]
@@ -89,8 +89,9 @@ module RubyDesk
89
89
  # Returns the URL that authenticates the application for the current user
90
90
  def auth_url
91
91
  auth_call = prepare_api_call("", :params=>{:api_key=>@api_key},
92
- :base_url=>ODESK_AUTH_URL)
93
- return auth_call[:url]
92
+ :base_url=>ODESK_AUTH_URL, :format=>nil, :method=>:get, :auth=>false)
93
+ data = auth_call[:params].to_a.map{|pair| pair.join '='}.join('&')
94
+ return auth_call[:url]+"?"+data
94
95
  end
95
96
 
96
97
  # return the URL that logs user out of odesk applications
@@ -1,4 +1,46 @@
1
1
  class RubyDesk::Provider < RubyDesk::OdeskEntity
2
+
3
+ attributes :affiliated, :ag_name, :ag_description, :dev_adj_score_recent,
4
+ :dev_is_affiliated, :profile_title_full, :dev_total_hours_rounded,
5
+ :favorited, :ag_member_since, :ag_tot_feedback, :ag_recent_hours,
6
+ :dev_last_worked, :ciphertext, :dev_pay_rate, :dev_agency_ref,
7
+ :competencies, :dev_usr_score, :dev_eng_skill, :dev_ic, :dev_bill_rate,
8
+ :dev_tot_feedback_recent, :ag_rank_percentile,
9
+ :dev_agency_ciphertext, :ag_total_developers, :ag_hours_lastdays,
10
+ :dev_blurb, :agency_ciphertext, :dev_total_assignments, :tsexams,
11
+ :dev_short_name, :dev_active_interviews, :dev_full_name, :dev_country,
12
+ :dev_expose_full_name, :dev_city, :provider_profile_api, :ag_manager_blurb,
13
+ :job_categories, :dev_year_exp, :dev_billed_assignments, :dev_portrait,
14
+ :experiences, :ag_total_hours, :candidacies, :dev_last_activity,
15
+ :dev_billed_assignments_recent, :dev_rank_percentile, :assignments, :dev_region,
16
+ :search_affiliate_providers_url, :ag_billed_assignments, :ag_teamid_rollup,
17
+ :dev_member_since, :dev_availability, :dev_profile_title, :dev_category,
18
+ :assignments_count, :dev_total_hours, :dev_portfolio_items_count,
19
+ :dev_recno, :certification, :ag_teamid, :education, :dev_cur_assignments,
20
+ :version, :oth_experiences, :dev_recent_rank_percentile, :is_odesk_ready,
21
+ :response_time, :ag_cny_recno, :ag_country, :ag_portrait, :dev_is_ready,
22
+ :dev_adj_score, :dev_groups, :dev_blurb_short, :ag_last_date_worked,
23
+ :ag_adj_score_recent, :dev_ui_profile_access, :dev_pay_agency_rate, :trends,
24
+ :dev_location, :dev_est_availability, :tsexams_count, :permalink, :ag_logo,
25
+ :ag_adj_score, :dev_recent_hours, :dev_timezone, :ag_country_tz, :ag_city,
26
+ :dev_test_passed_count, :dev_tot_feedback, :ag_summary, :ag_manager_name,
27
+ :ag_active_assignments, :portfolio_items
28
+
29
+ attribute :skills, :class=>RubyDesk::Skill, :sub_element=>'skill'
30
+ attribute :dev_scores, :class=>RubyDesk::DeveloperSkill, :sub_element=>'dev_score'
31
+ attribute :dev_ac_agencies, :class=>RubyDesk::Agency, :sub_element=>'dev_ac_agency'
32
+ attribute :competencies, :class=>RubyDesk::Competency, :sub_element=>'competency'
33
+ attribute :tsexams, :class=>RubyDesk::Exam, :sub_element=>'tsexam'
34
+ attribute :job_categories, :class=>RubyDesk::JobCategory, :sub_element=>'job_category'
35
+ attribute :experiences, :class=>RubyDesk::Experience, :sub_element=>'experience'
36
+ attribute :candidacies, :class=>RubyDesk::Candidacy, :sub_element=>'candidacy'
37
+ attribute :assignments, :class=>RubyDesk::Assignment, :sub_element=>'assignments'
38
+ attribute :certification, :class=>RubyDesk::Certificate, :sub_element=>'certificate'
39
+ attribute :education, :class=>RubyDesk::Institution, :sub_element=>'institution'
40
+ attribute :oth_experiences, :class=>RubyDesk::OtherExperience, :sub_element=>'oth_experience'
41
+ attribute :trends, :class=>RubyDesk::Trend, :sub_element=>'trend'
42
+ attribute :portfolio_items, :class=>RubyDesk::PortfolioItem, :sub_element=>'portfolio_item'
43
+
2
44
  class << self
3
45
  def all_categories
4
46
  text = File.read(File.join(File.dirname(__FILE__), "..", "categories"))
@@ -75,7 +117,8 @@ class RubyDesk::Provider < RubyDesk::OdeskEntity
75
117
  return search(connector, :q=>options.to_str)
76
118
  end
77
119
  response = connector.prepare_and_invoke_api_call(
78
- 'profiles/v1/search/providers', :method=>:get)
120
+ 'profiles/v1/search/providers', :method=>:get,
121
+ :auth=>false, :sign=>false)
79
122
  # parses a JSON result returned from oDesk and extracts an array of Providers out of it
80
123
  json = JSON.parse(response)
81
124
  providers = []
@@ -96,46 +139,6 @@ class RubyDesk::Provider < RubyDesk::OdeskEntity
96
139
  # Save categories in a constant
97
140
  AllCategories = all_categories
98
141
 
99
- attributes :ag_name, :ag_description, :dev_adj_score_recent, :dev_is_affiliated,
100
- :profile_title_full, :dev_total_hours_rounded, :favorited, :ag_member_since,
101
- :ag_tot_feedback, :ag_recent_hours, :dev_last_worked, :ciphertext,
102
- :dev_pay_rate, :dev_agency_ref, :competencies, :dev_usr_score, :dev_eng_skill,
103
- :dev_ic, :dev_bill_rate, :dev_tot_feedback_recent, :ag_rank_percentile,
104
- :dev_agency_ciphertext, :ag_total_developers, :ag_hours_lastdays,
105
- :dev_blurb, :agency_ciphertext, :dev_total_assignments, :tsexams,
106
- :dev_short_name, :dev_active_interviews, :dev_full_name, :dev_country,
107
- :dev_expose_full_name, :dev_city, :provider_profile_api, :ag_manager_blurb,
108
- :job_categories, :dev_year_exp, :dev_billed_assignments, :dev_portrait,
109
- :experiences, :ag_total_hours, :candidacies, :dev_last_activity,
110
- :dev_billed_assignments_recent, :dev_rank_percentile, :assignments, :dev_region,
111
- :search_affiliate_providers_url, :ag_billed_assignments, :ag_teamid_rollup,
112
- :dev_member_since, :dev_availability, :dev_profile_title, :dev_category,
113
- :assignments_count, :dev_total_hours, :dev_portfolio_items_count,
114
- :dev_recno, :certification, :ag_teamid, :education, :dev_cur_assignments,
115
- :version, :oth_experiences, :dev_recent_rank_percentile, :is_odesk_ready,
116
- :response_time, :ag_cny_recno, :ag_country, :ag_portrait, :dev_is_ready,
117
- :dev_adj_score, :dev_groups, :dev_blurb_short, :ag_last_date_worked,
118
- :ag_adj_score_recent, :dev_ui_profile_access, :dev_pay_agency_rate, :trends,
119
- :dev_location, :dev_est_availability, :tsexams_count, :permalink, :ag_logo,
120
- :ag_adj_score, :dev_recent_hours, :dev_timezone, :ag_country_tz, :ag_city,
121
- :dev_test_passed_count, :dev_tot_feedback, :ag_summary, :ag_manager_name,
122
- :ag_active_assignments, :portfolio_items
123
-
124
- attribute :skills, :class=>RubyDesk::Skill, :sub_element=>'skill'
125
- attribute :dev_scores, :class=>RubyDesk::DeveloperSkill, :sub_element=>'dev_score'
126
- attribute :dev_ac_agencies, :class=>RubyDesk::Agency, :sub_element=>'dev_ac_agency'
127
- attribute :competencies, :class=>RubyDesk::Competency, :sub_element=>'competency'
128
- attribute :tsexams, :class=>RubyDesk::Exam, :sub_element=>'tsexam'
129
- attribute :job_categories, :class=>RubyDesk::JobCategory, :sub_element=>'job_category'
130
- attribute :experiences, :class=>RubyDesk::Experience, :sub_element=>'experience'
131
- attribute :candidacies, :class=>RubyDesk::Candidacy, :sub_element=>'candidacy'
132
- attribute :assignments, :class=>RubyDesk::Assignment, :sub_element=>'assignments'
133
- attribute :certification, :class=>RubyDesk::Certificate, :sub_element=>'certificate'
134
- attribute :education, :class=>RubyDesk::Institution, :sub_element=>'institution'
135
- attribute :oth_experiences, :class=>RubyDesk::OtherExperience, :sub_element=>'oth_experience'
136
- attribute :trends, :class=>RubyDesk::Trend, :sub_element=>'trend'
137
- attribute :portfolio_items, :class=>RubyDesk::PortfolioItem, :sub_element=>'portfolio_item'
138
-
139
142
  def iinitialize(params={})
140
143
  params.each do |k, v|
141
144
  case k.to_s
data/lib/ruby_desk.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'json'
3
3
 
4
4
  module RubyDesk
5
+ class Error < RuntimeError; end;
5
6
  end
6
7
 
7
8
  # This first file is required by other files
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_desk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmed ElDawy
@@ -36,6 +36,7 @@ files:
36
36
  - README.rdoc
37
37
  - Rakefile
38
38
  - VERSION
39
+ - lib/categories
39
40
  - lib/ruby_desk.rb
40
41
  - lib/ruby_desk/connector.rb
41
42
  - lib/ruby_desk/odesk_entity.rb