logical_model 0.1.10 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source "http://rubygems.org"
4
4
  gem "activemodel"
5
5
  gem "activesupport"
6
6
  gem "typhoeus", "~> 0.2.4"
7
- gem "will_paginate", "~> 3.0.pre2"
7
+ gem "kaminari"
8
8
 
9
9
  group :development do
10
10
  gem "shoulda"
data/Gemfile.lock CHANGED
@@ -1,26 +1,81 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ abstract (1.0.0)
5
+ actionmailer (3.0.7)
6
+ actionpack (= 3.0.7)
7
+ mail (~> 2.2.15)
8
+ actionpack (3.0.7)
9
+ activemodel (= 3.0.7)
10
+ activesupport (= 3.0.7)
11
+ builder (~> 2.1.2)
12
+ erubis (~> 2.6.6)
13
+ i18n (~> 0.5.0)
14
+ rack (~> 1.2.1)
15
+ rack-mount (~> 0.6.14)
16
+ rack-test (~> 0.5.7)
17
+ tzinfo (~> 0.3.23)
4
18
  activemodel (3.0.7)
5
19
  activesupport (= 3.0.7)
6
20
  builder (~> 2.1.2)
7
21
  i18n (~> 0.5.0)
22
+ activerecord (3.0.7)
23
+ activemodel (= 3.0.7)
24
+ activesupport (= 3.0.7)
25
+ arel (~> 2.0.2)
26
+ tzinfo (~> 0.3.23)
27
+ activeresource (3.0.7)
28
+ activemodel (= 3.0.7)
29
+ activesupport (= 3.0.7)
8
30
  activesupport (3.0.7)
31
+ arel (2.0.10)
9
32
  builder (2.1.2)
33
+ erubis (2.6.6)
34
+ abstract (>= 1.0.0)
10
35
  git (1.2.5)
11
36
  i18n (0.5.0)
12
37
  jeweler (1.6.4)
13
38
  bundler (~> 1.0)
14
39
  git (>= 1.2.5)
15
40
  rake
41
+ kaminari (0.12.4)
42
+ rails (>= 3.0.0)
43
+ mail (2.2.19)
44
+ activesupport (>= 2.3.6)
45
+ i18n (>= 0.4.0)
46
+ mime-types (~> 1.16)
47
+ treetop (~> 1.4.8)
16
48
  mime-types (1.16)
49
+ polyglot (0.3.2)
50
+ rack (1.2.3)
51
+ rack-mount (0.6.14)
52
+ rack (>= 1.0.0)
53
+ rack-test (0.5.7)
54
+ rack (>= 1.0)
55
+ rails (3.0.7)
56
+ actionmailer (= 3.0.7)
57
+ actionpack (= 3.0.7)
58
+ activerecord (= 3.0.7)
59
+ activeresource (= 3.0.7)
60
+ activesupport (= 3.0.7)
61
+ bundler (~> 1.0)
62
+ railties (= 3.0.7)
63
+ railties (3.0.7)
64
+ actionpack (= 3.0.7)
65
+ activesupport (= 3.0.7)
66
+ rake (>= 0.8.7)
67
+ thor (~> 0.14.4)
17
68
  rake (0.9.2)
18
69
  rcov (0.9.9)
19
70
  shoulda (2.11.3)
71
+ thor (0.14.6)
72
+ treetop (1.4.10)
73
+ polyglot
74
+ polyglot (>= 0.3.1)
20
75
  typhoeus (0.2.4)
21
76
  mime-types
22
77
  mime-types
23
- will_paginate (3.0.pre2)
78
+ tzinfo (0.3.29)
24
79
 
25
80
  PLATFORMS
26
81
  ruby
@@ -30,7 +85,7 @@ DEPENDENCIES
30
85
  activesupport
31
86
  bundler (~> 1.0.0)
32
87
  jeweler (~> 1.6.4)
88
+ kaminari
33
89
  rcov
34
90
  shoulda
35
91
  typhoeus (~> 0.2.4)
36
- will_paginate (~> 3.0.pre2)
data/README.rdoc CHANGED
@@ -19,7 +19,6 @@ gem "logical_model"
19
19
  * Commit and push until you are happy with your contribution
20
20
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
21
21
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
22
- * PivotalTracker: https://www.pivotaltracker.com/projects/339595
23
22
 
24
23
  == Copyright
25
24
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.2.0
data/lib/logical_model.rb CHANGED
@@ -3,6 +3,7 @@ require 'active_model'
3
3
  require 'typhoeus'
4
4
  require 'active_support' # todo migrate to yajl
5
5
  require 'logger'
6
+ require 'kaminari'
6
7
 
7
8
  # Logical Model, not persistant on DB, works through API. (replaces ActiveResource)
8
9
  #
@@ -180,9 +181,7 @@ class LogicalModel
180
181
  result_set = self.from_json(response.body)
181
182
 
182
183
  # this paginate is will_paginate's Array pagination
183
- collection = result_set[:collection].paginate(:page => options[:page],
184
- :total_entries => result_set[:total],
185
- :per_page => options[:per_page])
184
+ collection = Kaminari.paginate_array(result_set[:collection]).page(options[:page]).per(options[:per_page])
186
185
 
187
186
  yield collection
188
187
  else
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{logical_model}
8
- s.version = "0.1.10"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Dwayne Macgowan}]
12
- s.date = %q{2011-07-29}
12
+ s.date = %q{2011-09-09}
13
13
  s.description = %q{LogicalModel allows to use a resource as a model. It is based on web presentation http://www.slideshare.net/ihower/serviceoriented-design-and-implement-with-rails3}
14
14
  s.email = %q{dwaynemac@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.homepage = %q{http://github.com/dwaynemac/logical_model}
33
33
  s.licenses = [%q{MIT}]
34
34
  s.require_paths = [%q{lib}]
35
- s.rubygems_version = %q{1.8.5}
35
+ s.rubygems_version = %q{1.8.8}
36
36
  s.summary = %q{LogicalModel allows to use a resource as a model.}
37
37
 
38
38
  if s.respond_to? :specification_version then
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.add_runtime_dependency(%q<activemodel>, [">= 0"])
43
43
  s.add_runtime_dependency(%q<activesupport>, [">= 0"])
44
44
  s.add_runtime_dependency(%q<typhoeus>, ["~> 0.2.4"])
45
- s.add_runtime_dependency(%q<will_paginate>, ["~> 3.0.pre2"])
45
+ s.add_runtime_dependency(%q<kaminari>, [">= 0"])
46
46
  s.add_development_dependency(%q<shoulda>, [">= 0"])
47
47
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
48
48
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
@@ -51,7 +51,7 @@ Gem::Specification.new do |s|
51
51
  s.add_dependency(%q<activemodel>, [">= 0"])
52
52
  s.add_dependency(%q<activesupport>, [">= 0"])
53
53
  s.add_dependency(%q<typhoeus>, ["~> 0.2.4"])
54
- s.add_dependency(%q<will_paginate>, ["~> 3.0.pre2"])
54
+ s.add_dependency(%q<kaminari>, [">= 0"])
55
55
  s.add_dependency(%q<shoulda>, [">= 0"])
56
56
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
57
57
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
@@ -61,7 +61,7 @@ Gem::Specification.new do |s|
61
61
  s.add_dependency(%q<activemodel>, [">= 0"])
62
62
  s.add_dependency(%q<activesupport>, [">= 0"])
63
63
  s.add_dependency(%q<typhoeus>, ["~> 0.2.4"])
64
- s.add_dependency(%q<will_paginate>, ["~> 3.0.pre2"])
64
+ s.add_dependency(%q<kaminari>, [">= 0"])
65
65
  s.add_dependency(%q<shoulda>, [">= 0"])
66
66
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
67
67
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
metadata CHANGED
@@ -1,113 +1,115 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: logical_model
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.10
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.2.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Dwayne Macgowan
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-29 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2011-09-09 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
15
16
  name: activemodel
16
- requirement: &81295300 !ruby/object:Gem::Requirement
17
+ requirement: &id001 !ruby/object:Gem::Requirement
17
18
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *81295300
25
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
26
27
  name: activesupport
27
- requirement: &81294950 !ruby/object:Gem::Requirement
28
+ requirement: &id002 !ruby/object:Gem::Requirement
28
29
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *81294950
36
- - !ruby/object:Gem::Dependency
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
37
38
  name: typhoeus
38
- requirement: &81294600 !ruby/object:Gem::Requirement
39
+ requirement: &id003 !ruby/object:Gem::Requirement
39
40
  none: false
40
- requirements:
41
+ requirements:
41
42
  - - ~>
42
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
43
44
  version: 0.2.4
44
45
  type: :runtime
45
46
  prerelease: false
46
- version_requirements: *81294600
47
- - !ruby/object:Gem::Dependency
48
- name: will_paginate
49
- requirement: &81294180 !ruby/object:Gem::Requirement
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: kaminari
50
+ requirement: &id004 !ruby/object:Gem::Requirement
50
51
  none: false
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 3.0.pre2
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
55
56
  type: :runtime
56
57
  prerelease: false
57
- version_requirements: *81294180
58
- - !ruby/object:Gem::Dependency
58
+ version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
59
60
  name: shoulda
60
- requirement: &81293870 !ruby/object:Gem::Requirement
61
+ requirement: &id005 !ruby/object:Gem::Requirement
61
62
  none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
- version: '0'
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
66
67
  type: :development
67
68
  prerelease: false
68
- version_requirements: *81293870
69
- - !ruby/object:Gem::Dependency
69
+ version_requirements: *id005
70
+ - !ruby/object:Gem::Dependency
70
71
  name: bundler
71
- requirement: &81293480 !ruby/object:Gem::Requirement
72
+ requirement: &id006 !ruby/object:Gem::Requirement
72
73
  none: false
73
- requirements:
74
+ requirements:
74
75
  - - ~>
75
- - !ruby/object:Gem::Version
76
+ - !ruby/object:Gem::Version
76
77
  version: 1.0.0
77
78
  type: :development
78
79
  prerelease: false
79
- version_requirements: *81293480
80
- - !ruby/object:Gem::Dependency
80
+ version_requirements: *id006
81
+ - !ruby/object:Gem::Dependency
81
82
  name: jeweler
82
- requirement: &81293130 !ruby/object:Gem::Requirement
83
+ requirement: &id007 !ruby/object:Gem::Requirement
83
84
  none: false
84
- requirements:
85
+ requirements:
85
86
  - - ~>
86
- - !ruby/object:Gem::Version
87
+ - !ruby/object:Gem::Version
87
88
  version: 1.6.4
88
89
  type: :development
89
90
  prerelease: false
90
- version_requirements: *81293130
91
- - !ruby/object:Gem::Dependency
91
+ version_requirements: *id007
92
+ - !ruby/object:Gem::Dependency
92
93
  name: rcov
93
- requirement: &81292670 !ruby/object:Gem::Requirement
94
+ requirement: &id008 !ruby/object:Gem::Requirement
94
95
  none: false
95
- requirements:
96
- - - ! '>='
97
- - !ruby/object:Gem::Version
98
- version: '0'
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: "0"
99
100
  type: :development
100
101
  prerelease: false
101
- version_requirements: *81292670
102
- description: LogicalModel allows to use a resource as a model. It is based on web
103
- presentation http://www.slideshare.net/ihower/serviceoriented-design-and-implement-with-rails3
102
+ version_requirements: *id008
103
+ description: LogicalModel allows to use a resource as a model. It is based on web presentation http://www.slideshare.net/ihower/serviceoriented-design-and-implement-with-rails3
104
104
  email: dwaynemac@gmail.com
105
105
  executables: []
106
+
106
107
  extensions: []
107
- extra_rdoc_files:
108
+
109
+ extra_rdoc_files:
108
110
  - LICENSE.txt
109
111
  - README.rdoc
110
- files:
112
+ files:
111
113
  - .document
112
114
  - Gemfile
113
115
  - Gemfile.lock
@@ -120,31 +122,34 @@ files:
120
122
  - test/helper.rb
121
123
  - test/test_logical_model.rb
122
124
  homepage: http://github.com/dwaynemac/logical_model
123
- licenses:
125
+ licenses:
124
126
  - MIT
125
127
  post_install_message:
126
128
  rdoc_options: []
127
- require_paths:
129
+
130
+ require_paths:
128
131
  - lib
129
- required_ruby_version: !ruby/object:Gem::Requirement
132
+ required_ruby_version: !ruby/object:Gem::Requirement
130
133
  none: false
131
- requirements:
132
- - - ! '>='
133
- - !ruby/object:Gem::Version
134
- version: '0'
135
- segments:
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ hash: -952763811
138
+ segments:
136
139
  - 0
137
- hash: 427243951
138
- required_rubygems_version: !ruby/object:Gem::Requirement
140
+ version: "0"
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
139
142
  none: false
140
- requirements:
141
- - - ! '>='
142
- - !ruby/object:Gem::Version
143
- version: '0'
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: "0"
144
147
  requirements: []
148
+
145
149
  rubyforge_project:
146
- rubygems_version: 1.8.5
150
+ rubygems_version: 1.8.8
147
151
  signing_key:
148
152
  specification_version: 3
149
153
  summary: LogicalModel allows to use a resource as a model.
150
154
  test_files: []
155
+