herder 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ pkg
@@ -1,9 +1,5 @@
1
1
  language: ruby
2
2
 
3
- branches:
4
- only:
5
- - master
6
-
7
3
  rvm:
8
4
  - 1.9.3
9
5
 
@@ -4,6 +4,7 @@ PATH
4
4
  herder (0.0.1)
5
5
  active_resource_pagination
6
6
  activeresource
7
+ reactive_resource
7
8
  will_paginate
8
9
 
9
10
  GEM
@@ -24,6 +25,9 @@ GEM
24
25
  i18n (0.6.0)
25
26
  multi_json (1.3.6)
26
27
  rake (0.9.2.2)
28
+ reactive_resource (0.7.0)
29
+ activeresource (>= 3.1)
30
+ activesupport (>= 3.1)
27
31
  rspec (2.11.0)
28
32
  rspec-core (~> 2.11.0)
29
33
  rspec-expectations (~> 2.11.0)
data/README.md CHANGED
@@ -47,6 +47,7 @@ Attendee.find(1)
47
47
 
48
48
  ## Changelog
49
49
 
50
+ * 0.0.2 - Added emails, tickets, and association
50
51
  * 0.0.1 - Added basic attendee interface
51
52
 
52
53
  ## License
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'rspec'
22
22
 
23
23
  s.add_dependency 'activeresource'
24
+ s.add_dependency 'reactive_resource'
24
25
  s.add_dependency 'active_resource_pagination'
25
26
  s.add_dependency 'will_paginate'
26
27
  end
@@ -1,9 +1,12 @@
1
1
  require "active_resource"
2
+ require "reactive_resource"
2
3
  require "active_resource_pagination"
3
4
 
4
5
  require_relative "herder/config"
5
6
  require_relative "herder/model"
6
7
  require_relative "herder/attendee"
8
+ require_relative "herder/ticket"
9
+ require_relative "herder/email"
7
10
 
8
11
  class Herder
9
12
  end
@@ -1,5 +1,6 @@
1
1
  class Herder
2
2
  class Attendee < Herder::Model
3
- self.element_name = "attendee"
3
+ has_many :emails
4
+ has_many :tickets
4
5
  end
5
6
  end
@@ -0,0 +1,5 @@
1
+ class Herder
2
+ class Email < Herder::Model
3
+ belongs_to :attendee
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  class Herder
2
- class Model < ActiveResource::Base
2
+ class Model < ReactiveResource::Base
3
3
  self.site = Herder::Config.get("site")
4
4
  self.user = Herder::Config.get("user")
5
5
  self.password = Herder::Config.get("password")
@@ -0,0 +1,5 @@
1
+ class Herder
2
+ class Ticket < Herder::Model
3
+ belongs_to :attendee
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  class Herder
2
- VERSION = "0.0.1" unless defined? Herder::VERSION
2
+ VERSION = "0.0.2" unless defined? Herder::VERSION
3
3
  end
@@ -8,4 +8,9 @@ describe Herder::Attendee do
8
8
  it "should inherit Herder::Model" do
9
9
  Herder::Attendee.new.should be_a(Herder::Model)
10
10
  end
11
+
12
+ it "should have many tickets and emails" do
13
+ Herder::Attendee.associations.map(&:attribute).should =~ [:tickets, :emails]
14
+ Herder::Attendee.associations.map(&:class).uniq.should be == [ReactiveResource::Association::HasManyAssociation]
15
+ end
11
16
  end
@@ -0,0 +1,16 @@
1
+ require "spec_helper"
2
+
3
+ describe Herder::Email do
4
+ it "should setup right name" do
5
+ Herder::Email.element_name.should be == "email"
6
+ end
7
+
8
+ it "should inherit Herder::Model" do
9
+ Herder::Email.new.should be_a(Herder::Model)
10
+ end
11
+
12
+ it "should belong to an attendee" do
13
+ Herder::Ticket.associations.map(&:attribute).should =~ [:attendee]
14
+ Herder::Ticket.associations.map(&:class).should be == [ReactiveResource::Association::BelongsToAssociation]
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require "spec_helper"
2
+
3
+ describe Herder::Ticket do
4
+ it "should setup right name" do
5
+ Herder::Ticket.element_name.should be == "ticket"
6
+ end
7
+
8
+ it "should inherit Herder::Model" do
9
+ Herder::Ticket.new.should be_a(Herder::Model)
10
+ end
11
+
12
+ it "should belong to an attendee" do
13
+ Herder::Ticket.associations.map(&:attribute).should =~ [:attendee]
14
+ Herder::Ticket.associations.map(&:class).should be == [ReactiveResource::Association::BelongsToAssociation]
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herder
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,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-12 00:00:00.000000000 Z
12
+ date: 2012-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70349777641740 !ruby/object:Gem::Requirement
16
+ requirement: &70333801744000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70349777641740
24
+ version_requirements: *70333801744000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activeresource
27
- requirement: &70349777632640 !ruby/object:Gem::Requirement
27
+ requirement: &70333801743580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,21 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70349777632640
35
+ version_requirements: *70333801743580
36
+ - !ruby/object:Gem::Dependency
37
+ name: reactive_resource
38
+ requirement: &70333801743160 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70333801743160
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: active_resource_pagination
38
- requirement: &70349777629560 !ruby/object:Gem::Requirement
49
+ requirement: &70333801742740 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ! '>='
@@ -43,10 +54,10 @@ dependencies:
43
54
  version: '0'
44
55
  type: :runtime
45
56
  prerelease: false
46
- version_requirements: *70349777629560
57
+ version_requirements: *70333801742740
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: will_paginate
49
- requirement: &70349777625780 !ruby/object:Gem::Requirement
60
+ requirement: &70333801742320 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - ! '>='
@@ -54,7 +65,7 @@ dependencies:
54
65
  version: '0'
55
66
  type: :runtime
56
67
  prerelease: false
57
- version_requirements: *70349777625780
68
+ version_requirements: *70333801742320
58
69
  description: The herder that manages all animals talking to the hamster
59
70
  email:
60
71
  - cristiano@geeksoflondon.com
@@ -62,6 +73,7 @@ executables: []
62
73
  extensions: []
63
74
  extra_rdoc_files: []
64
75
  files:
76
+ - .gitignore
65
77
  - .rspec
66
78
  - .rvmrc
67
79
  - .travis.yml
@@ -74,11 +86,15 @@ files:
74
86
  - lib/herder.rb
75
87
  - lib/herder/attendee.rb
76
88
  - lib/herder/config.rb
89
+ - lib/herder/email.rb
77
90
  - lib/herder/model.rb
91
+ - lib/herder/ticket.rb
78
92
  - lib/herder/version.rb
79
93
  - spec/herder/attendee_spec.rb
80
94
  - spec/herder/config_spec.rb
95
+ - spec/herder/email_spec.rb
81
96
  - spec/herder/model_spec.rb
97
+ - spec/herder/ticket_spec.rb
82
98
  - spec/herder_spec.rb
83
99
  - spec/spec_helper.rb
84
100
  homepage: http://github.com/geeksoflondon/herder
@@ -108,6 +124,8 @@ summary: The herder
108
124
  test_files:
109
125
  - spec/herder/attendee_spec.rb
110
126
  - spec/herder/config_spec.rb
127
+ - spec/herder/email_spec.rb
111
128
  - spec/herder/model_spec.rb
129
+ - spec/herder/ticket_spec.rb
112
130
  - spec/herder_spec.rb
113
131
  - spec/spec_helper.rb