pipeline_deals 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/README.md +47 -8
  2. data/lib/pipeline_deals.rb +5 -4
  3. data/lib/pipeline_deals/admin_resource.rb +6 -0
  4. data/lib/{collection.rb → pipeline_deals/collection.rb} +0 -0
  5. data/lib/{resource.rb → pipeline_deals/resource.rb} +3 -1
  6. data/lib/{resources → pipeline_deals/resources}/company.rb +0 -0
  7. data/lib/pipeline_deals/resources/company_custom_field_label.rb +4 -0
  8. data/lib/pipeline_deals/resources/custom_field_label_dropdown_entry.rb +4 -0
  9. data/lib/pipeline_deals/resources/deal.rb +10 -0
  10. data/lib/pipeline_deals/resources/deal_custom_field_label.rb +4 -0
  11. data/lib/pipeline_deals/resources/deal_stage.rb +4 -0
  12. data/lib/pipeline_deals/resources/definitions.rb +21 -0
  13. data/lib/pipeline_deals/resources/event_category.rb +5 -0
  14. data/lib/pipeline_deals/resources/lead_source.rb +5 -0
  15. data/lib/pipeline_deals/resources/lead_status.rb +4 -0
  16. data/lib/pipeline_deals/resources/note_category.rb +5 -0
  17. data/lib/{resources → pipeline_deals/resources}/person.rb +0 -0
  18. data/lib/pipeline_deals/resources/person_custom_field_label.rb +4 -0
  19. data/lib/pipeline_deals/resources/predefined_contacts_tags.rb +5 -0
  20. data/lib/{resources → pipeline_deals/resources}/user.rb +1 -0
  21. data/lib/{version.rb → pipeline_deals/version.rb} +1 -1
  22. data/pipeline_deals.gemspec +1 -1
  23. data/spec/cassettes/deal_user.yml +46 -0
  24. data/spec/cassettes/get_a_deal.yml +51 -0
  25. data/spec/cassettes/list_deal_stages.yml +47 -0
  26. data/spec/cassettes/list_deals.yml +10 -528
  27. data/spec/cassettes/paginate_deals.yml +12 -33
  28. data/spec/cassettes/update_deal.yml +104 -0
  29. data/spec/cassettes/update_lead_source.yml +197 -0
  30. data/spec/pipeline_deals/admin_spec.rb +14 -0
  31. data/spec/pipeline_deals/deals_spec.rb +53 -0
  32. data/spec/spec_helper.rb +4 -0
  33. metadata +38 -13
  34. data/lib/resources/deal.rb +0 -56
  35. data/lib/resources/definitions.rb +0 -10
  36. data/spec/pipelinedeals_spec.rb +0 -53
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipeline_deals
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-05-17 00:00:00.000000000 Z
12
+ date: 2013-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activeresource
@@ -42,19 +42,36 @@ files:
42
42
  - README.md
43
43
  - Rakefile
44
44
  - a_spike.rb
45
- - lib/collection.rb
46
45
  - lib/pipeline_deals.rb
47
- - lib/resource.rb
48
- - lib/resources/company.rb
49
- - lib/resources/deal.rb
50
- - lib/resources/definitions.rb
51
- - lib/resources/person.rb
52
- - lib/resources/user.rb
53
- - lib/version.rb
46
+ - lib/pipeline_deals/admin_resource.rb
47
+ - lib/pipeline_deals/collection.rb
48
+ - lib/pipeline_deals/resource.rb
49
+ - lib/pipeline_deals/resources/company.rb
50
+ - lib/pipeline_deals/resources/company_custom_field_label.rb
51
+ - lib/pipeline_deals/resources/custom_field_label_dropdown_entry.rb
52
+ - lib/pipeline_deals/resources/deal.rb
53
+ - lib/pipeline_deals/resources/deal_custom_field_label.rb
54
+ - lib/pipeline_deals/resources/deal_stage.rb
55
+ - lib/pipeline_deals/resources/definitions.rb
56
+ - lib/pipeline_deals/resources/event_category.rb
57
+ - lib/pipeline_deals/resources/lead_source.rb
58
+ - lib/pipeline_deals/resources/lead_status.rb
59
+ - lib/pipeline_deals/resources/note_category.rb
60
+ - lib/pipeline_deals/resources/person.rb
61
+ - lib/pipeline_deals/resources/person_custom_field_label.rb
62
+ - lib/pipeline_deals/resources/predefined_contacts_tags.rb
63
+ - lib/pipeline_deals/resources/user.rb
64
+ - lib/pipeline_deals/version.rb
54
65
  - pipeline_deals.gemspec
66
+ - spec/cassettes/deal_user.yml
67
+ - spec/cassettes/get_a_deal.yml
68
+ - spec/cassettes/list_deal_stages.yml
55
69
  - spec/cassettes/list_deals.yml
56
70
  - spec/cassettes/paginate_deals.yml
57
- - spec/pipelinedeals_spec.rb
71
+ - spec/cassettes/update_deal.yml
72
+ - spec/cassettes/update_lead_source.yml
73
+ - spec/pipeline_deals/admin_spec.rb
74
+ - spec/pipeline_deals/deals_spec.rb
58
75
  - spec/spec_helper.rb
59
76
  homepage: https://github.com/PipelineDeals/pipelinedeals_api
60
77
  licenses: []
@@ -68,6 +85,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
85
  - - ! '>='
69
86
  - !ruby/object:Gem::Version
70
87
  version: '0'
88
+ segments:
89
+ - 0
90
+ hash: 171927393080445298
71
91
  required_rubygems_version: !ruby/object:Gem::Requirement
72
92
  none: false
73
93
  requirements:
@@ -81,8 +101,13 @@ signing_key:
81
101
  specification_version: 3
82
102
  summary: The pipeline_deals gem is a nice ruby wrapper around the PipelineDeals API.
83
103
  test_files:
104
+ - spec/cassettes/deal_user.yml
105
+ - spec/cassettes/get_a_deal.yml
106
+ - spec/cassettes/list_deal_stages.yml
84
107
  - spec/cassettes/list_deals.yml
85
108
  - spec/cassettes/paginate_deals.yml
86
- - spec/pipelinedeals_spec.rb
109
+ - spec/cassettes/update_deal.yml
110
+ - spec/cassettes/update_lead_source.yml
111
+ - spec/pipeline_deals/admin_spec.rb
112
+ - spec/pipeline_deals/deals_spec.rb
87
113
  - spec/spec_helper.rb
88
- has_rdoc:
@@ -1,56 +0,0 @@
1
- module PipelineDeals
2
- class Deal < PipelineDeals::Resource
3
- has_many :people, :class_name => PipelineDeals::Person
4
- has_one :primary_contact, :class_name => PipelineDeals::Person
5
- has_one :company, :class_name => PipelineDeals::Company
6
- belongs_to :user, :class_name => PipelineDeals::User
7
-
8
- # {"summary"=>nil,
9
- # "primary_contact_id"=>24,
10
- # "expected_close_date"=>nil,
11
- # "deal_stage_id"=>nil, "name"=>"blah2",
12
- # "primary_contact"=>
13
- # #<PipelineDeals::Deal::PrimaryContact:0x007f92c396b100
14
- # @attributes={"id"=>24, "last_name"=>"buttface", "first_name"=>"Jo"},
15
- # @persisted=true,
16
- # @prefix_options={}>,
17
- # "user_id"=>1,
18
- # "company_id"=>nil,
19
- # "source_id"=>nil,
20
- # "is_example"=>nil,
21
- # "created_at"=>"2013/04/16 10:09:41 -0400",
22
- # "company"=>nil,
23
- # "person_ids"=>[24, 25],
24
- # "collaborators"=>[],
25
- # "people"=>
26
- # [#<PipelineDeals::Person:0x007f92c3969a30
27
- # @attributes={"id"=>24, "last_name"=>"buttface", "first_name"=>"Jo"},
28
- # @persisted=true,
29
- # @prefix_options={}>, #<PipelineDeals::Person:0x007f92c39684a0
30
- # @attributes={"id"=>25, "last_name"=>"O'Kon", "first_name"=>"Sherman"}, @persisted=true, @prefix_options={}>],
31
- # "status"=>2,
32
- # "custom_fields"=>
33
- # #<PipelineDeals::Deal::CustomFields:0x007f92c396d928
34
- # @attributes=
35
- # {"custom_label_29"=>54321,
36
- # "custom_label_27"=>nil,
37
- # "custom_label_26"=>nil,
38
- # "custom_label_25"=>nil},
39
- # @persisted=true,
40
- # @prefix_options={}>,
41
- # "probability"=>99,
42
- # "is_archived"=>false,
43
- # "closed_time"=>nil,
44
- # "deal_stage"=>nil,
45
- # "id"=>1,
46
- # "user"=>
47
- # #<PipelineDeals::Deal::User:0x007f92c3976f00
48
- # @attributes={"id"=>1, "last_name"=>"hoboson", "first_name"=>"hobo"},
49
- # @persisted=true,
50
- # @prefix_options={}>,
51
- # "value_in_cents"=>5588600,
52
- # "import_id"=>nil,
53
- # "updated_at"=>"2013/04/19 18:18:36 -0400",
54
- # "expected_close_date_event_id"=>nil},
55
- end
56
- end
@@ -1,10 +0,0 @@
1
- module PipelineDeals
2
- class Deal < PipelineDeals::Resource; end
3
- class Person < PipelineDeals::Resource; end
4
- class Company < PipelineDeals::Resource; end
5
- class Activity < PipelineDeals::Resource; end
6
- class CalendarTask < PipelineDeals::Resource; end
7
- class CalendarEvent < PipelineDeals::Resource; end
8
- class Document < PipelineDeals::Resource; end
9
- class User < PipelineDeals::Resource; end
10
- end
@@ -1,53 +0,0 @@
1
- require 'spec_helper'
2
- describe PipelineDeals do
3
-
4
- describe "setting the api key" do
5
- it "should allow setting the api key" do
6
- PipelineDeals.should respond_to(:api_key)
7
- end
8
-
9
- it "should hold the api key" do
10
- PipelineDeals.api_key = "n8PJJWRsx0MxgOEwGk7"
11
- PipelineDeals.api_key.should eql("n8PJJWRsx0MxgOEwGk7")
12
- end
13
- end
14
-
15
- describe "deals" do
16
- describe "list deals" do
17
- it "should list deals correctly" do
18
- VCR.use_cassette(:list_deals) do
19
- deals = PipelineDeals::Deal.find(:all)
20
- deals.count.should eql(142)
21
- deals.first.class.should eql(PipelineDeals::Deal)
22
- end
23
- end
24
- describe "pagination" do
25
- it "should paginate" do
26
- VCR.use_cassette(:paginate_deals) do
27
- deals = PipelineDeals::Deal.where(per_page: 5, page: 2)
28
- deals.count.should eql(5)
29
- deals.pagination.should_not be_nil
30
- deals.pagination['page'].should eql(2)
31
- deals.pagination['pages'].should eql(29)
32
- end
33
- end
34
- end
35
-
36
- describe "filtering deals" do
37
-
38
- end
39
- end
40
-
41
- describe "get a single deal" do
42
- end
43
-
44
- describe "update a deal" do
45
-
46
- end
47
-
48
- describe "delete a deal" do
49
-
50
- end
51
- end
52
- end
53
-