domoscio_rails 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 547fda71e221ad1dc0f24126c6dc340172cdf8e8
4
- data.tar.gz: 51c5400a303e0bc3011a25e5b673da024dc8ba36
3
+ metadata.gz: e3a4e6040ff1863d92f10beba3851e728573e1c7
4
+ data.tar.gz: 421c65794fee6d6ca04027cdad2c2109c6646242
5
5
  SHA512:
6
- metadata.gz: 8cb736035fbeb6cb7de25ec5250e7f05d0058522ebab7c60ec6d68e6e7aa7374a67b172efc9ad20ac625941de285c312ee28fa2886839f2943b60282fac1b6cf
7
- data.tar.gz: 09b858f99203c39e16fccccd9258c76b4b124825f6186ab2946b6dee1a61e1ff6b92b49c37e40541c67f0fcd69f92d44fd8a4de52e176b378f3dfe321adec4eb
6
+ metadata.gz: 514047ba81f8df95d3bfb72325fc03a9b32fc801e65120842319cf39c7a303e7726ef9ae84c875dbf0d91b5b0e3451f985808f2378a25fa3d1cd6829068aaa1e
7
+ data.tar.gz: 214f475ea990e6c7585466ebb4bd815fc8f23df1c93af788c4f6f4f9356fd7e88f05987bac4b51a47e2c2f5a9954489d7e6619b0f98c8a101186735a40051133
@@ -19,6 +19,7 @@ require 'domoscio_rails/knowledge/knowledge_edge'
19
19
  require 'domoscio_rails/knowledge/knowledge_node'
20
20
  require 'domoscio_rails/data/knowledge_node_student'
21
21
  require 'domoscio_rails/data/result'
22
+ require 'domoscio_rails/utils/review_util'
22
23
 
23
24
 
24
25
  module DomoscioRails
@@ -33,7 +34,7 @@ module DomoscioRails
33
34
  end
34
35
 
35
36
  def root_url
36
- @root_url || (@preproduction == true ? "http://domoscio-stats-engine-api.herokuapp.com/" : "")
37
+ @root_url || (@preproduction == true ? "http://stats-engine.domoscio.com/" : "http://localhost:3000/")
37
38
  end
38
39
  end
39
40
 
@@ -62,7 +63,7 @@ module DomoscioRails
62
63
  #
63
64
  def self.request(method, url, params={}, filters={}, headers = request_headers, before_request_proc = nil)
64
65
  uri = api_uri(url)
65
- uri.query = URI.encode_www_form(filters) unless filters.empty?
66
+ uri.query = URI.encode_www_form(filters) unless filters.empty?
66
67
 
67
68
  res = Net::HTTP.start(uri.host, uri.port) do |http| # , use_ssl: uri.scheme == 'https') do |http|
68
69
  req = Net::HTTP::const_get(method.capitalize).new(uri.request_uri, headers)
@@ -5,6 +5,7 @@ module DomoscioRails
5
5
  include DomoscioRails::HTTPCalls::Create
6
6
  include DomoscioRails::HTTPCalls::Fetch
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+ include DomoscioRails::HTTPCalls::Update
8
9
 
9
10
  end
10
11
  end
@@ -55,5 +55,18 @@ module DomoscioRails
55
55
  end
56
56
  end
57
57
 
58
+ module Util
59
+ module ClassMethods
60
+ def util(id = nil, util_name = nil, params = {})
61
+ DomoscioRails.request(:get, url(id, util_name), params)
62
+ end
63
+ end
64
+
65
+ def self.included(base)
66
+ base.extend(ClassMethods)
67
+ end
68
+ end
69
+
70
+
58
71
  end
59
72
  end
@@ -6,13 +6,16 @@ module DomoscioRails
6
6
  name.split('::')[-1]
7
7
  end
8
8
 
9
- def url(id = nil, nested_model = nil)
9
+ def url(id = nil, util_name = nil)
10
10
  if self == Resource
11
11
  raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.')
12
12
  end
13
13
 
14
14
  build_url = "/v1/companies/#{DomoscioRails.configuration.client_id}"
15
15
  build_url << "/#{class_name.underscore}s"
16
+ if util_name
17
+ build_url << "/#{util_name}"
18
+ end
16
19
  if id
17
20
  build_url << "/#{CGI.escape(id.to_s)}"
18
21
  end
@@ -0,0 +1,6 @@
1
+ module DomoscioRails
2
+ # A company.
3
+ class ReviewUtil < Resource
4
+ include DomoscioRails::HTTPCalls::Util
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module DomoscioRails
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domoscio_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoit Praly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-23 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -49,6 +49,7 @@ files:
49
49
  - lib/domoscio_rails/knowledge/knowledge_node.rb
50
50
  - lib/domoscio_rails/resource.rb
51
51
  - lib/domoscio_rails/student/student.rb
52
+ - lib/domoscio_rails/utils/review_util.rb
52
53
  - lib/domoscio_rails/version.rb
53
54
  - lib/tasks/domoscio_rails_tasks.rake
54
55
  homepage: http://www.domoscio.com