flexirest 1.2.7 → 1.2.8

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: 71f15a9ae128d914e4299af6b2df98729145280b
4
- data.tar.gz: 374b73a1124535bb95a8a4abebb90a08cd402cb0
3
+ metadata.gz: 9ee683d1b85b87d73a3dda5878c6cb07721b59ad
4
+ data.tar.gz: 1bb960ed02707f499bbacb8c0b7063448a2b1d58
5
5
  SHA512:
6
- metadata.gz: 98ef9ff1466118b4d1fb39c6b1539ea04c7eb0823cda405850faaa1b13b75c8c5ce424fab97f50429a8a4caa43680d36de8dc2843f31fbf9f4f3356e1ee6855e
7
- data.tar.gz: 780454d7b0f960d595b0e921acf8e3a3fcd7dd962f3deeee348706508c0f43a37115c0129d834faaa983891046f2580bf54d1885ee8bdcc3222c73ff89f4f10e
6
+ metadata.gz: 1d79c8cdbfd32d31ea9709c45fa2a7a6bbd3046d6c5f1b87f449b4719bb746dbfc689de7bb0c59f50b52a580febed42df130813da7364a3543584aaf40bf8b0c
7
+ data.tar.gz: 4d8cca00a320ec1b346b71c800d9ff7c7b6eefc4297cd4d2a88b9f916cef10db2ddef3d556bc21fe04837bd25c67d0b0022cce08cd4ea4f216a8823b90973252
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.8
4
+
5
+ Bugfixes:
6
+
7
+ - There was a strange problem with Flexirest defining methods on `Class` rather than on the specific class (which only presents itself when another class in the application is making use of `method_missing`).
8
+
3
9
  ## 1.2.7
4
10
 
5
11
  Features:
@@ -10,13 +16,13 @@ Features:
10
16
 
11
17
  Bugfixes:
12
18
 
13
- - Fixes case when "Rails" exists but doesn't declare a ".cache" method
19
+ - Fixes case when `Rails` exists but doesn't declare a `.cache` method
14
20
 
15
21
  ## 1.2.4 / 1.2.3
16
22
 
17
23
  Bugfixes:
18
24
 
19
- - Allows setting of base_url, username, password and request_body_type in a project-specific base class, then using that default in subclasses.
25
+ - Allows setting of `base_url`, `username`, `password` and `request_body_type` in a project-specific base class, then using that default in subclasses.
20
26
  - Strings of four digits in the response are no longer treated as (invalid) dates (thanks Tom Hoen)
21
27
  - 1.2.3 was pushed without a successful Travis build
22
28
 
data/README.md CHANGED
@@ -760,14 +760,14 @@ class Person < Flexirest::Base
760
760
  validates :suffix, inclusion: { in: %w{Dr. Mr. Mrs. Ms.}}
761
761
 
762
762
  validates :first_name do |object, name, value|
763
- object.errors[name] << "must be over 4 chars long" if value.length <= 4
763
+ object._errors[name] << "must be over 4 chars long" if value.length <= 4
764
764
  end
765
765
 
766
766
  get :index, '/'
767
767
  end
768
768
  ```
769
769
 
770
- Note the block based validation is responsible for adding errors to `object.errors[name]` (and this will automatically be ready for `<<` inserting into).
770
+ Note: the block based validation is responsible for adding errors to `object._errors[name]` (and this will automatically be ready for `<<` inserting into).
771
771
 
772
772
  Validations are run when calling `valid?` or when calling any API on an instance (and then only if it is `valid?` will the API go on to be called).
773
773
 
@@ -24,10 +24,10 @@ module Flexirest
24
24
  def _map_call(name, details)
25
25
  _calls[name] = {name:name}.merge(details)
26
26
  _calls["lazy_#{name}".to_sym] = {name:name}.merge(details)
27
- self.class.send(:define_method, name) do |options={}|
27
+ (class << self; self; end).send(:define_method, name) do |options={}|
28
28
  _call(name, options)
29
29
  end
30
- self.class.send(:define_method, "lazy_#{name}".to_sym) do |options={}|
30
+ (class << self; self; end).send(:define_method, "lazy_#{name}".to_sym) do |options={}|
31
31
  _call("lazy_#{name}", options)
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.2.7"
2
+ VERSION = "1.2.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexirest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2015-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler