ourkudos 0.0.37 → 0.0.38

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.37
1
+ 0.0.38
@@ -0,0 +1,29 @@
1
+ require 'ourkudos'
2
+ module OurKudos
3
+ module Api
4
+ module Controllers
5
+ module ApiHelper
6
+
7
+ def current_model
8
+ @current_model ||= Kernel.const_get controller_name.singularize.classify
9
+ end
10
+
11
+ def api_columns *skipped
12
+ current_model.column_names.select do |c|
13
+ !c.include?("_id") && !c.include?("_by") &&
14
+ !c.include?("_at") && !skipped.include?(c)
15
+ end
16
+ end
17
+
18
+ def model_as_symbol
19
+ controller_name.singularize.to_sym
20
+ end
21
+
22
+ def model_instance
23
+ instance_variable_get "@#{controller_name.singularize}"
24
+ end
25
+
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,21 @@
1
+ module OurKudos
2
+ module Api
3
+ module Controllers
4
+ module ClientBase
5
+
6
+ include OurKudos::Api::Controllers::ApiHelper
7
+
8
+ def create
9
+ current_user.ourkudos.post("/api/#{controller_name}.json", params[model_as_symbol])
10
+ end
11
+
12
+ def update
13
+ current_user.ourkudos.post("/api/#{controller_name}/#{mode_instance.id.to_s}.json", params[model_as_symbol])
14
+ end
15
+
16
+
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ourkudos}
8
- s.version = "0.0.37"
8
+ s.version = "0.0.38"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marcin Walczak"]
@@ -26,6 +26,8 @@ Gem::Specification.new do |s|
26
26
  "VERSION",
27
27
  "lib/ourkudos.rb",
28
28
  "lib/ourkudos/acts/client.rb",
29
+ "lib/ourkudos/controllers/api_helper.rb",
30
+ "lib/ourkudos/controllers/client_base.rb",
29
31
  "lib/ourkudos/server/response_codes.rb",
30
32
  "lib/ourkudos/strategies/strategy.rb",
31
33
  "ourkudos.gemspec",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ourkudos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.37
4
+ version: 0.0.38
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nestful
17
- requirement: &14780860 !ruby/object:Gem::Requirement
17
+ requirement: &13069580 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *14780860
25
+ version_requirements: *13069580
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &14778840 !ruby/object:Gem::Requirement
28
+ requirement: &13068120 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 2.3.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *14778840
36
+ version_requirements: *13068120
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &14777320 !ruby/object:Gem::Requirement
39
+ requirement: &13066700 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *14777320
47
+ version_requirements: *13066700
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &14774880 !ruby/object:Gem::Requirement
50
+ requirement: &13052620 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *14774880
58
+ version_requirements: *13052620
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: omniauth
61
- requirement: &14770080 !ruby/object:Gem::Requirement
61
+ requirement: &13051260 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *14770080
69
+ version_requirements: *13051260
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rails
72
- requirement: &14768320 !ruby/object:Gem::Requirement
72
+ requirement: &13049160 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *14768320
80
+ version_requirements: *13049160
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rcov
83
- requirement: &14767540 !ruby/object:Gem::Requirement
83
+ requirement: &13047200 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,7 +88,7 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *14767540
91
+ version_requirements: *13047200
92
92
  description: OurKudos client api gem
93
93
  email: marcin.walczak@gmail.com
94
94
  executables: []
@@ -106,6 +106,8 @@ files:
106
106
  - VERSION
107
107
  - lib/ourkudos.rb
108
108
  - lib/ourkudos/acts/client.rb
109
+ - lib/ourkudos/controllers/api_helper.rb
110
+ - lib/ourkudos/controllers/client_base.rb
109
111
  - lib/ourkudos/server/response_codes.rb
110
112
  - lib/ourkudos/strategies/strategy.rb
111
113
  - ourkudos.gemspec
@@ -127,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
129
  version: '0'
128
130
  segments:
129
131
  - 0
130
- hash: 3849104163880743295
132
+ hash: 3777726958266538997
131
133
  required_rubygems_version: !ruby/object:Gem::Requirement
132
134
  none: false
133
135
  requirements: