restly 0.0.1.alpha.22 → 0.0.1.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,12 +11,12 @@ class Restly::Base::Resource::Specification::Fields < Restly::Proxies::Base
11
11
 
12
12
  def - field
13
13
  @removed << field
14
- method_missing __method__, field
14
+ replace(__getobj__.send __method__, field)
15
15
  end
16
16
 
17
17
  def + field
18
18
  @added << field
19
- method_missing __method__, field
19
+ replace(__getobj__.send __method__, field)
20
20
  end
21
21
 
22
22
  private
@@ -24,14 +24,18 @@ class Restly::Base::Resource::Specification::Fields < Restly::Proxies::Base
24
24
  def method_missing(m, *args, &block)
25
25
  reload_specification! if !super.present? || m == :inspect
26
26
  if (value = super).is_a? self.class
27
- duplicate = self.dup
28
- duplicate.__setobj__ super
29
- duplicate
27
+ replace(super)
30
28
  else
31
29
  value
32
30
  end
33
31
  end
34
32
 
33
+ def replace(object)
34
+ duplicate = self.dup
35
+ duplicate.__setobj__ object
36
+ duplicate
37
+ end
38
+
35
39
  def reload_specification!
36
40
  from_spec = spec[:attributes] || []
37
41
  fields = (from_spec - @removed.to_a) + @added.to_a
@@ -65,7 +65,6 @@ class Restly::Connection < OAuth2::AccessToken
65
65
 
66
66
  def request(verb, path, opts={}, &block)
67
67
  path = [base_path, path.gsub(/^\/?/, '')].join('/')
68
- puts path.blue
69
68
 
70
69
  if cache && !opts[:force]
71
70
  request_log("Restly::CacheRequest", path, verb) do
@@ -1,3 +1,3 @@
1
1
  module Restly
2
- VERSION = "0.0.1.alpha.22"
2
+ VERSION = "0.0.1.beta.1"
3
3
  end
data/lib/restly.rb CHANGED
@@ -1,4 +1,3 @@
1
- require "colorize" if defined?(IRB)
2
1
  require "active_support"
3
2
  require "restly/version"
4
3
  require "oauth2"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha.22
4
+ version: 0.0.1.beta.1
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: