api-model 2.4.1 → 2.5.0

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: 2824a025d53804254f083f5def2121ea04c9ca02
4
- data.tar.gz: a0b7b7a237529233ebd6f325e7727ffcab36605c
3
+ metadata.gz: b29d92d816be2e803d052dede7a70e3ffaf783d2
4
+ data.tar.gz: 6a27ad42fdff0c5be3a051214e6576dcacf8abf5
5
5
  SHA512:
6
- metadata.gz: 6c048dc626f37626351951594c90d25b58f4e113fbf07dd1ab129c27b1f0afe6f9da00e0cc8b5a121aa18e9b83fe7ef4c3938dc36cfe7b16f74a7f02cbff1e03
7
- data.tar.gz: 8811f67f0e7e36663090b86257bf80c84fea21f62c9582c4dee36e851e8e322db1484a7d6e2d4f43d13d0460d66909e842d37f32f3af5a959ba37a8a06187ff1
6
+ metadata.gz: 5efc89fd86415888ea6d9a9f34654a7a9cf9ad1c1ec9cd4a0676302fd7a675235580225a2309ff3f41df62c7e78aa283c51f292a2d1fa24fe754ed84572dd7f6
7
+ data.tar.gz: c6286a69a64e01a2bf36874ebc11e3b3bea285d95e77ab1115db26169fee250b4eabb477ceab61494e49a777cd99e21ea06420a895b2c531aa0ac86dc89cab54
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api-model (2.4.1)
4
+ api-model (2.5.0)
5
5
  activemodel (~> 4.1)
6
6
  activesupport (~> 4.1)
7
7
  hash-pipe (~> 0.0)
@@ -12,14 +12,14 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (4.1.8)
16
- activesupport (= 4.1.8)
15
+ activemodel (4.2.1)
16
+ activesupport (= 4.2.1)
17
17
  builder (~> 3.1)
18
- activesupport (4.1.8)
19
- i18n (~> 0.6, >= 0.6.9)
18
+ activesupport (4.2.1)
19
+ i18n (~> 0.7)
20
20
  json (~> 1.7, >= 1.7.7)
21
21
  minitest (~> 5.1)
22
- thread_safe (~> 0.1)
22
+ thread_safe (~> 0.3, >= 0.3.4)
23
23
  tzinfo (~> 1.1)
24
24
  addressable (2.3.5)
25
25
  axiom-types (0.1.1)
@@ -35,13 +35,13 @@ GEM
35
35
  descendants_tracker (0.0.4)
36
36
  thread_safe (~> 0.3, >= 0.3.1)
37
37
  diff-lcs (1.2.5)
38
- domain_name (0.5.23)
38
+ domain_name (0.5.24)
39
39
  unf (>= 0.0.5, < 1.0.0)
40
- equalizer (0.0.9)
40
+ equalizer (0.0.11)
41
41
  ethon (0.7.3)
42
42
  ffi (>= 1.3.0)
43
- ffi (1.9.6)
44
- hash-pipe (0.2.0)
43
+ ffi (1.9.8)
44
+ hash-pipe (0.3.0)
45
45
  activesupport (~> 4.1)
46
46
  http-cookie (1.0.2)
47
47
  domain_name (~> 0.5)
@@ -49,7 +49,7 @@ GEM
49
49
  ice_nine (0.11.1)
50
50
  json (1.8.2)
51
51
  method_source (0.8.2)
52
- minitest (5.5.1)
52
+ minitest (5.6.1)
53
53
  pry (0.9.12.2)
54
54
  coderay (~> 1.0.5)
55
55
  method_source (~> 0.8)
@@ -64,16 +64,16 @@ GEM
64
64
  rspec-mocks (2.14.4)
65
65
  safe_yaml (0.9.7)
66
66
  slop (3.4.6)
67
- thread_safe (0.3.4)
67
+ thread_safe (0.3.5)
68
68
  typhoeus (0.7.1)
69
69
  ethon (>= 0.7.1)
70
70
  tzinfo (1.2.2)
71
71
  thread_safe (~> 0.1)
72
72
  unf (0.1.4)
73
73
  unf_ext
74
- unf_ext (0.0.6)
74
+ unf_ext (0.0.7.1)
75
75
  vcr (2.8.0)
76
- virtus (1.0.4)
76
+ virtus (1.0.5)
77
77
  axiom-types (~> 0.1)
78
78
  coercible (~> 1.0)
79
79
  descendants_tracker (~> 0.0, >= 0.0.3)
data/api-model.gemspec CHANGED
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "api-model"
5
- s.version = "2.4.1"
5
+ s.version = "2.5.0"
6
6
  s.authors = ["Damien Timewell", "Erik Rothoff Andersson"]
7
7
  s.email = ["mail@damientimewell.com", "erik.rothoff@gmail.com"]
8
8
  s.licenses = ['MIT']
@@ -6,14 +6,23 @@ module ApiModel
6
6
 
7
7
  after_initialize :set_default_options
8
8
 
9
- define_model_callbacks :run
9
+ define_model_callbacks :run_request
10
+
11
+ # There is a bug in Rails 4.2 where you can't create instances of classes that have `define_model_callbacks :run`
12
+ # To get around this we internally rename the callback to `run_request`, and alias the methods `before_run` to `before_run_request`
13
+ # This can be removed when the Rails version is fixed.
14
+ class << self
15
+ alias_method :around_run, :around_run_request
16
+ alias_method :before_run, :before_run_request
17
+ alias_method :after_run, :after_run_request
18
+ end
10
19
 
11
20
  def config
12
21
  @config ||= Configuration.new
13
22
  end
14
23
 
15
24
  def run
16
- run_callbacks :run do
25
+ run_callbacks :run_request do
17
26
  Log.debug "#{method.to_s.upcase} #{full_path} with headers: #{options[:headers]}"
18
27
  self.api_call = Typhoeus.send method, full_path, options
19
28
  Response.new self, config
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Timewell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-08 00:00:00.000000000 Z
12
+ date: 2015-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport